/* ==========================================================================
   Hero: the opening screen, and the kinetic ribbons that follow it.
   Back to front: aurora glow, dusk artwork, text shade, light rays,
   the root canvas (roots.js), then the text and the clock.
   ========================================================================== */

.hero {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; align-content: center;
  min-height: max(100svh, 700px);
  padding: calc(var(--topbar) + clamp(12px, 3vh, 40px)) var(--gutter) clamp(96px, 15vh, 160px);
}

/* Three huge soft colour glows drifting slowly. Radial gradients are soft already, so no blur filter is needed. */
.hero__aurora { position: absolute; inset: 0; z-index: -5; overflow: hidden; pointer-events: none; }
.hero__aurora i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; opacity: 0.55; }
.hero__aurora i:nth-child(1) { left: -22vmax; top: -28vmax; background: radial-gradient(circle, var(--violet), transparent 66%); }
.hero__aurora i:nth-child(2) { right: -16vmax; top: 4vmax; background: radial-gradient(circle, var(--teal), transparent 66%); opacity: 0.4; }
.hero__aurora i:nth-child(3) { left: 14vw; bottom: -38vmax; background: radial-gradient(circle, var(--pink), transparent 66%); opacity: 0.32; }
html.fx .hero__aurora i { animation: drift 26s ease-in-out infinite alternate; }
html.fx .hero__aurora i:nth-child(2) { animation-duration: 32s; animation-delay: -9s; }
html.fx .hero__aurora i:nth-child(3) { animation-duration: 38s; animation-delay: -17s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(7vw, 5vh, 0) scale(1.18); }
}

/* The dusk picture, faded into the night at its edges. --mx / --my (set by scroll.js) add a gentle pointer parallax. */
.hero__art {
  position: absolute; z-index: -4; top: 0; right: 0; bottom: 0; width: min(70vw, 1080px);
  translate: calc(var(--mx, 0) * -18px) calc(var(--my, 0) * -12px);
  -webkit-mask-image: radial-gradient(92% 104% at 70% 34%, #000 38%, transparent 76%);
  mask-image: radial-gradient(92% 104% at 70% 34%, #000 38%, transparent 76%);
}
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; transform: scale(1.06); }
html.fx .hero__art img { animation: kenburns 44s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.17) translate3d(-2.5%, 1.5%, 0); }
}

/* A shade keeps the headline readable wherever the picture is bright. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background:
    linear-gradient(90deg, var(--ink) 0%, rgb(5 8 22 / 0.88) 26%, rgb(5 8 22 / 0.25) 58%, transparent 80%),
    linear-gradient(0deg, rgb(5 8 22 / 0.9), transparent 30%);
}

/* Sunset light rays: a conic gradient fanned out from the sun, rotating very slowly. */
.hero__rays {
  position: absolute; z-index: -2; pointer-events: none; opacity: 0.8;
  width: 150vmax; height: 150vmax; left: calc(78% - 75vmax); top: calc(30% - 75vmax);
  background: repeating-conic-gradient(from 0deg, rgb(255 190 110 / 0.13) 0deg 3deg, transparent 3deg 14deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 62%);
  mask-image: radial-gradient(closest-side, #000 0%, transparent 62%);
}
html.fx .hero__rays { animation: spin 160s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Text ---------- */
.hero__inner { position: relative; z-index: 2; max-width: 860px; }

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.7em; padding: 9px 18px;
  border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / 0.07);
  color: #dbe6f7; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
}
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
html.fx .live-dot { animation: ping 2.2s ease-out infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgb(200 255 61 / 0.75), 0 0 12px var(--lime); }
  80%, 100% { box-shadow: 0 0 0 12px rgb(200 255 61 / 0), 0 0 12px var(--lime); }
}

.hero__title { margin-top: clamp(10px, 2vh, 24px); line-height: 0.86; }
/* The wordmark. Each letter carries its own copy of the gradient (clipping gradient text through a transformed
   parent is unreliable), and a negative per-letter delay makes the colours roll through the word like a wave. */
