/* ═══════════════════════════════════════════════════════════
   HEMLOCK — shared stylesheet
   Pages: index.html (home) · applications.html · contact.html
   ═══════════════════════════════════════════════════════════ */

:root {
  --font-body: 'Archivo', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --dark: #000000;
  --dark-elevated: #0a0a0c;
  --light: #ffffff;
  --text-dark: #f5f5f7;
  --text-dark-muted: #86868b;
  --text-light: #1d1d1f;
  --text-light-muted: #6e6e73;
  --accent: #0a84ff;
  --accent-rgb: 10, 132, 255;
  --glass-dark: rgba(10, 10, 14, 0.84);
  --glass-dark-border: rgba(255,255,255,0.09);
  --pad: clamp(52px, 10vw, 130px);
  --on-bright: #0a0a0c;
  --on-bright-muted: rgba(10,10,12,.68);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(var(--accent-rgb), 0.22); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.13); border-radius: 3px; }

/* ── Starscape ── */
#starscape {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none; opacity: 0.48;
}

/* ── Scroll progress ── */
#sp {
  position: fixed; top: 0; left: 0;
  height: 1px; width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb),.45));
  z-index: 10000; transition: width .07s linear;
}

/* ── Loader ── */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--dark);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .7s ease;
}
#loader.out { opacity: 0; pointer-events: none; }
.ldr-wrap { text-align: center; }
.ldr-brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1rem;
  letter-spacing: .38em; text-transform: uppercase;
  color: var(--text-dark); margin-bottom: 2rem; opacity: .88;
}
.ldr-track {
  width: 160px; height: 1px;
  background: rgba(255,255,255,.1);
  margin: 0 auto; overflow: hidden; border-radius: 1px;
}
.ldr-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb),.5));
  transition: width .2s ease; border-radius: 1px;
}
.ldr-pct {
  font-family: var(--font-mono);
  font-size: .6rem; letter-spacing: .1em;
  color: var(--text-dark-muted); margin-top: .65rem;
}

/* ── Navbar ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; padding: 14px 24px;
  transition: all .45s cubic-bezier(.4,0,.2,1);
}
.nav-in {
  max-width: 100%; margin: 0 auto;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px;
  transition: all .45s cubic-bezier(.4,0,.2,1);
}
#nav.scrolled .nav-in {
  max-width: 860px;
  background: var(--glass-dark);
  border: .5px solid var(--glass-dark-border);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 2px 48px rgba(0,0,0,.45), inset 0 .5px 0 rgba(255,255,255,.06);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--on-bright);
  transition: color .35s ease;
}
#nav.scrolled .nav-logo,
body[data-theme="dark"] .nav-logo {
  color: var(--text-dark);
}
.nav-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background: currentColor;
  opacity: 0.92;
  -webkit-mask-image: url('newLogo.png');
  mask-image: url('newLogo.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}
.nav-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: .88rem; letter-spacing: .1em; text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  color: var(--on-bright-muted);
  text-decoration: none;
  font-size: .8rem; font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase;
  transition: color .2s ease;
}
body[data-theme="dark"] .nav-links a:not(.nav-cta) {
  color: rgba(245,245,247,.55);
}
#nav.scrolled .nav-links a:not(.nav-cta) {
  color: rgba(245,245,247,.55);
}
.nav-links a:hover { color: var(--on-bright); }
body[data-theme="dark"] .nav-links a:hover:not(.nav-cta),
#nav.scrolled .nav-links a:hover:not(.nav-cta) { color: var(--text-dark); }
.nav-links a.active:not(.nav-cta) { color: var(--accent) !important; }
.nav-cta {
  padding: 7px 16px; border-radius: 999px;
  background: rgba(var(--accent-rgb),.13);
  border: .5px solid rgba(var(--accent-rgb),.38);
  color: var(--accent) !important; font-weight: 500 !important;
  text-transform: none !important; letter-spacing: .01em !important;
}
.nav-cta:hover { background: rgba(var(--accent-rgb),.22) !important; }

/* Mobile: burger + glass menu sheet */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  border: none; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block; width: 16px; height: 1.5px; border-radius: 1px;
  background: currentColor;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}
.nav-burger { color: var(--on-bright); }
#nav.scrolled .nav-burger,
body[data-theme="dark"] .nav-burger { color: var(--text-dark); }
#nav.menu-open .nav-burger span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
#nav.menu-open .nav-burger span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }
.nav-right { display: none; align-items: center; gap: 10px; }
.nav-cta-mobile { display: none; }
@media (max-width: 767px) { .nav-right { display: flex; } }

