/* AALF 2026 · the hero: the film on the wall, and the copy written onto the same wall
   ---------------------------------------------------------------------------------
   The layout is drawn for a 1440 x 810 frame and scaled with --k (set by js/hero.js: the smaller of width/1440 and
   height/810), so the copy keeps its place against the film at any desktop size. Below 760px wide the copy moves
   under the picture (see the end of this file). The site's bar (css/site.css) lies over the film, transparent.

   Three kinds of layer, all inside .hero (which is one stacking context, isolated from the page):
   - .ink   the eyebrows and headlines. They multiply onto the film, so they take the room's light: the dawn's leaf
            shadows, the soft shade on the copy's side, a hide's shadow passing over them. Nothing between them and
            the video may start a stacking context (no transform, filter or opacity on .ch, .stack or .head).
   - .fx    copies of the headlines that only carry light (a glint, the knife's bright edge); they screen onto the
            film and the ink.
   - plain  the body copy, the sector tags and the buttons: drawn normally, so they stay crisp and clickable. */

.hero {
  --k: 1;
  /* the film's own shades of ink (tuned against the plaster in the film) */
  --soft: rgba(13, 36, 22, 0.8);
  --muted: rgba(13, 36, 22, 0.76);
  --faint: rgba(13, 36, 22, 0.62);
  --line: rgba(13, 36, 22, 0.2);
  --ghost: rgba(13, 36, 22, 0.42);
  position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden;
  isolation: isolate; background: var(--wall); color: var(--ink); line-height: normal;
}

/* the film ---------------------------------------------------------------------------------------------------- */
.hero__film { position: absolute; inset: 0; }
.hero__video, .hero__frame { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; }
.hero__frame { display: none; }
.hero.is-preview .hero__video { display: none; }
.hero.is-preview .hero__frame { display: block; }

/* the copy's side of the frame goes soft while the knife is close on the leather (the film's own shallow focus,
   carried a little further under the words), and a little lighter, so the dark ink reads */
.hero__pool {
  position: absolute; left: 0; bottom: 0; width: calc(var(--k) * 900px); height: calc(var(--k) * 640px);
  opacity: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(calc(var(--k) * 5px)) saturate(0.92); backdrop-filter: blur(calc(var(--k) * 5px)) saturate(0.92);
  background: radial-gradient(50% 50% at 50% 50%, rgba(247, 236, 219, 0.66), rgba(247, 236, 219, 0.4) 55%, rgba(247, 236, 219, 0) 100%);
  -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 45%, transparent 100%);
          mask-image: radial-gradient(50% 50% at 50% 50%, #000 45%, transparent 100%);
}

/* the facts: the page's furniture, not part of the scene -------------------------------------------------------- */
.hero__facts {      /* on the copy's side only: the console, the goods and the trimmings' pile keep the right */
  position: absolute; left: calc(var(--k) * 56px); width: calc(var(--k) * 640px); bottom: calc(var(--k) * 24px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--k) * 7px) calc(var(--k) * 28px);
  padding-top: calc(var(--k) * 14px); border-top: 1px solid var(--line);
  font-size: calc(var(--k) * 13.5px); color: var(--muted);
}
.hero__facts span { display: inline-flex; align-items: center; gap: 10px; }
.hero__facts b { color: var(--ink); }
.hero__facts svg { width: calc(var(--k) * 18px); height: calc(var(--k) * 18px); }

/* the story's progress: five bars, the current one filling as its chapter plays */
.rail { position: absolute; left: calc(var(--k) * 56px); bottom: calc(var(--k) * 112px); z-index: 4;
  display: flex; align-items: center; gap: calc(var(--k) * 6px); pointer-events: none; }
.rail__seg { position: relative; display: block; width: calc(var(--k) * 28px); height: 3px; border-radius: 2px;
  background: rgba(13, 36, 22, 0.2); overflow: hidden; }
.rail__seg i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.rail__seg.is-done i { background: rgba(13, 36, 22, 0.55); }
.rail__count { margin-left: calc(var(--k) * 10px); height: calc(var(--k) * 14px); overflow: hidden;
  font-size: calc(var(--k) * 11px); line-height: calc(var(--k) * 14px); font-weight: 700; letter-spacing: 0.14em; color: var(--faint);
  display: inline-flex; gap: 0.35em; }
.rail__num { display: inline-block; height: calc(var(--k) * 14px); }
.rail__num b { display: block; font-weight: 700; color: var(--ink); }

/* the chapters ----------------------------------------------------------------------------------------------- */
.hero__copy { position: absolute; inset: 0; pointer-events: none; }   /* no z-index: it would cut the ink off from the film */
.hero .ch {
  position: absolute; left: calc(var(--k) * 56px); bottom: calc(var(--k) * 146px); width: calc(var(--k) * 760px);
  display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--k) * 22px);
  visibility: hidden;
}
.hero .ch.is-on { visibility: visible; }
.hero .ch.is-on .ctas, .hero .ch.is-on .chips { pointer-events: auto; }

/* everything that moves is placed by js/hero.js from its top-left corner */
.hero .eyebrow, .hero .ln, .hero .lede, .hero .ctas, .hero .chip, .hero .w, .rail__num { transform-origin: 0 0; will-change: transform, opacity; }

.hero .ink { mix-blend-mode: multiply; }

.hero .eyebrow { margin: 0; display: inline-flex; align-items: center; gap: calc(var(--k) * 10px);
  font-size: calc(var(--k) * 12px); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--eyebrow); }
.hero .eyebrow::before { content: none; }

.hero .stack { display: grid; }
.hero .stack > * { grid-area: 1 / 1; }
.hero .head { margin: 0; font-weight: 900; font-stretch: 82%; letter-spacing: -0.01em; line-height: 0.95;
  font-size: calc(var(--k) * 56px); color: var(--ink); text-wrap: initial; }