.hero__word {
  display: inline-flex; padding-right: 0.06em;
  font-size: clamp(6.2rem, 26vw, 16.5rem); font-weight: 800; letter-spacing: -0.06em;
  filter: drop-shadow(0 0 46px rgb(25 240 200 / 0.3));
}
.hero__word span {
  display: inline-block; padding: 0.02em 0.01em;
  background: linear-gradient(105deg, var(--lime) 0%, var(--teal) 30%, var(--sky) 58%, var(--violet) 80%, var(--lime) 100%) calc(var(--i) * 24%) 50% / 320% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html.fx .hero__word span {
  animation: letter-in 1.3s var(--ease) both, sheen 9s ease-in-out infinite alternate;
  animation-delay: calc(0.2s + var(--i) * 0.11s), calc(var(--i) * -1.6s);
  animation-play-state: paused;
}
html.fx.entered .hero__word span { animation-play-state: running; }
@keyframes letter-in {
  from { opacity: 0; transform: translateY(46%) scale(0.88) rotate(5deg); filter: blur(16px); }
}
@keyframes sheen { to { background-position: 100% 50%; } }

.hero__tag {
  margin-top: clamp(14px, 2.6vh, 30px); max-width: 17ch;
  font-size: clamp(1.7rem, 3.6vw, 3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; text-wrap: balance;
}
.hero__sub { margin-top: 14px; max-width: 46ch; color: var(--muted); font-size: clamp(1.02rem, 1.4vw, 1.25rem); text-wrap: pretty; }
.hero__sub em { color: var(--lime); font-style: normal; font-weight: 700; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(22px, 4vh, 40px); }
.hero__hint { margin-top: 16px; color: var(--muted); font-size: 0.875rem; }

/* Staggered entrance once the gate has opened. */
html.fx :is(.hero__eyebrow, .hero__tag, .hero__sub, .hero__cta, .hero__hint, .clock) {
  animation: rise 1s var(--ease) both; animation-play-state: paused;
}
html.fx.entered :is(.hero__eyebrow, .hero__tag, .hero__sub, .hero__cta, .hero__hint, .clock) { animation-play-state: running; }
html.fx .hero__eyebrow { animation-delay: 0.1s; }
html.fx .hero__tag { animation-delay: 0.75s; }
html.fx .hero__sub { animation-delay: 0.9s; }
html.fx .hero__cta { animation-delay: 1.05s; }
html.fx .hero__hint { animation-delay: 1.3s; }
html.fx .clock { animation-delay: 1.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

/* ---------- The clock: seven seconds to midnight ---------- */
.clock {
  position: absolute; z-index: 2; right: var(--gutter); bottom: clamp(88px, 14vh, 150px);
  width: clamp(104px, 11vw, 156px); text-align: center;
}
.clock svg { width: 100%; height: auto; filter: drop-shadow(0 14px 30px rgb(0 0 0 / 0.65)); }
/* A soft dark halo keeps the clock and its label readable when glowing roots grow behind it. */
.clock::before {
  content: ""; position: absolute; z-index: -1; inset: -24px -34px -30px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(5 8 22 / 0.82) 58%, transparent);
}
.clock__face { fill: rgb(5 8 22 / 0.75); stroke: rgb(255 255 255 / 0.3); stroke-width: 2; }
.clock__tick { stroke: rgb(255 255 255 / 0.4); stroke-width: 1.3; }
.clock__tick--big { stroke: rgb(255 255 255 / 0.92); stroke-width: 2.4; }
.clock__danger { fill: none; stroke: var(--coral); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--coral)); }
/* Static state shows the hand seven ticks before midnight. The animation ticks it once a second to twelve, holds, then repeats. */
.clock__hand { transform-box: view-box; transform-origin: 50% 50%; transform: rotate(-42deg); }
.clock__hand line { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.clock__pin { fill: var(--coral); }
html.fx .clock__hand { animation: tick 8s steps(7, jump-end) infinite; }
@keyframes tick {
  0% { transform: rotate(-42deg); }
  87.5%, 100% { transform: rotate(0deg); }
}
.clock__label { margin-top: 8px; color: #dbe6f7; font-size: 0.82rem; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 2px #050816, 0 0 10px #050816, 0 0 18px #050816; }
.clock__label strong {
  display: block; color: var(--coral); font-size: 2.1rem; letter-spacing: -0.04em; line-height: 1;
  text-shadow: 0 0 22px rgb(255 77 109 / 0.6);
}

/* ---------- Scroll cue ---------- */
.hero__cue { position: absolute; z-index: 2; left: 50%; bottom: 26px; translate: -50% 0; display: grid; place-items: center; width: 44px; height: 60px; }
.cue { position: relative; display: block; width: 26px; height: 44px; border: 2px solid rgb(255 255 255 / 0.65); border-radius: 16px; }
.cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; }
html.fx .cue::after { animation: cue 1.9s var(--ease) infinite; }
@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(18px); }
}

