/* HYPR homepage layout — composes the .h-* components. Tokens only. */

.eyebrow { margin-bottom: var(--s-5); color: var(--text); }
.stack { display: grid; gap: var(--s-5); }
.text-link { color: var(--text); text-decoration: underline; text-underline-offset: .4em; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }
.h-tags { list-style: none; padding: 0; margin: var(--s-3) 0 0; }

.card-grid { display: grid; gap: var(--s-5); margin-top: var(--s-8); }
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* ─── NAV — ink, glass once scrolled ─── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: var(--s-6);
  padding: calc(var(--s-4) + env(safe-area-inset-top, 0px)) var(--gutter) var(--s-4);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled, .menu-open .nav {
  background: rgba(20,26,34,.72);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  border-bottom-color: var(--glass-border);
}
.nav-logo { font-family: var(--font-head); font-size: 1.75rem; letter-spacing: -.03em; line-height: 1; text-decoration: none; margin-right: auto; }
.nav-links { display: flex; gap: var(--s-6); }
.nav-links a { text-decoration: none; color: var(--text-soft); transition: color var(--dur) var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-btn { min-height: 44px; }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; border: 1px solid var(--line); border-radius: var(--r-tag); }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text); transition: transform var(--dur) var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.menu-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ─── MOBILE MENU ─── */
.menu {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s-6);
  padding: 6rem var(--gutter) calc(var(--s-7) + env(safe-area-inset-bottom, 0px));
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.menu.open { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease); }
.menu-links a { display: block; font-family: var(--font-head); font-size: var(--fs-h2); line-height: 1.3; text-decoration: none; }
.menu-links li { border-bottom: 1px solid var(--glass-border); }
.menu .h-btn { align-self: flex-start; }
.menu-foot { display: grid; gap: var(--s-2); color: var(--text-soft); font-size: var(--fs-small); }

/* ─── HERO ─── */
.hero { height: 260svh; overflow: clip; }                       /* tall: the extra height is the flight */
.hero-stage {
  position: sticky; top: 0; height: 100svh;
  display: flex; align-items: flex-end; overflow: hidden; isolation: isolate;
}
.hero-wrap { position: relative; z-index: 2; padding-top: 8rem; padding-bottom: var(--s-8); }
/* No flight without WebGL or with reduced motion: an ordinary full-height hero */
.hero.no-flight { height: auto; }
.hero.no-flight .hero-stage { position: relative; min-height: 100svh; }
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero-stage { position: relative; min-height: 100svh; }
}
/* As the camera flies, the copy lifts away and the orb-moon looms */
.hero.flight-ready .hero-eyebrow, .hero.flight-ready .hero-title, .hero.flight-ready .hero-lead,
.hero.flight-ready .hero-actions, .hero.flight-ready .hero-rule {
  opacity: clamp(0, calc(1 - (var(--flight, 0) - .05) * 3.2), 1);
  translate: 0 calc(var(--flight, 0) * -10svh);
  transition: none;
}
.hero-cue { order: -1; color: var(--text-soft); }
.no-flight .hero-cue { display: none; }
.hero-content { max-width: 54rem; }
.hero-eyebrow { margin-bottom: var(--s-6); }
.hero-title { margin-bottom: var(--s-6); }
.hero-line { display: block; }
/* Underline drawn as a rule: text-decoration can't reach the inline-block word inside */
.hero-title .h-emph-u { position: relative; text-decoration: none; }
.hero-title .h-emph-u::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .1em; height: .05em;
  background: currentColor; transform-origin: left;
}
.js .hero-title .h-emph-u::after { transform: scaleX(0); transition: transform .8s var(--ease) .55s; }
.js .hero-title .h-emph-u:has(.in)::after { transform: none; }
.word-wrap { display: inline-block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; vertical-align: top; }
.word-inner { display: inline-block; }
.hero-lead { margin-bottom: var(--s-6); }
.hero-lead strong { font-weight: 500; color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-6); }
.hero-rule { margin-top: var(--s-8); }

/* Dusk scene (js/dusk.js). The aurora surface stays as the no-WebGL fallback;
   the scene draws its own dark corner behind the copy. */
.dusk { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }

/* Intro states — only hidden when JS will reveal them */
.js .hero-eyebrow, .js .hero-lead, .js .hero-actions, .js .hero-rule {
  opacity: 0; transform: translateY(12px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js .hero-lead { transition-delay: .9s; }
.js .hero-actions { transition-delay: 1.05s; }
.js .hero-rule { transition-delay: 1.2s; }
.js .word-inner { transform: translateY(105%); transition: transform .9s var(--ease); }
.hero-in .hero-eyebrow, .hero-in .hero-lead, .hero-in .hero-actions, .hero-in .hero-rule { opacity: 1; transform: none; }
.js .word-inner.in { transform: none; }

/* ─── ORB ─── */
.orb-wrap {
  position: absolute; z-index: 1; aspect-ratio: 1; pointer-events: none;
  opacity: 0; transition: opacity 1.6s var(--ease);
}
.orb-wrap.on { opacity: 1; }
.orb-wrap canvas { width: 100%; height: 100%; pointer-events: auto; }
.orb-hero {
  /* Where a moon would rise at dusk: high in the eastern sky, well clear of the peaks */
  top: 24%; right: 9vw; width: min(42vh, 30vw);
  transform: translate3d(0, -50%, 0) scale(calc(1 + var(--flight, 0) * .45));
}
.flight-ready .orb-hero.on { opacity: clamp(0, calc((1 - var(--flight, 0)) * 5), 1); transition: none; }
.orb-cta {
  left: 50%; top: 50%; width: min(120vh, 110vw);
  transform: translate3d(-50%, -50%, 0);
}
.orb-cta.on { opacity: .85; }
/* Fallback when WebGL is unavailable */
.orb-wrap.no-gl::before {
  content: ''; position: absolute; inset: 22%; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, var(--hypr-hot), transparent 55%),
    radial-gradient(circle at 60% 70%, var(--hypr-volt), transparent 65%),
    radial-gradient(circle, var(--hypr-violet), var(--hypr-night) 75%);
}
.orb-wrap.no-gl canvas { display: none; }

/* ─── HEADING REVEAL ─── */
.js .reveal .word-wrap { overflow: hidden; }
.js .reveal .word-inner { transform: translateY(105%); }
.js .reveal.shown .word-inner { transform: none; }

/* ─── SERVICES STATEMENT ─── */
.statement { display: flex; align-items: center; gap: var(--s-6); margin: 0; font-weight: 400; }
.statement-rule { flex: 1; height: 1px; background: var(--line); }

/* ─── ABOUT — a manifesto that lights word by word as you scroll ─── */
.about { overflow: clip; }                                       /* clip, not hidden: keeps the stage sticky */
.manifesto-stage { display: flex; flex-direction: column; justify-content: center; }
.about-h { color: var(--text-soft); max-width: 32ch; }
.manifesto {
  font-family: var(--font-head); font-weight: 400; letter-spacing: -.015em;
  font-size: clamp(1.7rem, 1rem + 2.9vw, 3.6rem); line-height: 1.14;
  max-width: 30ch; margin: var(--s-6) 0 var(--s-7);
}
.about-tags { max-width: 40rem; }
.js .manifesto-pin { height: 260svh; }
.js .manifesto-stage { position: sticky; top: 0; min-height: 100svh; padding-block: 6rem var(--s-7); }
.js .manifesto .mw { opacity: .16; transition: opacity .45s var(--ease); }
.js .manifesto .mw.lit { opacity: 1; }
.js .about-tags { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .about.done .about-tags { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .manifesto-pin { height: auto; }
  .js .manifesto-stage { position: static; min-height: 0; }
}

/* ─── SERVICES — numbered index ─── */
.svc-index { list-style: none; margin: var(--s-8) 0 0; padding: 0; border-top: 1px solid var(--glass-border); }
.svc-row { border-bottom: 1px solid var(--glass-border); }
.svc-row__link {
  position: relative; display: grid; align-items: center; gap: var(--s-6);
  grid-template-columns: 3.5rem minmax(0, 1.15fr) minmax(0, 1fr) auto;
  padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem) 0; color: inherit; text-decoration: none;
}
.svc-row__link::before {
  /* A wash of light sweeps in behind the row on hover */
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1;
  background: linear-gradient(90deg, rgba(208,19,183,.16), rgba(53,20,208,.2) 55%, rgba(53,20,208,0));
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.svc-row__n { color: var(--text-dim); transition: color var(--dur) var(--ease); }
.svc-row__t {
  font-family: var(--font-head); font-weight: 400; letter-spacing: -.015em; margin: 0;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 3rem); line-height: 1.05;
  transition: transform .6s var(--ease);
}
.svc-row__b { margin: 0; color: var(--text-soft); font-size: var(--fs-small); max-width: 44ch; }
.svc-row__go .h-x { width: 22px; height: 22px; transition: transform .6s var(--ease); }
.svc-row__link:hover::before, .svc-row__link:focus-visible::before { transform: none; }
.svc-row__link:hover .svc-row__t, .svc-row__link:focus-visible .svc-row__t { transform: translateX(.75rem); }
.svc-row__link:hover .svc-row__n, .svc-row__link:focus-visible .svc-row__n { color: var(--hypr-hot); }
.svc-row__link:hover .h-x, .svc-row__link:focus-visible .h-x { transform: rotate(90deg); }
@media (max-width: 760px) {
  .svc-row__link { grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); }
  .svc-row__go { grid-column: 3; grid-row: 1; }
  .svc-row__b { grid-column: 2 / 4; }
}