#nav-menu {
  display: none;
  position: fixed;
  left: 14px; right: 14px;
  top: calc(14px + 56px + 8px);
  z-index: 999;
  background: var(--glass-dark);
  border: .5px solid var(--glass-dark-border);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 12px 56px rgba(0,0,0,.5), inset 0 .5px 0 rgba(255,255,255,.06);
  opacity: 0; transform: translateY(-8px) scale(.985);
  pointer-events: none;
  transition: opacity .32s cubic-bezier(.4,0,.2,1), transform .32s cubic-bezier(.4,0,.2,1);
}
#nav-menu.open { opacity: 1; transform: none; pointer-events: all; }
#nav-menu a {
  display: block;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(245,245,247,.82);
  font-size: .92rem; font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: .04em;
  transition: background .2s ease, color .2s ease;
}
#nav-menu a:active { background: rgba(255,255,255,.06); }
#nav-menu a.active { color: var(--accent); }
#nav-menu a.menu-cta {
  margin-top: 6px;
  text-align: center;
  background: rgba(var(--accent-rgb),.14);
  border: .5px solid rgba(var(--accent-rgb),.38);
  color: var(--accent);
}

@media (max-width: 767px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  #nav-menu { display: block; }
  .nav-cta-mobile {
    display: flex; align-items: center;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(var(--accent-rgb), .13);
    border: .5px solid rgba(var(--accent-rgb), .38);
    color: var(--accent);
    font-family: var(--font-display); font-weight: 500;
    font-size: .78rem; letter-spacing: .01em;
    text-decoration: none; white-space: nowrap;
    transition: background .2s;
  }
  .nav-cta-mobile:active { background: rgba(var(--accent-rgb), .24); }
  #nav.scrolled .nav-cta-mobile { color: var(--accent); }
}

/* ── Scroll sections (white bg for video) ── */
.scroll-sec { position: relative; background: #fff; }
/* .v1 / .v2v3 are POSITIONAL: section 1 (band + card tail) and section 2 (arm).
   Section 2's height gives the 145-frame arm a 250vh scrub, plus a pre-roll
   during which it is pinned but not yet scrubbing. --v2-pull lifts it over
   the end of section 1 so it can pin behind the card tail; --v2-fade
   crossfades it in there. Both are measured in site.js. */
.scroll-sec.v1 { height: auto; }
.scroll-sec.v2v3 {
  height: calc(350vh + var(--v2-preroll, 0px));
  margin-top: calc(-1 * var(--v2-pull, 0px));
  opacity: var(--v2-fade, 1);
}
.sticky-wrap {
  position: sticky; top: 0;
  height: 100vh; width: 100%; overflow: hidden;
  background: #fff;
}
.frame-cv {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; display: block;
}
#cv1 {
  transform: scale(1);
  transform-origin: center center;
  transition: filter 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
#cv1.interstitial-bg-blur,
body.snap-card-locked #cv1 {
  filter: blur(42px);
  transform: scale(1.08);
}
#cv2v3 {
  transform: scale(1);
  transform-origin: center center;
  transition: filter 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Held out of focus while the arm is parked behind the card tail, and
   again for any card the reader scrolls back up into. */
#cv2v3.pre-scrub-blur,
body.snap-card-locked #cv2v3 {
  filter: blur(42px);
  transform: scale(1.08);
}

/* ── Hero overlay ── */
#hero-ov-v2 { display: none; }
#hero-ov {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  text-align: center;
  padding: var(--hero-pad-top, clamp(56px, 11vh, 112px)) 32px var(--hero-pad-bottom, 0px);
  pointer-events: none;
  transition: opacity .55s ease, transform .55s ease;
}
#hero-ov.gone { opacity: 0; transform: translateY(-14px); }
.hov-h1 {
  font-family: var(--font-display);
  /* Sized to hold "Muscle Memory For Machines" on a single line inside the
     hero's 32px side padding; the two halves only break apart on mobile. */
  font-size: clamp(2.4rem, 6.7vw, 6.6rem);
  font-weight: 700; line-height: 1.0;
  letter-spacing: -.055em; color: var(--on-bright);
  margin: 0 0 0.75rem;
  text-shadow: 0 2px 6px rgba(255,255,255,.7), 0 0 32px rgba(255,255,255,.4);
}
.hov-h1-part { display: inline; }
@media (max-width: 520px) {
  .hov-h1 { font-size: clamp(1.9rem, 12vw, 3.6rem); }
}
.hero-lower {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hero-lower-gap, 10px);
  width: 100%;
  max-width: 100%;
  padding-bottom: var(--hero-lower-pad-bottom, var(--scroll-hint-bottom, 12px));
  pointer-events: none;
  transform: translateY(clamp(8px, 1.5vh, 16px));
}
.hov-sub {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  color: rgba(10,10,12,.84); font-weight: 700;
  line-height: 1.5;
  margin: 0;
  transform: translateY(clamp(6px, 1.2vh, 14px));
  /* Wide enough to contain the nowrap line below: an overflowing line box
     spills to the right only, which knocked the subtitle off centre. */
  max-width: min(1000px, calc(100vw - 40px));
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35em;
  text-shadow: 0 2px 6px rgba(255,255,255,.7), 0 0 32px rgba(255,255,255,.4);
}
.hov-sub-line {
  display: block;
  text-align: center;
  max-width: 100%;
}
@media (min-width: 720px) {
  .hov-sub-line { white-space: nowrap; }
}
.scroll-hint {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--on-bright-muted); font-size: .64rem;
  letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  animation: hb 2.2s ease-in-out infinite;
  pointer-events: all;
}
.sh-line { width: 1px; height: 28px; background: linear-gradient(to bottom, rgba(10,10,12,.45), transparent); }
@keyframes hb {
  0%,100% { opacity:.45; transform: translateY(0); }
  50% { opacity:.75; transform: translateY(4px); }
}