/* ---------- Kinetic ribbons ----------
   Two rows of giant type slide in opposite directions. Each track holds the phrase four times and
   moves by half its own width, so the loop is seamless. scroll.js sets --vel so fast scrolling skews them. */
.ribbon {
  position: relative; z-index: 2; margin: -2vw 0; padding: clamp(30px, 6vw, 80px) 0;
  rotate: -2deg; scale: 1.05; pointer-events: none;
}
.ribbon__row {
  overflow: hidden; border-block: 1px solid var(--line); background: rgb(5 8 22 / 0.6);
  transform: skewX(calc(var(--vel, 0) * -9deg));
}
.ribbon__track {
  display: flex; align-items: center; width: max-content; padding: 0.16em 0;
  font-size: clamp(2.6rem, 8vw, 7.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.04em;
  text-transform: uppercase; white-space: nowrap;
}
html.fx .ribbon__track { animation: marquee 48s linear infinite; }
html.fx .ribbon__row--rev .ribbon__track { animation-direction: reverse; animation-duration: 60s; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
.ribbon__track span { padding: 0 0.1em; background: linear-gradient(100deg, #fff 20%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ribbon__track .is-outline { background: none; color: transparent; -webkit-text-stroke: 2px rgb(255 255 255 / 0.62); }
.ribbon__track i { flex: none; width: 0.3em; height: 0.3em; margin: 0 0.4em; rotate: 45deg; background: var(--lime); box-shadow: 0 0 22px var(--lime); }
.ribbon__row--rev .ribbon__track i { background: var(--pink); box-shadow: 0 0 22px var(--pink); }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  /* The top padding reserves a strip under the top bar for the compact clock, so the text can never run under it. */
  .hero { align-content: end; padding-top: calc(var(--topbar) + 94px); padding-bottom: 130px; }
  .hero__art { width: 100%; opacity: 0.7; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 92%); mask-image: linear-gradient(180deg, #000 30%, transparent 92%); }
  .hero::before { background: linear-gradient(180deg, rgb(5 8 22 / 0.75) 0%, rgb(5 8 22 / 0.35) 32%, rgb(5 8 22 / 0.88) 100%); }
  .hero__word { font-size: clamp(6rem, 34vw, 12rem); }
  .hero__eyebrow { font-size: 0.7rem; letter-spacing: 0.1em; }
  /* The dial sits on the right with its label beside it. */
  .clock { top: calc(var(--topbar) + 10px); right: var(--gutter); bottom: auto; width: auto; display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; text-align: right; }
  .clock svg { flex: none; width: 64px; }
  .clock__label { margin-top: 0; font-size: 0.7rem; }
  .clock__label strong { font-size: 1.5rem; }
  .hero__cue { display: none; }
}