/* ─── STATS — one band of big numbers ─── */
.stat-band {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--s-8);
  border-block: 1px solid var(--glass-border);
}
.stat { padding: var(--s-7) var(--s-6); border-left: 1px solid var(--glass-border); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-n {
  font-size: clamp(3.5rem, 1.8rem + 6vw, 8.5rem); line-height: .9; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat-l { color: var(--text-soft); margin-top: var(--s-4); }
@media (max-width: 760px) {
  .stat-band { grid-template-columns: 1fr; }
  .stat { padding: var(--s-6) 0; border-left: 0; border-top: 1px solid var(--glass-border); }
  .stat:first-child { border-top: 0; }
}

/* ─── PROCESS ─── */
.steps { margin-top: var(--s-8); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.steps li { padding-right: var(--s-6); }
.steps .h-h3 { margin-top: var(--s-6); }
.steps p { margin-top: var(--s-3); max-width: 30ch; }
.steps::after {
  /* Progress line that draws across as the section scrolls through */
  content: ''; position: absolute; left: 0; right: 0; top: 1.95rem; height: 1px;
  background: var(--line-solid); transform-origin: left; transform: scaleX(var(--p, 1));
}
.js .steps { --p: 0; }
.js .steps li::after { opacity: .35; transition: opacity var(--dur) var(--ease); }
.js .steps li.lit::after { opacity: 1; }

/* ─── CASES — panels that stack over one another as you scroll ─── */
#work { overflow: clip; }                                        /* clip, not hidden: keeps the panels sticky */
.case-stack { display: grid; gap: var(--s-6); margin-top: var(--s-8); }
.case {
  position: relative; display: grid; gap: var(--s-4) var(--s-8); align-content: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  padding: clamp(1.5rem, 1rem + 2.2vw, 3.25rem);
  border: 1px solid var(--glass-border); border-radius: var(--r-card);
  background: linear-gradient(140deg, #1E1F55 0%, #171C33 55%, #141A22 100%);
  box-shadow: 0 -24px 60px rgba(8,10,20,.45);
}
.case::before {                                                  /* a short hot rule marks each panel */
  content: ""; position: absolute; top: -1px; left: clamp(1.5rem, 1rem + 2.2vw, 3.25rem);
  width: 3.5rem; height: 2px; background: var(--hypr-hot);
}
.case > :not(.case-metrics) { grid-column: 1; }
.case-client span { color: var(--text-soft); }
.case-client .case-n { color: var(--hypr-hot); margin-right: .75em; }
.case-h { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.75rem); line-height: 1.1; max-width: 22ch; }
.case-b { margin: 0; }
.case-metrics {
  grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0;
  display: grid; gap: 0;
}
.case-metrics div {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) 0; border-top: 1px solid var(--glass-border);
}
.case-metrics dd { margin: 0; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 3rem); order: 2; }
.case-metrics dt { color: var(--text-soft); font-size: .6875rem; }
@media (min-width: 900px) {
  .case { position: sticky; top: calc(6.5rem + var(--i) * 1.25rem); min-height: 24rem; }
}
@media (max-width: 899px) {
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-metrics { grid-column: 1; grid-row: auto; }
}

/* ─── CXO ─── */
.cxo-list { margin-top: var(--s-5); }
.cxo-card { display: grid; gap: var(--s-3); align-content: start; }
.cxo-card .h-body { font-size: var(--fs-small); }

/* ─── CTA ─── */
.cta { text-align: center; }
.cta-wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: var(--s-5); }
.cta-mark { font-family: var(--font-head); font-size: clamp(4rem, 3rem + 6vw, 9rem); letter-spacing: -.04em; line-height: 1; }
.cta-sub { margin-bottom: var(--s-3); }
.cta-email { color: var(--text-soft); }
.cta-email a { color: var(--text); text-underline-offset: .3em; }
.cta-x { margin-top: var(--s-5); }