/* ── Annotation cards ── */
.ann-card {
  position: absolute;
  bottom: var(--ann-corner-bottom, 9vh);
  left: var(--ann-corner-inset-x, 5vw);
  top: auto;
  max-width: 390px;
  overflow-x: hidden;
  z-index: 20; pointer-events: none;
  background: rgba(255,255,255,.93);
  border: .5px solid rgba(0,0,0,.07);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border-radius: 20px; padding: 26px 30px;
  box-shadow: 0 14px 56px rgba(0,0,0,.13), 0 1px 2px rgba(0,0,0,.06);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .42s cubic-bezier(.4,0,.2,1), transform .42s cubic-bezier(.4,0,.2,1);
}
.ann-card.right { left: auto; right: var(--ann-corner-inset-x, 5vw); }
.ann-card.vis { opacity: 1; transform: translateY(0); }
.ac-num {
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--on-bright-muted); letter-spacing: .12em; margin-bottom: 9px;
}
.ac-title {
  font-family: var(--font-display); font-size: 1.48rem; font-weight: 600;
  color: var(--on-bright); margin-bottom: 8px; line-height: 1.25;
}
.ac-desc { font-size: .92rem; color: var(--on-bright-muted); line-height: 1.62; }
.ac-kick {
  display: block;
  margin-top: .8em;
  font-family: var(--font-display);
  font-size: 1.14em;
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -.015em;
  color: var(--accent);
}
.ac-stat {
  margin-top: 16px; padding-top: 16px;
  border-top: .5px solid rgba(0,0,0,.07);
}
.ac-val {
  font-family: var(--font-display); font-size: 1.82rem; font-weight: 700;
  color: var(--accent); display: block; line-height: 1; margin-bottom: 4px;
}
.ac-lbl { font-size: .74rem; color: var(--on-bright-muted); letter-spacing: .06em; }
@media (max-width: 767px) {
  .ann-card {
    left: 14px;
    right: 14px;
    bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    padding: 20px 22px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,.14), 0 1px 0 rgba(255,255,255,.7) inset;
  }
  .ann-card.right { left: 14px; right: 14px; }
  .ac-num { margin-bottom: 5px; font-size: .64rem; }
  .ac-title { font-size: 1.18rem; margin-bottom: 6px; }
  .ac-desc { display: block; font-size: .96rem; line-height: 1.58; }
  .ac-stat { display: block; margin-top: 12px; padding-top: 12px; }
  .ac-val { font-size: 1.5rem; }
  .ac-lbl { font-size: .72rem; }
}

/* ── Scroll room for the section-1 (band) scrub only, minus 1× sticky, so the
      card tail starts as p → 1. Paired with SEC1_SCRUB_VH in site.js. ── */
.v1-scrub-spacer {
  height: calc(520vh - 100vh);
  pointer-events: none;
}

/* ── Tail after scrub: story card over held last frame ──
   --tail-fade hands the last card off once the arm scrub takes over. */
.v1-tail {
  position: relative;
  z-index: 5;
  opacity: var(--tail-fade, 1);
}
/* The panel is a white plate on a white backdrop, so it reads as gone once
   --tail-fade dips under ~.5, while the near-black copy is still legible at
   a fraction of that. --tail-content pulls the contents down the steeper
   curve they need to leave the screen with the plate rather than after it. */
