/* ============================================================
   ISTA HEROES — Living Grid kinetic hero
   Extracted from the flagship design system; one shared file
   so every page's hero shares the same vocabulary, the same
   reveals, the same parallax, the same line-mask intro.
   Asset paths are project-local: assets/...
   ============================================================ */

:root {
  --hm-mega:  clamp(3rem, 9vw, 9rem);
  --hm-huge:  clamp(2rem, 5vw, 4.5rem);
  --hm-lead:  clamp(1.05rem, 1.4vw, 1.45rem);
  --hm-edge:  clamp(1.5rem, 4vw, 4rem);
  --hm-ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reveal-on-scroll — base state is the VISIBLE end, JS arms hide */
.reveal-armed [data-reveal] { opacity: 0; transform: translateY(38px); }
.reveal-armed [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--hm-ease), transform .9s var(--hm-ease);
}
.reveal-armed [data-reveal-delay="1"].is-in { transition-delay: .08s; }
.reveal-armed [data-reveal-delay="2"].is-in { transition-delay: .16s; }
.reveal-armed [data-reveal-delay="3"].is-in { transition-delay: .24s; }
.reveal-armed [data-reveal-delay="4"].is-in { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal-armed [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   HERO — kinetic color-blocking, tonal movements
   ============================================================ */
.fl-hero {
  position: relative; min-height: clamp(620px, 82vh, 820px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(7rem, 12vw, 11rem) var(--hm-edge) clamp(2.5rem, 5vw, 5rem);
  overflow: hidden; isolation: isolate; color: #fff;
  --hero-bg:     #17154f; /* default blue-4 */
  --hero-rect1:  #1134ff;
  --hero-accent: #aee914;
  --hero-lead:   #cfd6ef;
  background: var(--hero-bg);
  transition: background .6s var(--hm-ease);
}
.fl-hero[data-movement="green"]   { --hero-bg:#062d08; --hero-rect1:#aee914; --hero-accent:#aee914; --hero-lead:#def6aa; }
.fl-hero[data-movement="magenta"] { --hero-bg:#411c4c; --hero-rect1:#fc00b4; --hero-accent:#f7b2ec; --hero-lead:#f7b2ec; }

/* Top protection scrim — keep nav legible on any movement */
.fl-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px;
  background: linear-gradient(rgba(0,0,0,0.4), transparent);
  z-index: 1; pointer-events: none;
}

/* Faint 8-cell square grid texture — the Living Grid */
.fl-hero__grid {
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 12.5vw 12.5vw;
  z-index: 0;
}

/* Parallax block container */
.fl-hero__blocks { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.fl-block { position: absolute; will-change: transform; }

/* Masked photo with the brand notch cut-out */
.fl-hero__photo {
  top: 0; right: 0; width: 50vw; height: 78vh;
  background-size: cover; background-position: 35% center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 25% 100%, 25% 78%, 0 78%);
}
.fl-hero__photo::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--hero-bg) 92%, transparent) 0%, color-mix(in srgb, var(--hero-bg) 45%, transparent) 28%, transparent 55%),
    linear-gradient(0deg, color-mix(in srgb, var(--hero-bg) 55%, transparent) 0%, transparent 38%);
}

/* Three accent rectangles */
.fl-hero__rect-1 {
  top: 14vh; right: 40vw; width: 16vw; height: 16vw;
  background: var(--hero-rect1); mix-blend-mode: screen;
  transition: background .6s var(--hm-ease);
}
.fl-hero__rect-2 {
  bottom: 0; right: 12vw; width: 12vw; height: 25vh;
  background: var(--hero-accent);
  transition: background .6s var(--hm-ease);
}
.fl-hero__rect-3 {
  top: 0; right: 12.5vw; width: 1px; height: 100%;
  background: rgba(255,255,255,0.16);
}

/* Inner content column */
.fl-hero__inner {
  position: relative; z-index: 2;
  max-width: 1376px;
  width: 100%;
  margin: 0 auto;
}

/* Eyebrow with leading accent rule */
.fl-hero__eyebrow {
  display: flex; align-items: center; gap: 0.8em;
  margin-bottom: clamp(1.25rem, 3vw, 2.5rem);
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  font-size: clamp(0.72rem, 0.9vw, 0.9rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hero-accent);
}
.fl-hero__eyebrow::before {
  content: ""; width: clamp(28px, 4vw, 64px); height: 2px;
  background: var(--hero-accent);
  transition: background .5s var(--hm-ease);
}

/* Monumental H1 with line-mask intro — CSS-only, plays on page load */
.fl-hero__title {
  font-family: 'Surt', sans-serif;
  font-weight: 300;
  font-size: var(--hm-mega);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #fff;
  margin: 0;
  max-width: 16ch;
}
.fl-hero__title .ln { display: block; overflow: hidden; }
.fl-hero__title .ln > span {
  display: block;
  animation: fl-line-up 1s var(--hm-ease) both;
}
.fl-hero__title .ln:nth-child(1) > span { animation-delay: 0.20s; }
.fl-hero__title .ln:nth-child(2) > span { animation-delay: 0.30s; }
.fl-hero__title .ln:nth-child(3) > span { animation-delay: 0.40s; }
.fl-hero__title .ln:nth-child(4) > span { animation-delay: 0.50s; }
@keyframes fl-line-up {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-hero__title .ln > span { animation: none !important; }
}

.fl-hero__title em {
  font-style: italic; font-weight: 300;
  color: var(--hero-accent);
  transition: color .5s var(--hm-ease);
}

/* Lead paragraph and meta column */
.fl-hero__lead {
  font-family: 'Rubik', sans-serif;
  font-size: var(--hm-lead);
  font-weight: 300;
  line-height: 1.45;
  color: var(--hero-lead);
  max-width: 46ch;
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(2rem, 4vw, 3rem);
  transition: color .5s var(--hm-ease);
}

/* Split lead row: lead + meta column */
.fl-hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(2rem, 4vw, 3rem);
}
.fl-hero__row .fl-hero__lead { margin: 0; }

/* Scroll cue */
.fl-hero__scroll {
  position: absolute;
  left: var(--hm-edge);
  bottom: clamp(2rem, 4vw, 3rem);
  display: flex; align-items: center; gap: 0.7em;
  color: var(--hero-lead);
  font-family: 'Rubik', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  z-index: 2;
  opacity: 0.85;
}
.fl-hero__scroll i {
  display: block; width: 1px; height: 42px;
  background: linear-gradient(var(--hero-accent), transparent);
  animation: flScroll 2s ease-in-out infinite;
}
@keyframes flScroll {
   0%  { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-hero__scroll i { animation: none; transform: scaleY(1); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .fl-hero__photo { width: 100vw; height: 56vh; opacity: 0.4; }
  .fl-hero__rect-1 { display: none; }
  .fl-hero__row { grid-template-columns: 1fr; gap: 1.5rem; }
  .fl-hero { justify-content: center; padding-top: 22vh; }
}