/* ─── NIGHT SURFACES ───
   Every section between the hero and the CTA shares one ink ground, so the page
   reads as one continuous night. Each section adds its own soft glows (positions
   set inline: --gx/--gy magenta, --hx/--hy indigo), masked to nothing at the top
   and bottom edges so no seam ever shows between sections. */
.h-surface--night { background: var(--hypr-ink); }
.h-surface--night::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(55% 45% at var(--gx, 80%) var(--gy, 20%), rgba(208,19,183,.22), rgba(208,19,183,0) 70%),
    radial-gradient(60% 55% at var(--hx, 15%) var(--hy, 80%), rgba(42,23,196,.38), rgba(42,23,196,0) 72%),
    radial-gradient(80% 60% at 50% 50%, rgba(27,35,95,.55), rgba(27,35,95,0) 75%);
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
/* The ember CTA rises out of the night and sinks back into the footer */
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--hypr-ink), rgba(20,26,34,0) 28%, rgba(20,26,34,0) 72%, var(--hypr-ink));
}

/* ─── FOOTER ─── */
.footer-wrap { padding-bottom: var(--s-6); }
.f-info { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); color: var(--text-soft); font-size: var(--fs-small); }
.f-col { display: grid; gap: var(--s-2); align-content: start; }
.f-col .h-label { color: var(--text); }
.f-col a { color: var(--text); text-underline-offset: .3em; }

/* ─── CONTACT MODAL ─── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: var(--gutter);
  background: rgba(20,26,34,.7);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.modal.open { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease); }
.modal-panel {
  width: 100%; max-width: 38rem; max-height: calc(100svh - 2 * var(--gutter)); overflow-y: auto;
  border: 1px solid var(--glass-border); border-radius: var(--r-card);
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
}
.modal-close { position: absolute; top: var(--s-5); right: var(--s-5); color: var(--text-soft); }
.modal-close:hover { color: var(--text); }
.modal-h { margin-bottom: var(--s-6); }
.form { display: grid; gap: var(--s-5); }
.form-row { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.field { display: grid; gap: var(--s-2); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-tag);
  padding: .8rem 1rem; transition: border-color var(--dur) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--line-solid); }
.field textarea { resize: vertical; min-height: 8rem; }
.form-submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); margin-top: var(--s-3); }
.form-status { font-size: var(--fs-small); color: var(--text); }
.form-thanks { display: grid; gap: var(--s-5); }
.form-thanks h3:focus { outline: none; }

/* Service index rows → service pages: a clear focus ring on the whole row */
.svc-row__link:focus-visible { outline: 2px solid var(--line-solid); outline-offset: 4px; }

/* ─── SERVICE PAGE — arch + panel ─── */
.svc-hero .h-wrap { padding-top: 8rem; }
.svc-grid { display: grid; grid-template-columns: 45fr 55fr; gap: var(--s-8); align-items: center; }
.svc-arch { position: relative; background: var(--bg-aurora); }
.svc-arch img { width: 100%; height: 100%; object-fit: cover; }
.orb-arch { left: 50%; top: 50%; width: 125%; transform: translate3d(-50%, -50%, 0); }
.svc-panel { display: grid; gap: var(--s-5); align-content: center; }
.svc-panel .eyebrow { margin-bottom: 0; }
.crumbs { display: flex; gap: var(--s-3); color: var(--text-soft); }
.crumbs a { color: var(--text); text-underline-offset: .4em; }
.svc-card { display: grid; gap: var(--s-4); }
.svc-cap-h { margin-top: var(--s-3); }
.svc-others { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); max-width: none; }
.svc-others .h-tag { width: 100%; min-height: 44px; text-align: center; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.svc-others .h-tag:hover { background: var(--line-solid); color: var(--hypr-electric); }

/* ─── BELOW 900px — everything stacks ─── */
@media (max-width: 900px) {
  .nav-links, .nav-btn { display: none; }
  .nav-toggle { display: block; }
  .hero { align-items: flex-end; }
  .hero-wrap { padding-top: 55vw; }
  .orb-hero { top: 3.5rem; right: -6vw; width: 68vw; transform: scale(calc(1 + var(--flight, 0) * .45)); }
  .hero { height: 210svh; }
  .statement { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .statement-rule { width: 100%; flex: none; }
  .steps { grid-template-columns: 1fr; }
  .steps::after { left: .33rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; transform-origin: top; transform: scaleY(var(--p, 1)); }
  .steps .h-h3 { margin-top: var(--s-2); }
  .svc-hero .h-wrap { padding-top: 6rem; }
  .svc-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  /* Arch goes above the copy at 4:3, radius capped by --r-arch */
  .svc-arch { aspect-ratio: 4 / 3; }
}
