/* Story 27.6 — front-door hero at `/`.
   Ported from the CEO-approved prototype
   (output/planning-artifacts/prototypes/front-door-hero-27.6.html): lights-on
   intro, spotlight rig, lifting platform, 3D logo with a roof flag, Option E front-squat
   links, chalk + random-move layers. Loaded after front-door.css and reuses
   its tokens; hero-only values are scoped to `.hero-stage`.
   Every hero class is prefixed `hero-` (the prototype's spotlight `.beam`
   once collided with the button's `.beam`); button internals are only ever
   selected under `.hero-lift`.
   Mobile-first: base rules target 360px, the 720px query scales up.
   CSP: styles are self-hosted, no web fonts (Barlow falls back as in 27.2). */

.hero-stage {
  --iron-1: #1C220E;
  --iron-2: #394121;
  --hero-line-accent: rgba(168,188,76,0.55);
  --steel: linear-gradient(to bottom, #E4E7D6 0%, #A7AD92 45%, #6E7459 100%);
  --mx: 50%;
  --my: 45%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  /* One explicit, shrinkable column: an implicit `auto` track grows to the
     buttons' max-content width, and every percentage width below (the logo)
     would then resolve against a track wider than the screen. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: 36px;
  padding: 180px 16px 96px;      /* top clears the truss + fixtures; content sits at true centre */
  background: radial-gradient(ellipse 60% 45% at 50% 32%, rgba(168,188,76,0.09), transparent 70%), var(--bg-canvas);
}
.hero-stage > * { position: relative; z-index: 2; }
.hero-stage > .hero-chalk, .hero-stage > .hero-spot, .hero-stage > .hero-rig, .hero-stage > .hero-pools, .hero-stage > .hero-floor, .hero-stage > .hero-flash { position: absolute; z-index: 0; pointer-events: none; }
.hero-stage > .hero-chalk { inset: 0; width: 100%; height: 100%; z-index: 1; }
.hero-spot { inset: 0; background: radial-gradient(circle 340px at var(--mx) var(--my), rgba(196,214,107,.13), transparent 70%); transition: background .1s linear; }

/* Stage spotlights hung on a truss, fixed aims -15/0/+15deg. Each
   beam is a soft-edged cone with a hot core, it throws a pool of light on the
   platform, and chalk dust lights up when it drifts through a beam. */
.hero-rig { inset: 0; }
.hero-truss { position: absolute; left: 0; right: 0; top: 0; height: 44px;
  border-top: 5px solid #8E947B; border-bottom: 5px solid #8E947B;
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(142,148,123,.9) 58px 62px),           /* verticals */
    repeating-linear-gradient(56deg, transparent 0 26px, rgba(142,148,123,.75) 26px 29px),            /* diagonals */
    repeating-linear-gradient(-56deg, transparent 0 26px, rgba(142,148,123,.75) 26px 29px),
    linear-gradient(#1C2113, #11150B);
  box-shadow: 0 6px 16px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12); }