.hero .head--xl { font-size: calc(var(--k) * 68px); line-height: 0.93; }
.hero .head--m { font-size: calc(var(--k) * 48px); }
.hero .ln { position: relative; display: block; width: max-content; max-width: none; padding-bottom: 0.04em; }
.hero .acc { color: var(--accent); }
.hero .w { display: inline-block; }

/* light-only copies of the headlines (glints, the blade's edge): screened on, transparent where no light falls */
.hero .fx { pointer-events: none; mix-blend-mode: screen; }
.hero .fx .ln, .hero .fx .acc { color: transparent; }
.hero .fx .ln { background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; }
.hero .fx .w { color: transparent; background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; }
.hero .fx .trim, .hero .fx .stitch, .hero .fx .eyelet { visibility: hidden; }

.hero .lede { margin: 0; max-width: 44ch; font-size: calc(var(--k) * 19px); line-height: 1.45; color: var(--soft);
  text-shadow: 0 0 calc(var(--k) * 14px) rgba(250, 242, 230, 0.55); }
.hero .lede--narrow { max-width: 40ch; }

/* chapter 2: the hot line that trims a hide, and Addis's brass eyelet */
.hero .trim { position: absolute; left: 0; bottom: 0.07em; height: max(2px, calc(var(--k) * 2.2px)); width: 0;
  border-radius: 2px; background: linear-gradient(90deg, rgba(255, 106, 31, 0.15), var(--hot) 70%, #ffd2a8);
  box-shadow: 0 0 calc(var(--k) * 8px) rgba(255, 106, 31, 0.85), 0 0 calc(var(--k) * 18px) rgba(255, 150, 60, 0.5); }
.hero .eyelet { position: relative; display: inline-block; flex: none; width: calc(var(--k) * 15px); height: calc(var(--k) * 15px); border-radius: 50%;
  background: var(--eyelet); transform-origin: 50% 50%; transform: scale(0); }

/* chapter 3: the nine sectors, each with a swatch of the hide that lands as it does */
.hero .chips { display: flex; flex-wrap: wrap; gap: calc(var(--k) * 8px); max-width: calc(var(--k) * 700px); margin: 0; padding: 0; list-style: none; }
.hero .chip { display: inline-flex; align-items: center; gap: calc(var(--k) * 8px); padding: calc(var(--k) * 7px) calc(var(--k) * 13px) calc(var(--k) * 7px) calc(var(--k) * 9px);
  border: 1px solid rgba(13, 36, 22, 0.28); border-radius: 999px; background: rgba(250, 244, 234, 0.72);
  font-size: calc(var(--k) * 13px); font-weight: 600; color: var(--ink); opacity: 0; }
.hero .chip__sw { display: block; flex: none; width: calc(var(--k) * 10px); height: calc(var(--k) * 10px); border-radius: 50%;
  background: var(--sw, #8a5a32);
  box-shadow: inset calc(var(--k) * -1px) calc(var(--k) * -1.5px) calc(var(--k) * 2px) rgba(0, 0, 0, 0.35), inset calc(var(--k) * 1px) calc(var(--k) * 1px) calc(var(--k) * 1.5px) rgba(255, 255, 255, 0.35); }

/* chapter 5: the gold thread under Africa */
.hero .africa { position: relative; }
.hero .stitch { position: absolute; left: 0.02em; right: 0.12em; bottom: -0.10em; height: 0.16em; overflow: visible; max-width: none; }
.hero .stitch path { fill: none; stroke: var(--gold); stroke-linecap: round; }

/* the buttons */
.hero .ctas { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--k) * 14px); margin-top: calc(var(--k) * 8px); }
.hero .btn { line-height: normal; gap: calc(var(--k) * 12px); min-height: calc(var(--k) * 52px); padding: 0 calc(var(--k) * 26px); font-size: calc(var(--k) * 16px); }
.hero .btn svg { width: calc(var(--k) * 20px); height: calc(var(--k) * 20px); }
.hero .btn--ghost { padding: 0 calc(var(--k) * 24px); }
.hero .btn--link { min-height: calc(var(--k) * 52px); padding: 0 8px; gap: calc(var(--k) * 10px); color: rgba(13, 36, 22, 0.86); font-weight: 600; font-size: calc(var(--k) * 15px); }

/* the page before the script runs (and without it): chapter 1 as a still */
.hero:not(.is-live) .ch[data-ch="1"] { visibility: visible; }

/* phones: the picture on top, the copy beneath it on the wall's colour ---------------------------------------- */
@media (max-width: 759px) {
  .hero { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .hero__film { position: relative; aspect-ratio: 4 / 5; }
  .hero__video, .hero__frame { object-position: 64% 50%; }
  .hero__pool { display: none; }
  .hero__copy { position: relative; inset: auto; min-height: 430px; }
  .hero .ch { left: 18px; right: 18px; bottom: auto; top: 22px; width: auto; gap: 16px; }
  .hero .head { font-size: 40px; } .hero .head--xl { font-size: 44px; } .hero .head--m { font-size: 36px; }
  .hero .ln { width: auto; }
  .hero .lede { font-size: 17px; }
  .hero .chip { font-size: 12px; }
  .hero .eyebrow { font-size: 11px; }
  .hero .btn { min-height: 48px; font-size: 15px; }
  .rail { position: relative; left: auto; bottom: auto; margin: 0 18px 14px; }
  .rail__count { color: var(--muted); }
  .hero__facts { position: relative; left: auto; right: auto; bottom: auto; width: auto; margin: 0 18px 22px; font-size: 13px; gap: 8px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero .ln, .hero .lede, .hero .ctas, .hero .chip, .hero .w { will-change: auto; }
}