.v1-tail .mega-viz,
.v1-tail .mega-text {
  opacity: var(--tail-content, 1);
}

/* ── V2V3 top feather ── */
.v2v3-top-feather {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: clamp(140px, 28vh, 300px);
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #ffffff                0%,
    rgba(255,255,255,0.82) 26%,
    rgba(255,255,255,0.50) 54%,
    rgba(255,255,255,0.18) 78%,
    rgba(255,255,255,0)    100%
  );
}

/* ── White gap ── */
.white-gap {
  background: transparent;
  height: var(--white-gap-height, 8vh);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.gap-rule { width: 32px; height: .5px; background: rgba(0,0,0,.16); }

/* ── Interstitial: glass card panels ── */
.interstitial {
  background: transparent;
  position: relative;
  z-index: 1;
}
#features, #specs, #beta, #contact-forms, #story-panel, #sc-panel-0 {
  scroll-margin-top: clamp(72px, 14vh, 120px);
}
.interstitial-panel {
  min-height: var(--interstitial-min-height, 115vh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(48px, 7vh, 88px) clamp(16px, 4vw, 36px);
  box-sizing: border-box;
}
.mega-card-wrap {
  width: min(1360px, 96vw);
  min-height: var(--mega-min-height, min(82vh, 880px));
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.interstitial-panel.is-revealed .mega-card-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mega-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,3fr);
  align-items: stretch;
  width: 100%;
  min-height: inherit;
  isolation: isolate;
  transform: translateZ(0);
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(40px) saturate(165%);
  -webkit-backdrop-filter: blur(40px) saturate(165%);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(0,0,0,.12),
    0 1px 0 rgba(255,255,255,.2) inset;
}
.interstitial .mega-card {
  box-shadow:
    0 0 36px rgba(0, 0, 0, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}
.mega-card--viz-first {
  grid-template-columns: minmax(0,3fr) minmax(0,1fr);
}
.mega-text {
  padding: clamp(1.25rem, 3vw, 2.1rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-right: none;
  border-left: none;
}
/* Feather text↔viz seam */
.mega-card:not(.mega-card--viz-first) .mega-text::after {
  content: '';
  position: absolute;
  top: 7%;
  bottom: 7%;
  right: 0;
  width: clamp(40px, 6vw, 72px);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 42%,
    rgba(255, 255, 255, 0.11) 78%,
    rgba(255, 255, 255, 0.14) 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 1) 100%
  );
}
.mega-card--viz-first .mega-text::before {
  content: '';
  position: absolute;
  top: 7%;
  bottom: 7%;
  left: 0;
  width: clamp(40px, 6vw, 72px);
  pointer-events: none;
  background: linear-gradient(
    270deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 42%,
    rgba(255, 255, 255, 0.11) 78%,
    rgba(255, 255, 255, 0.14) 100%
  );
  -webkit-mask-image: linear-gradient(
    270deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: linear-gradient(
    270deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 1) 100%
  );
}
.mega-eyebrow {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.1vw, 1.85rem);
  letter-spacing: .025em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 1px 3px rgba(255,255,255,.5), 0 0 18px rgba(255,255,255,.25);
}
.mega-placeholder {
  margin: 0;
  font-size: clamp(1.0rem, 1.45vw, 1.2rem);
  line-height: 1.75;
  color: var(--on-bright);
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(255,255,255,.45), 0 0 20px rgba(255,255,255,.3);
}
.mega-kick {
  display: block;
  margin-top: .95em;
  font-family: var(--font-display);
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.02em;
  color: var(--on-bright);
}
.mega-viz {
  position: relative;
  min-height: var(--mega-viz-min-h, 62vh);
  align-self: stretch;
  background: linear-gradient(165deg, rgba(0,0,0,.02), rgba(var(--accent-rgb),.04));
  overflow: hidden;
}
.mega-card > .mega-viz            { border-radius: 0 22px 22px 0; }
.mega-card--viz-first > .mega-viz { border-radius: 22px 0 0 22px; }
@media (max-width: 767px) {
  .mega-card > .mega-viz,
  .mega-card--viz-first > .mega-viz { border-radius: 22px 22px 0 0; }
}
.mega-viz--scrollcv {
  background: transparent;
  overflow: hidden;
}
.mega-viz--scrollcv canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-width: 767px) {
  .mega-card, .mega-card--viz-first {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(220px, var(--mega-viz-min-h, 46vh));
  }
  .mega-viz { order: -1; }
  .mega-card:not(.mega-card--viz-first) .mega-text::after {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    height: clamp(36px, 10vw, 56px);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.06) 45%,
      rgba(255, 255, 255, 0) 100%
    );
    -webkit-mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.4) 60%,
      rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.4) 60%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  .mega-card--viz-first .mega-text::before {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: clamp(36px, 10vw, 56px);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(255, 255, 255, 0.12) 100%
    );
    -webkit-mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 55%,
      rgba(0, 0, 0, 0.95) 100%
    );
    mask-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.45) 55%,
      rgba(0, 0, 0, 0.95) 100%
    );
  }
}