/* Fixed aims (JS sets --a once): the lights hold still. */
.hero-fx { position: absolute; top: 76px; left: var(--x); width: 0; height: 0; transform: rotate(var(--a, 0deg)); }
.hero-fx:nth-child(2) { --x: 16%; --d: .1s; }
.hero-fx:nth-child(3) { --x: 50%; --d: .3s; }
.hero-fx:nth-child(4) { --x: 84%; --d: .5s; }
.hero-fx::before { content: ''; position: absolute; left: -5px; top: -34px; width: 10px; height: 22px; background: linear-gradient(90deg, #4D533C, #8E947B, #4D533C); border-radius: 2px; } /* clamp to the truss */
.hero-fx::after { content: ''; position: absolute; left: -31px; top: -14px; width: 62px; height: 40px; border: 5px solid #5D6349; border-top-width: 6px; border-bottom: 0; border-radius: 8px 8px 0 0; } /* yoke */
.hero-can { position: absolute; left: -24px; top: -10px; width: 48px; height: 52px; border-radius: 10px 10px 6px 6px;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.35) 0 2px, transparent 2px 5px) top / 100% 45% no-repeat,
              linear-gradient(90deg, #1B2013, #4A5236 45%, #1B2013);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.6); }
.hero-lens { position: absolute; left: -20px; top: 38px; width: 40px; height: 10px; border-radius: 50%; background: #FFFBEA;
  box-shadow: 0 0 8px 2px rgba(255,250,225,.95), 0 0 34px 12px rgba(236,240,200,.45), 0 0 90px 30px rgba(196,214,107,.18); }
.hero-glare { position: absolute; left: -120px; top: 42px; width: 240px; height: 2px; border-radius: 2px; opacity: .7;
  background: linear-gradient(90deg, transparent, rgba(255,250,225,.8) 45%, #fff 50%, rgba(255,250,225,.8) 55%, transparent); } /* anamorphic streak */
.hero-ray { position: absolute; left: -320px; top: 44px; width: 640px; height: 1400px; mix-blend-mode: screen; filter: blur(9px);
  clip-path: polygon(48.2% 0, 51.8% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom, rgba(255,250,228,.30) 0%, rgba(242,245,210,.14) 24%, rgba(196,214,107,.06) 50%, transparent 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 36%, #000 64%, transparent 98%);
          mask-image: linear-gradient(90deg, transparent 2%, #000 36%, #000 64%, transparent 98%); }
.hero-ray::after { content: ''; position: absolute; inset: 0; clip-path: polygon(49.3% 0, 50.7% 0, 66% 100%, 34% 100%);
  background: linear-gradient(to bottom, rgba(255,255,245,.22), rgba(255,250,228,.06) 38%, transparent 65%); } /* hot core */
/* Middle fixture is the key light: wider and dimmer. The intro animates
   opacity (filled to 1), so dim with a filter instead. */
.hero-fx.hero-key .hero-ray { transform: scaleX(1.25); transform-origin: 50% 0; filter: blur(9px) brightness(.8); }
.hero-pools { inset: 0; }
.hero-pools i { position: absolute; left: var(--px, -999px); top: var(--py, -999px); width: 320px; height: 74px; margin: -37px 0 0 -160px;
  border-radius: 50%; mix-blend-mode: screen; filter: blur(3px);
  background: radial-gradient(closest-side, rgba(255,250,228,.30), rgba(226,236,180,.14) 55%, rgba(196,214,107,.05) 80%, transparent); }

/* Olympic lifting platform: wood centre, rubber sides, seen in perspective. */
.hero-floor { left: -25%; right: -25%; bottom: -4%; height: 48%; perspective: 640px; }
.hero-platform {
  position: absolute; inset: 0; transform: rotateX(66deg); transform-origin: 50% 100%;
  background:
    linear-gradient(90deg, transparent 29.6%, rgba(168,188,76,.55) 29.8% 30.2%, transparent 30.4% 69.6%, rgba(168,188,76,.55) 69.8% 70.2%, transparent 70.4%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 46px),
    linear-gradient(90deg, #0E1108 0 30%, #3B3321 30% 70%, #0E1108 70%);
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 95%);
          mask-image: linear-gradient(to top, #000 35%, transparent 95%);
}
.hero-platform::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(226,236,180,.16) 50%, transparent 65%); background-size: 300% 100%; animation: sweepFloor 7s 2s ease-in-out infinite; }
@keyframes sweepFloor { 0% { background-position: 120% 0; } 35%, 100% { background-position: -40% 0; } }
.hero-flash { inset: 0; background: radial-gradient(ellipse at 50% 35%, #fff, rgba(255,255,255,.4) 40%, transparent 75%); opacity: 0; mix-blend-mode: screen; }

/* ─── 3D logo ─────────────────────────────────────────────────────────── */

/* Phones: 16px of air each side so the roof flag (flush with the logo's right
   edge) survives the translateZ scale + idle float without being clipped. */
.hero-3d { perspective: 1000px; width: min(calc(100% - 32px), 806px); animation: float 9s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes float { 0%, 100% { transform: rotateY(-3deg) translateY(0); } 50% { transform: rotateY(3deg) translateY(-6px); } }
/* The house holds still while someone is on the logo. The tilt reset is
   instant too, so the move measures the settled logo. */
.hero-stage.hero-on-logo .hero-3d { animation: none; }
.hero-stage.hero-on-logo .hero-tilt { transition: none; }
.hero-tilt { position: relative; transform-style: preserve-3d; transition: transform .18s ease-out; }
.hero-glow { position: absolute; inset: 8% 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(168,188,76,.38), transparent); filter: blur(22px); transform: translateZ(-80px) scale(1.2); }
/* The <h1>: visually-hidden "Welcome to" + the logo's alt text. */
.hero-logo { position: relative; display: block; font-size: inherit; transform: translateZ(40px); transform-style: preserve-3d; }

/* 3x logo: 384px tall x 650/310 aspect = 806px wide; capped to the screen. */
.hero-stage .brand-logo {
  width: min(100%, 806px);
  height: auto;
  filter: brightness(1.6) drop-shadow(0 0 60px rgba(168,188,76,0.32));
}

/* "Welcome to" is a flag on the barn roof. Pole base sits on the roof line:
   measured from the logo PNG (650x310), right slope at x=429, y=61; the base
   sinks into the stroke. */
.hero-flag { position: absolute; left: 66%; bottom: 78.4%; width: 34%; height: 39.9%; pointer-events: none; }
.hero-pole { position: absolute; left: 0; bottom: 0; width: 1.4%; min-width: 3px; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #7B8166, #F2F4E6 45%, #8A9075); box-shadow: 0 0 10px rgba(226,236,180,.35); }
.hero-pole::after { content: ''; position: absolute; left: 50%; bottom: -1px; width: 14px; height: 5px; margin-left: -7px; border-radius: 2px; background: #C9CDB8; transform: rotate(-26deg); } /* roof mount, matches the slope */
.hero-pole::before { content: ''; position: absolute; left: 50%; top: -7px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--accent-hover) 55%, #6f7d2c); box-shadow: 0 0 12px rgba(196,214,107,.8); }
.hero-cloth { position: absolute; left: 1.2%; top: 2%; width: 98.8%; height: 62%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)) drop-shadow(0 0 16px rgba(196,214,107,.25)); }

.hero-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.95) 50%, transparent 58%);
  background-size: 260% 100%; background-position: 150% 0;
  -webkit-mask: url("/public/tlt-logo-light.png") center / contain no-repeat;
          mask: url("/public/tlt-logo-light.png") center / contain no-repeat;
  mix-blend-mode: screen; animation: shine 6s 1.3s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 150% 0; } 16%, 100% { background-position: -50% 0; } }

/* ─── The lights-on intro (plays once on load; the page at rest is fully visible) ── */

.intro .hero-fx :is(.hero-ray, .hero-glare), .intro .hero-pools i { animation: powerOn 1s var(--d, 0s) both; }
.intro .hero-fx .hero-lens { animation: lensOn 1s var(--d, 0s) both; }
.intro .hero-pools i:nth-child(1) { --d: .1s; } .intro .hero-pools i:nth-child(2) { --d: .3s; } .intro .hero-pools i:nth-child(3) { --d: .5s; }
@keyframes powerOn { 0% { opacity: 0; } 10% { opacity: 1; } 16% { opacity: .1; } 26% { opacity: 1; } 34% { opacity: .35; } 48%, 100% { opacity: 1; } }
@keyframes lensOn { 0% { opacity: .15; filter: brightness(.4); } 10% { opacity: 1; filter: brightness(2.2); } 16% { opacity: .3; } 26% { opacity: 1; filter: brightness(1.6); } 48%, 100% { opacity: 1; filter: brightness(1); } }
.intro .hero-platform { animation: floorOn .8s .45s both; }
@keyframes floorOn { from { opacity: 0; } to { opacity: 1; } }
.intro .hero-flash { animation: flash .7s .7s ease-out both; }
@keyframes flash { 0% { opacity: 0; } 18% { opacity: .75; } 100% { opacity: 0; } }
.intro .hero-logo { animation: slam .75s .55s cubic-bezier(.2,.8,.25,1) both; }
@keyframes slam { 0% { opacity: 0; transform: translateZ(260px) scale(1.25); filter: blur(14px); } 60% { opacity: 1; transform: translateZ(28px) scale(.97); filter: blur(0); } 100% { opacity: 1; transform: translateZ(40px) scale(1); } }
.intro.shake { animation: shake .35s 1s both; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 1px); } }
.intro .hero-cloth { animation: hoist 1s 1.05s cubic-bezier(.25,.8,.25,1) both; }
@keyframes hoist { from { transform: translateY(125%); opacity: 0; } 12% { opacity: 1; } to { transform: translateY(0); opacity: 1; } }
.intro .hero-links > * { animation: rise .6s 1.35s cubic-bezier(.2,.8,.25,1) both; }
.intro .hero-links > *:nth-child(2) { animation-delay: 1.5s; }
@keyframes rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Option E: front-squat links ─────────────────────────────────────── */

.hero-links { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 0; }
/* The links carry right padding for the lifter's run-up (36px here, 118px
   from 720px); the row is offset to match so the visible face+sleeve centres
   under the house. Phones stack the links, so a 36px margin would widen the
   grid track past the screen and push the logo off-centre too: shift by half
   the padding with `left` instead, which doesn't take part in layout. */
.hero-links { left: 18px; }

/* The link box carries room above for the lifter's head and to the right for
   his run-up; the fig svg is pinned to the bar's centre line (70 + 58/2). */
.hero-lift {
  position: relative; display: inline-block;
  padding: 70px 36px 38px 0;
  color: inherit; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.hero-lift:focus-visible { outline: none; }
.hero-lift:focus-visible .face { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero-lift .beam { position: relative; display: flex; align-items: center; transform-origin: 0 50%; transition: transform .45s var(--ease); }
.hero-lift.lifting .beam { transition: none; }
.hero-lift .face {
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 12px 0 14px;
  background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .2s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.hero-lift .label { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-primary); white-space: normal; text-wrap: balance; }
/* Phones: a link never exceeds the column; a long label wraps to two lines
   inside the 58px face instead of pushing the sleeve off-screen. The 36px
   lifter clearance is untouched. */
.hero-lift { max-width: 100%; }
@media (max-width: 360px) {
  .hero-lift .face { gap: 8px; padding: 0 10px 0 12px; }
  .hero-lift .label { font-size: 16px; }
}
.hero-lift .arrow { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hero-line-accent); color: var(--accent); transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.hero-lift .arrow svg { width: 15px; height: 15px; }
.hero-lift:is(:hover, :focus-visible, .lifting) .arrow { background: var(--accent); color: var(--bg-canvas); transform: translateX(3px); }
.hero-lift:is(:hover, :focus-visible, .lifting) .face { border-color: var(--hero-line-accent); }
.hero-lift .sleeve { position: relative; width: 56px; height: 6px; margin-left: -1px; border-radius: 0 3px 3px 0; background: var(--steel); }
.hero-lift .sleeve .collar { position: absolute; left: 2px; top: -5px; width: 5px; height: 16px; border-radius: 2px; background: var(--steel); }
.hero-lift .sleeve .plate { position: absolute; left: 8px; top: -20px; width: 11px; height: 46px; border-radius: 3px; border: 1px solid var(--hero-line-accent); background: linear-gradient(90deg, var(--iron-1), var(--iron-2) 45%, var(--iron-1)); }
.hero-lift .sleeve .plate::after { content: ''; position: absolute; inset: 6px 3px; border-radius: 2px; background: var(--accent); opacity: .55; }
.hero-lift svg.fig { position: absolute; left: 0; top: 99px; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.hero-lift .lifter { opacity: 0; transition: opacity .25s linear; }
.hero-lift.lifting .lifter { transition: none; }
.hero-lift .lifter path, .hero-lift .lifter line.torso { fill: none; stroke: var(--text-primary); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(196,214,107,.35)); }
.hero-lift .lifter .head { fill: var(--accent-hover); filter: drop-shadow(0 0 6px rgba(196,214,107,.6)); }
.hero-lift .floorE { stroke: var(--line-strong); stroke-width: 1.5; }

/* ─── Random moves (actors layer over the whole hero) ─────────────────── */

.hero-stage > .hero-actors { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.hero-actor { transition: opacity .2s linear; }
.hero-actor path { fill: none; stroke: var(--text-primary); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(196,214,107,.35)); }
.hero-actor .head { fill: var(--accent-hover); filter: drop-shadow(0 0 6px rgba(196,214,107,.6)); }
.hero-actor-bar { stroke: #C9CDB8; stroke-width: 4; stroke-linecap: round; }
.hero-actor-cable { stroke: var(--line-strong); stroke-width: 1.2; }

@media (min-width: 720px) {
  .hero-stage { padding-inline: 24px; }
  .hero-3d { width: min(100%, 806px); }
  .hero-links { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 8px; left: 0; margin-left: 118px; gap: 18px 22px; }
  .hero-lift { padding-right: 118px; }
  .hero-lift .label { font-size: 20px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stage *, .hero-stage *::before, .hero-stage *::after, .hero-stage { animation: none !important; transition-duration: .01ms !important; }
}