/* ── Story card: one long card with changing text stages ── */
.story-stages {
  position: relative;
  display: grid;
  min-height: clamp(240px, 34vh, 360px);
}
.story-stage {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s cubic-bezier(.4,0,.2,1), transform .5s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.story-stage.active {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 767px) {
  .story-stages { min-height: clamp(240px, 62vw, 330px); }
}

/* ── Alternative Applications: light-gray ambient backdrop ──
   Keeps the site's light palette while giving the white glass
   cards a distinct plane to float above. */
.apps-wrap {
  position: relative;
  background: linear-gradient(180deg, #f2f3f6 0%, #e8eaef 100%);
  z-index: 1;
  overflow: hidden;
}
.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.ambient::before,
.ambient::after {
  content: '';
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .6;
  will-change: transform;
}
.ambient::before {
  top: -14vmax; left: -12vmax;
  background: radial-gradient(circle at 40% 40%, rgba(var(--accent-rgb),.12), rgba(var(--accent-rgb),0) 62%);
  animation: ambDriftA 26s ease-in-out infinite alternate;
}
.ambient::after {
  bottom: -18vmax; right: -14vmax;
  background: radial-gradient(circle at 60% 60%, rgba(96,120,255,.09), rgba(96,120,255,0) 62%);
  animation: ambDriftB 32s ease-in-out infinite alternate;
}
@keyframes ambDriftA {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, 12vmax) scale(1.12); }
}
@keyframes ambDriftB {
  from { transform: translate(0, 0) scale(1.08); }
  to   { transform: translate(-8vmax, -10vmax) scale(1); }
}
.apps-wrap .interstitial,
.apps-wrap .interstitial-panel { position: relative; z-index: 1; }

/* White glass card floating above the gray plane */
body[data-page="apps"] .mega-card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow:
    0 28px 70px rgba(17,24,39,.16),
    0 6px 18px rgba(17,24,39,.07),
    0 1px 0 rgba(255,255,255,.85) inset;
}
body[data-page="apps"] .mega-eyebrow,
body[data-page="apps"] .mega-placeholder { text-shadow: none; }

/* First panel: exactly one viewport tall so the card sits centered
   (and locked) the moment the page loads — no pre-scroll needed. */
body[data-page="apps"] #sc-panel-0 {
  min-height: 100vh;
}
@supports (height: 100dvh) {
  body[data-page="apps"] #sc-panel-0 { min-height: 100dvh; }
}
/* Its card skips the scroll-reveal animation — the loader fade is the
   entrance. Also guarantees the lock centers on the true, settled rect. */
body[data-page="apps"] #sc-panel-0 .mega-card-wrap {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Gray→black bridge into the beta section */
body[data-page="apps"] .bridge-wd {
  background: linear-gradient(to bottom, #e8eaef, #000000);
}

/* ── Dark→white gradient bridge ── */
.bridge-wd {
  height: clamp(40px, 6vh, 80px);
  background: linear-gradient(to bottom, #ffffff, #000000);
  position: relative; z-index: 1;
}

/* ── Dark content sections ── */
.dark-wrap { background: #000; position: relative; z-index: 1; }
.dark-wrap::before { content:''; display:block; height:1px; background:rgba(255,255,255,.06); }

.eyebrow {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: .9rem;
}
.sec-h {
  font-family: var(--font-display);
  font-size: clamp(2rem,4vw,3rem); font-weight: 700;
  line-height: 1.07; letter-spacing: -.035em;
  color: var(--text-dark); margin-bottom: 1.1rem;
}
.sec-p {
  font-size: clamp(.9rem,1.25vw,1.05rem);
  color: var(--text-dark-muted); line-height: 1.7;
  font-weight: 300; max-width: 520px;
}

/* ── Features ── */
#features {
  padding: var(--pad) clamp(24px,5vw,80px);
  max-width: 1140px; margin: 0 auto;
}
.feat-hdr { margin-bottom: clamp(32px, 5vh, 56px); }
.feat-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 22px; overflow: hidden;
  gap: 1px; background: rgba(255,255,255,.06);
}
.feat-card {
  padding: clamp(22px, 3.5vh, 38px) clamp(20px, 2.8vw, 34px);
  background: var(--dark); transition: background .3s;
  position: relative; overflow: hidden;
}
.feat-card:hover { background: rgba(255,255,255,.035); }
.feat-card::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(circle at 25% 25%, rgba(var(--accent-rgb),.06), transparent 55%);
  opacity: 0; transition: opacity .4s;
}
.feat-card:hover::after { opacity: 1; }
.feat-ico { width: clamp(28px, 3vw, 36px); height: clamp(28px, 3vw, 36px); color: var(--accent); margin-bottom: clamp(12px, 1.8vh, 18px); }
.feat-ico svg { width: 100%; height: 100%; }
.feat-name {
  font-family: var(--font-display); font-size: .95rem; font-weight: 600;
  color: var(--text-dark); margin-bottom: 7px;
}
.feat-desc { font-size: .81rem; color: var(--text-dark-muted); line-height: 1.6; font-weight: 300; }
.feat-kick {
  display: block;
  margin-top: .6em;
  font-family: var(--font-display);
  font-size: 1.06em;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--text-dark);
}
@media (max-width:1024px) { .feat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width:580px) { .feat-grid { grid-template-columns: 1fr; } }

/* ── Specs ── */
#specs {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: var(--pad) clamp(24px,5vw,80px) clamp(28px, 3.5vw, 44px);
}
.specs-in { max-width: 960px; margin: 0 auto; }
.specs-hdr { margin-bottom: clamp(36px, 5.5vh, 60px); }
.specs-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(20px, 3.5vw, 40px);
}
.spec-item { text-align: center; }
.spec-num {
  font-family: var(--font-display);
  font-size: clamp(2.6rem,5vw,3.6rem); font-weight: 700;
  color: var(--text-dark); display: block; line-height: 1;
  margin-bottom: 10px; letter-spacing: -.03em;
}
.spec-num.counting { color: var(--accent); }
.spec-lbl {
  font-size: .75rem; color: var(--text-dark-muted);
  letter-spacing: .09em; text-transform: uppercase;
}
.spec-lbl-stack {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.3em;
}
.spec-lbl-soon {
  font-size: .68rem; color: var(--text-dark-muted);
  letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.35; opacity: 0.88;
}
@media (max-width:767px) { .specs-grid { grid-template-columns: repeat(2,1fr); gap: 28px; } }

/* Beta status line — replaces the old spec counters, same reveal */
.beta-live {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-align: center;
  color: var(--text-dark);
}

/* ── Forms (beta + contact) ── */
.form-sec {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: var(--pad) clamp(24px,5vw,80px);
}
#specs + .form-sec {
  border-top: none;
  padding-top: 0;
}
.form-in { max-width: 620px; margin: 0 auto; }
.form-hdr { margin-bottom: clamp(28px, 4.5vh, 44px); }
.c-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.c-field { display: flex; flex-direction: column; gap: 5px; }
.c-field.full { grid-column: 1 / -1; }
.c-field label {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dark-muted); font-weight: 500;
}
.c-field input, .c-field textarea, .c-field select {
  background: rgba(255,255,255,.05);
  border: .5px solid rgba(255,255,255,.09);
  border-radius: 11px; padding: 11px 15px;
  color: var(--text-dark); font-family: var(--font-body);
  font-size: max(1rem, .88rem); font-weight: 300; outline: none;
  transition: border-color .2s, background .2s;
}
.c-field input:focus, .c-field textarea:focus, .c-field select:focus {
  border-color: rgba(var(--accent-rgb),.38);
  background: rgba(255,255,255,.07);
}
.c-field textarea { resize: none; }
.c-field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 36px;
}
.c-field select:invalid { color: var(--text-dark-muted); }
.c-field select option { background: var(--dark-elevated); color: var(--text-dark); }
.c-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; margin-top: 6px; }
.btn-sub {
  padding: 11px 30px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 500; font-size: .85rem;
  border: none; cursor: pointer;
  box-shadow: 0 1px 18px rgba(var(--accent-rgb),.28);
  transition: all .28s ease;
}
.btn-sub:hover { box-shadow: 0 4px 28px rgba(var(--accent-rgb),.44); transform: translateY(-1px) !important; }
.honeypot { display: none; }
@media (max-width:560px) { .c-form { grid-template-columns: 1fr; } }

/* ── Contact page ── */
.page-hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: calc(clamp(80px, 16vh, 150px)) 24px clamp(36px, 6vh, 64px);
  max-width: 720px; margin: 0 auto;
}
.page-hero .sec-p { margin: 0 auto; }
.contact-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.5vw, 26px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px) var(--pad);
  align-items: start;
}
@media (max-width: 920px) {
  .contact-grid { grid-template-columns: 1fr; max-width: 640px; }
}
.glass-form-card {
  background: rgba(14, 14, 18, 0.55);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: clamp(26px, 3.5vw, 40px);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 18px 64px rgba(0,0,0,.4), inset 0 .5px 0 rgba(255,255,255,.06);
}
.glass-form-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.glass-form-card .card-sub {
  font-size: .84rem; color: var(--text-dark-muted);
  font-weight: 300; line-height: 1.6;
  margin-bottom: 22px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 44px clamp(24px,5vw,80px) 36px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
  position: relative; z-index: 1;
  background: #000;
}
.ft-brand {
  font-family: var(--font-display); font-weight: 600;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
}
.ft-copy { font-size: .72rem; color: var(--text-dark-muted); }
.ft-links { display: flex; gap: 20px; }
.ft-links a {
  font-size: .72rem; color: var(--text-dark-muted);
  text-decoration: none; transition: color .2s ease;
}
.ft-links a:hover { color: var(--text-dark); }

/* ═══════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS  ≤ 767 px
   ═══════════════════════════════════════════════════════ */

@supports (height: 100dvh) {
  .sticky-wrap { height: 100dvh; }
}

@media (max-width: 767px) {

  /* ── Hero ── */
  /* Sized so "Muscle Memory" holds one line: the title breaks into exactly
     two, short enough to clear the band in the hero and the arm in section 2. */
  .hov-h1 {
    font-size: clamp(1.9rem, 12vw, 3.6rem);
    letter-spacing: -.058em;
  }
  .hov-h1-part { display: block; }
  .hov-sub {
    font-size: clamp(1.0rem, 4.6vw, 1.3rem);
    gap: 0.2em;
    transform: translateY(clamp(-38px, -4.5vh, -16px));
  }
  .hero-lower {
    padding-bottom: clamp(6px, 2vh, 18px);
    margin-top: auto;
  }

  /* ── Interstitial panels ── */
  .interstitial-panel {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(64px, 12vh, 96px) clamp(14px, 4vw, 24px);
    align-items: center;
    justify-content: center;
  }
  .interstitial { z-index: 9; }

  /* ── Mega-cards: compact floating card ── */
  .mega-card-wrap {
    min-height: unset;
    width: calc(100% - 8px);
    max-width: 400px;
  }
  .mega-card,
  .mega-card--viz-first {
    border-radius: 20px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: unset;
  }
  .mega-viz {
    min-height: unset;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    /* Safari collapses a stretch-aligned grid item to a zero-height row
       instead of sizing it from aspect-ratio. */
    align-self: start;
  }
  .mega-card > .mega-viz,
  .mega-card--viz-first > .mega-viz { border-radius: 20px 20px 0 0; order: -1; }
  .mega-card > .mega-viz {
    border-bottom: none;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  }
  .mega-text {
    padding: clamp(1rem, 3.5vw, 1.4rem) clamp(1rem, 4vw, 1.5rem);
    text-align: center;
    order: 1;
  }
  .mega-eyebrow {
    font-size: clamp(1.28rem, 5.8vw, 1.65rem);
    margin-bottom: 0.7rem;
  }
  .mega-placeholder {
    font-size: clamp(0.94rem, 4.1vw, 1.12rem);
    line-height: 1.62;
    color: var(--on-bright);
  }

  /* Center feature-card text on mobile */
  .feat-card { text-align: center; align-items: center; display: flex; flex-direction: column; }
  .feat-card:hover { background: var(--dark); }
  .feat-card:hover::after { opacity: 0; }

  /* ── Specs ── */
  .spec-num { font-size: clamp(2rem, 9.5vw, 2.6rem); }
  .spec-lbl { font-size: .7rem; }

  /* ── Forms: iOS-safe inputs, full-width submit ── */
  .c-field input,
  .c-field textarea,
  .c-field select {
    padding: 13px 15px;
    border-radius: 13px;
    font-size: max(16px, .9rem); /* ≥16px prevents iOS focus zoom */
  }
  .c-actions { justify-content: stretch; }
  .btn-sub {
    width: 100%;
    padding: 15px 24px;
    min-height: 50px;
    font-size: .9rem;
  }
  .btn-sub:hover { transform: none; }

  /* ── Footer ── */
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: max(44px, env(safe-area-inset-bottom, 36px));
  }

  .bridge-wd { height: clamp(28px, 5vh, 56px); }

  /* ── Hero title persistence ── */
  #hero-ov.gone {
    opacity: 1;
    transform: none;
  }
  #hero-ov.gone .hero-lower {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .hov-h1 {
    transition: filter 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  }
  /* The reveal timeline leaves an inline opacity on .hov-h1, so the hide has
     to ride on the container — it is the only node GSAP never writes to. */
  #hero-ov.hero-blur {
    opacity: 0;
  }
  #hero-ov.hero-blur .hov-h1 {
    filter: blur(28px);
    opacity: 0;
  }

  #hero-ov-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: absolute;
    inset: 0;
    z-index: 20;
    text-align: center;
    /* Sits higher than the hero title — as close under the nav as the gap
       allows — to stay off the arm entering from the top right. */
    padding: calc(var(--hero-pad-top, clamp(56px, 11vh, 112px)) - clamp(8px, 2.2vh, 24px)) 32px 0;
    pointer-events: none;
  }
  #hero-ov-v2 .hov-h1 { margin: 0; }
}

/* Mobile sticky-wrap: top/bottom gradient protection */
@media (max-width: 767px) {
  .sticky-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background:
      linear-gradient(to bottom,
        #ffffff                0%,
        rgba(255,255,255,.94)  2.5%,
        rgba(255,255,255,.78)  6%,
        rgba(255,255,255,.56)  10%,
        rgba(255,255,255,.36)  15%,
        rgba(255,255,255,.18)  21%,
        rgba(255,255,255,.07)  27%,
        rgba(255,255,255,0)    34%
      ),
      linear-gradient(to top,
        #ffffff                0%,
        rgba(255,255,255,.94)  2.5%,
        rgba(255,255,255,.78)  6%,
        rgba(255,255,255,.56)  10%,
        rgba(255,255,255,.36)  15%,
        rgba(255,255,255,.18)  21%,
        rgba(255,255,255,.07)  27%,
        rgba(255,255,255,0)    34%
      );
  }
  .v2v3-top-feather {
    height: clamp(180px, 32vh, 360px);
    background: linear-gradient(
      to bottom,
      #ffffff                0%,
      rgba(255,255,255,.88)  12%,
      rgba(255,255,255,.62)  30%,
      rgba(255,255,255,.32)  52%,
      rgba(255,255,255,.12)  72%,
      rgba(255,255,255,.03)  88%,
      rgba(255,255,255,0)    100%
    );
  }
  /* Band (section 1) synthesises its own edge gradients in-canvas, so the
     white top/bottom scrims would fight it. The arm (section 2) keeps them. */
  .scroll-sec.v1 .sticky-wrap::before {
    display: none;
  }
}

/* Extra-small phones — iPhone SE / 375 px and below */
@media (max-width: 390px) {
  .hov-h1 { font-size: clamp(1.9rem, 12vw, 3.6rem); letter-spacing: -.055em; }
  .mega-eyebrow { font-size: 1.08rem; }
  .mega-placeholder { font-size: .78rem; color: var(--on-bright); }
  .spec-num { font-size: 1.95rem; }
  .ac-title { font-size: 1.02rem; }
  .ac-desc { font-size: .78rem; }
  .ac-val { font-size: 1.28rem; }
}

/* Safe-area insets */
@supports (padding: env(safe-area-inset-bottom)) {
  #nav   { padding-left:  max(14px, env(safe-area-inset-left));
           padding-right: max(14px, env(safe-area-inset-right)); }
  footer { padding-bottom: max(36px, env(safe-area-inset-bottom)); }
}

/* ── GSAP entrance reveals ── */
body:not(.no-gsap) .hov-h1,
body:not(.no-gsap) .hov-sub,
body:not(.no-gsap) .scroll-hint,
body:not(.no-gsap) .sec-h,
body:not(.no-gsap) .sec-p,
body:not(.no-gsap) .feat-card,
body:not(.no-gsap) .spec-item,
body:not(.no-gsap) .beta-live,
body:not(.no-gsap) .btn-sub,
body:not(.no-gsap) .c-field,
body:not(.no-gsap) .glass-form-card {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: opacity, transform;
}
@media (prefers-reduced-motion: reduce) {
  body .hov-h1, body .hov-sub, body .scroll-hint,
  body .sec-h, body .sec-p, body .feat-card, body .spec-item, body .beta-live,
  body .btn-sub, body .c-field, body .glass-form-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Button press polish ── */
.nav-cta, .nav-cta-mobile, .btn-sub {
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .35s ease, background .35s ease;
}
.nav-cta:active, .nav-cta-mobile:active, .btn-sub:active {
  transform: scale(.97);
}

/* ── Mobile overscroll lockdown ── */
@media (max-width: 767px) {
  html, body { overscroll-behavior-y: none; }
}
