/* ============================================================
   Nocturnal Lab — Landing page
   Brand tokens per notes/brand.md.
   Dark is the default theme; light overrides live in two
   identical token blocks (system preference + explicit toggle).
   House rules: amber is the ONLY CTA color, and pills are
   reserved for CTAs alone. Structure comes from typography,
   hairlines and the route line — not boxes.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Surfaces */
  --night: #0A0B0F;      /* canvas */
  --surface: #12141C;    /* raised surface (nav, scene chrome) */
  --panel: #0D0E14;      /* alt strip */

  /* Text */
  --paper: #F4F4F2;
  --cream: #E8E6E0;
  --latte: #C8B898;      /* secondary text */
  --ash: #9A9890;        /* muted */

  /* Brand — constant across themes */
  --cta: #E8921F;        /* the only CTA color */
  --glow: #F5C47A;       /* hover */
  --roast: #C8711A;      /* pressed */

  /* Amber as TEXT (drops to deep roast on light for AA) */
  --amber-ink: #E8921F;

  /* Accents (max two per surface) */
  --dawn: #1AB8C8;       /* AI / live data */
  --yield: #4CAF78;      /* money / success */
  --heat: #E85A3A;       /* pain stats */
  --intelligence: #8B6FD4;

  /* Lines + chrome */
  --line: rgba(244, 244, 242, 0.1);
  --line-soft: rgba(244, 244, 242, 0.07);
  --route-line: rgba(200, 184, 152, 0.4);
  --intel-line: rgba(139, 111, 212, 0.4);
  --nav-bg: rgba(10, 11, 15, 0.86);
  --hero-grad: radial-gradient(1300px 640px at 50% -12%, #221B10 0%, #14151E 52%, #0A0B0F 100%);
  --input-line: rgba(244, 244, 242, 0.28);
  --scene-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --menu-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --menu-hover: rgba(244, 244, 242, 0.06);
  --scrim: rgba(6, 7, 10, 0.74);
  --star-vis: 1;         /* backdrop starfield visibility */

  /* Nav lockup eyes (the O ring + C arc, matching logo-mark.svg) */
  --eye-ring: #E8921F;
  --eye-arc: #F5C47A;
  --eye-bean: #F5C47A;
  --eye-split: #14151E;
  --eye-beak: #C8B898;
  /* Hero croissant (bakery stream) */
  --croi: #F5C47A;
  --croi-ridge: #C8711A;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --maxw: 1280px;
}

/* Light theme — Paper canvas. Accents deepen to hold WCAG AA:
   amber text -> deep roast, dawn/yield/heat/intelligence darken. */
:root[data-theme="light"] {
  color-scheme: light;
  --night: #F4F4F2;
  --surface: #FFFFFF;
  --panel: #ECEAE3;
  --paper: #1C1A26;
  --cream: #2A2734;
  --latte: #5C5548;
  --ash: #6E6B62;
  --amber-ink: #A85C12;
  --dawn: #0D6E7A;
  --yield: #2E7D4F;
  --heat: #C0391B;
  --intelligence: #6A4FB8;
  --line: rgba(28, 26, 38, 0.14);
  --line-soft: rgba(28, 26, 38, 0.09);
  --route-line: rgba(28, 26, 38, 0.3);
  --intel-line: rgba(106, 79, 184, 0.45);
  --nav-bg: rgba(244, 244, 242, 0.88);
  --hero-grad: radial-gradient(1300px 640px at 50% -12%, #F2E3CB 0%, #F5F1E8 52%, #F4F4F2 100%);
  --input-line: rgba(28, 26, 38, 0.35);
  --scene-shadow: 0 24px 60px rgba(28, 26, 38, 0.16);
  --menu-shadow: 0 18px 44px rgba(28, 26, 38, 0.18);
  --menu-hover: rgba(28, 26, 38, 0.06);
  --scrim: rgba(28, 26, 38, 0.44);
  --star-vis: 0;
  --eye-ring: #C8711A;
  --eye-arc: #1C1A26;
  --eye-bean: #C8711A;
  --eye-split: #F4F4F2;
  --eye-beak: #9A9890;
  --croi: #C8711A;
  --croi-ridge: #A85C12;
}

/* Same light tokens when the system prefers light and no explicit
   choice has been made (keep in sync with the block above). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --night: #F4F4F2;
    --surface: #FFFFFF;
    --panel: #ECEAE3;
    --paper: #1C1A26;
    --cream: #2A2734;
    --latte: #5C5548;
    --ash: #6E6B62;
    --amber-ink: #A85C12;
    --dawn: #0D6E7A;
    --yield: #2E7D4F;
    --heat: #C0391B;
    --intelligence: #6A4FB8;
    --line: rgba(28, 26, 38, 0.14);
    --line-soft: rgba(28, 26, 38, 0.09);
    --route-line: rgba(28, 26, 38, 0.3);
    --intel-line: rgba(106, 79, 184, 0.45);
    --nav-bg: rgba(244, 244, 242, 0.88);
    --hero-grad: radial-gradient(1300px 640px at 50% -12%, #F2E3CB 0%, #F5F1E8 52%, #F4F4F2 100%);
    --input-line: rgba(28, 26, 38, 0.35);
    --scene-shadow: 0 24px 60px rgba(28, 26, 38, 0.16);
    --menu-shadow: 0 18px 44px rgba(28, 26, 38, 0.18);
    --menu-hover: rgba(28, 26, 38, 0.06);
    --scrim: rgba(28, 26, 38, 0.44);
    --star-vis: 0;
    --eye-ring: #C8711A;
    --eye-arc: #1C1A26;
    --eye-bean: #C8711A;
    --eye-split: #F4F4F2;
    --eye-beak: #9A9890;
    --croi: #C8711A;
    --croi-ridge: #A85C12;
  }
}

/* ============ BASE ============ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--night);
}

body {
  font-family: var(--font-body);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { text-wrap: balance; }

a { color: var(--amber-ink); text-decoration: none; }
a:hover { color: var(--glow); }
:root[data-theme="light"] a:hover { color: var(--roast); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--amber-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible,
.theme-toggle:focus-visible {
  border-radius: 999px;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--cta);
  color: #0A0B0F;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 22px;
  transition: top 0.15s ease;
}
.skip-link:hover { color: #0A0B0F; }
.skip-link:focus { top: 12px; }

/* ---- CTAs: the only pills on the page ---- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  display: inline-block;
}
.btn-primary {
  color: #0A0B0F;
  background: var(--cta);
  border: none;
}
.btn-primary:hover { background: var(--glow); color: #0A0B0F; }
.btn-primary:active { background: var(--roast); }

/* Arrow link — quiet secondary action */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 17px;
  color: var(--amber-ink);
}
.link-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}
.link-arrow:hover svg { transform: translateX(4px); }

/* Mono manifest lines — data without pills */
.hero-manifest,
.step-manifest {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 2;
  color: var(--ash);
}
.hero-manifest .sep,
.step-manifest .sep { color: var(--amber-ink); padding: 0 6px; }
.step-manifest { margin-top: 44px; }
.step-manifest .yield { color: var(--yield); }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 130px 40px 0;
}

.section-head { margin-bottom: 56px; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 3.4vw, 46px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  max-width: 20ch;
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img { display: block; }
.footer .brand img { height: 34px; width: auto; }

/* ---- Nav lockup: inline animated SVG wordmark. The O and C are the
   owl's eyes (one 116x56 glyph with the latte beak between them); the
   pupils glance around and blink. Colors are theme-aware. ---- */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-display);
  line-height: 1;
}
.lk-word {
  display: inline-flex;
  align-items: center;
  gap: 0.04em;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.14em;
  color: var(--paper);
}
.lk-word > span { display: block; }
.lockup .eye {
  height: 1.18em;
  width: auto;
  display: block;
  overflow: visible;
}
.lk-sub {
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.18em;
  color: var(--amber-ink);
}
.lockup .oc-eye { animation: oc-look 7s ease-in-out infinite; }
.lockup .oc-blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: oc-blink 5.2s ease-in-out infinite;
}
@keyframes oc-look {
  0%, 18% { transform: translateX(0); }
  26%, 40% { transform: translateX(-3.2px); }
  50%, 68% { transform: translateX(3.2px); }
  78%, 100% { transform: translateX(0); }
}
@keyframes oc-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  93%, 95% { transform: scaleY(0.12); }
  98% { transform: scaleY(1); }
}
.wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.22em;
}
.wordmark .n { font-weight: 700; color: var(--paper); }
.wordmark .l { font-weight: 300; color: var(--amber-ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--latte);
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--paper); }

.nav-cta {
  font-size: 15px;
  padding: 12px 26px;
}
.nav-cta .cta-short { display: none; }

/* Theme toggle: bare icon, shows the theme you would switch TO */
.theme-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--latte);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}
.theme-toggle:hover { color: var(--amber-ink); }
.theme-toggle svg { width: 19px; height: 19px; display: none; }
/* The trigger icon shows the CURRENT mode; the dropdown picks a new one */
:root[data-theme-mode="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme-mode="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme-mode="system"] .theme-toggle .icon-system,
:root:not([data-theme-mode]) .theme-toggle .icon-system { display: block; }

.theme-menu { position: relative; }
.theme-options {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--menu-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: nl-menu-in 0.22s cubic-bezier(0.19, 1, 0.22, 1);
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--latte);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theme-option:hover { background: var(--menu-hover); color: var(--paper); }
.theme-option svg { width: 17px; height: 17px; flex-shrink: 0; }
.theme-option[aria-checked="true"] { color: var(--amber-ink); }
@keyframes nl-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
}

/* Burger — mobile only */
.nav-burger { display: none; }
.mobile-menu { display: none; }

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
}
.hero .starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: var(--star-vis);
  transition: opacity 0.3s ease;
}
.hero-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 104px 40px 96px;
  display: grid;
  grid-template-columns: 1.05fr minmax(0, 1fr);
  gap: 70px;
  align-items: center;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 4.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.hero-sub {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--latte);
  max-width: 560px;
}
.hero-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-actions .btn { font-size: 17px; padding: 16px 34px; }

.hero-media {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero-media .hero-manifest { text-align: center; }

/* ---- "Two Streams, One Cup" hero scene: unframed, melts into the hero.
   Beans stream in from ROASTERS, croissants from BAKERIES, converging on
   the owl eyes; a fresh cup steams below. ---- */
.hero-orbit {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 520 / 420;
  max-height: 452px;
}
.hero-orbit .orbit {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.starfield circle { animation: nl-twinkle 5.5s ease-in-out infinite; }
.starfield circle:nth-child(2n) { animation-delay: -2.1s; }
.starfield circle:nth-child(3n) { animation-delay: -3.6s; animation-duration: 4.4s; }

.orbit .oc-tw { animation: oc-tw 4.2s ease-in-out infinite; }
.orbit .oc-eye { animation: oc-look 7s ease-in-out infinite; }
.orbit .oc-blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: oc-blink 5.2s ease-in-out infinite;
}
.orbit .oc-wisp { animation: oc-wisp 3.4s ease-in-out infinite; }
.orbit .oc-in-l { animation: oc-in-l 6s linear infinite; }
.orbit .oc-in-l.d2 { animation-delay: 3s; }
.orbit .oc-in-r { animation: oc-in-r 6s linear infinite; animation-delay: 1.5s; }
.orbit .oc-in-r.d2 { animation-delay: 4.5s; }

@keyframes nl-twinkle {
  0%, 100% { opacity: 0.22; }
  50% { opacity: 0.85; }
}
@keyframes oc-tw {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.75; }
}
@keyframes oc-wisp {
  0% { opacity: 0; transform: translateY(4px); }
  35% { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-14px); }
}
@keyframes oc-in-l {
  0% { transform: translate(30px, 56px); opacity: 0; }
  12% { opacity: 0.9; }
  82% { opacity: 0.9; }
  100% { transform: translate(196px, 156px); opacity: 0; }
}
@keyframes oc-in-r {
  0% { transform: translate(478px, 56px); opacity: 0; }
  12% { opacity: 0.9; }
  82% { opacity: 0.9; }
  100% { transform: translate(318px, 156px); opacity: 0; }
}

.live { color: var(--dawn); }

/* ============ PARTNERS ============ */
.partners {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}
.partners-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.partners-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--ash);
}
.partners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.partner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--latte);
}
.partner svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  opacity: 0.85;
}
.partner svg.wide { width: 32px; }
.partner span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}

/* ============ PROBLEM — the ledger ============ */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.problem-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.problem-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.problem-copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ash);
  max-width: 52ch;
}
.barriers {
  border-top: 1px solid var(--line);
}
.barrier {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 21px 4px;
  border-bottom: 1px solid var(--line);
}
.barrier .name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--cream);
}
.barrier .stat {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--heat);
  white-space: nowrap;
}

/* ============ HOW IT WORKS — the route ============ */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.steps::before {
  content: "";
  position: absolute;
  top: 23px;
  left: 24px;
  right: 24px;
  border-top: 2px dashed var(--route-line);
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--cta);
  background: var(--night);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--amber-ink);
  transition: background-color 0.3s ease;
}
.step-num.filled {
  background: var(--cta);
  border-color: var(--cta);
  color: #0A0B0F;
  font-weight: 600;
}
.step-title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
}
.step-desc {
  margin: 0;
  font-size: 16px;
  color: var(--ash);
  line-height: 1.6;
  max-width: 30ch;
}

/* ============ PLATFORM — the spec sheet ============ */
.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 40px;
}
.module {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.module.intelligence { border-top-color: var(--intel-line); }
.module-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--amber-ink);
}
.module.intelligence .module-label { color: var(--intelligence); }
.module-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
}
.module-desc {
  margin: 0;
  font-size: 16px;
  color: var(--ash);
  line-height: 1.6;
  max-width: 38ch;
}

/* ============ SUPPLY — two columns, one seam ============ */
.supply-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.supply-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 56px;
}
.supply-card + .supply-card {
  border-left: 1px solid var(--line);
  padding-left: 56px;
  padding-right: 0;
}
.supply-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--amber-ink);
}
.supply-card p {
  margin: 0;
  font-size: 17px;
  color: var(--latte);
  line-height: 1.65;
  max-width: 52ch;
}
.supply-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ash);
  margin-top: 6px;
}

/* ============ SUBSCRIBE — full-bleed band ============ */
.subscribe {
  margin-top: 150px;
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.subscribe-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 70px;
  align-items: center;
}
.subscribe-copy h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 3.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.subscribe-copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--latte);
  max-width: 48ch;
}
.subscribe-form {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--input-line);
  border-radius: 0;
  padding: 12px 2px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--paper);
  outline: none;
  transition: border-color 0.15s ease;
}
.subscribe-form input::placeholder { color: var(--ash); }
.subscribe-form input[type="email"]:focus { border-bottom-color: var(--cta); }
.subscribe-form input[type="email"]:focus-visible {
  outline: none;
  border-bottom-color: var(--cta);
  box-shadow: 0 1px 0 0 var(--cta);
}
.subscribe-form input[aria-invalid="true"] { border-bottom-color: var(--heat); }
.subscribe-form button {
  font-size: 16px;
  padding: 15px 32px;
  flex-shrink: 0;
}
.subscribe-form button:disabled { opacity: 0.6; cursor: wait; }

/* Honeypot — visually removed, still in the form for bots */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.subscribe-status {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.subscribe-status.show { display: flex; }
.subscribe-status .status-icon { display: flex; flex-shrink: 0; }
.subscribe-status.ok .status-icon { color: var(--yield); }
.subscribe-status.err .status-icon { color: var(--heat); }
.subscribe-status .status-text { font-size: 16px; color: var(--cream); }

/* ============ APPLY DIALOG ============ */
.apply-dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  overflow-y: auto;
  margin: auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--paper);
  box-shadow: var(--menu-shadow);
}
.apply-dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.apply-dialog[open] { animation: nl-dialog-in 0.24s cubic-bezier(0.19, 1, 0.22, 1); }
.apply-dialog[open]::backdrop { animation: nl-scrim-in 0.24s ease-out; }
@keyframes nl-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
}
@keyframes nl-scrim-in { from { opacity: 0; } }

body.dialog-open { overflow: hidden; }

.apply-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.apply-heading h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.apply-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ash);
  max-width: 42ch;
}
.apply-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ash);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.apply-close:hover { color: var(--paper); background: var(--menu-hover); }
.apply-close svg { width: 19px; height: 19px; }

.apply-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  /* Keep the two controls on one line even if a label wraps */
  align-items: end;
}
.field {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}
.field .opt { color: var(--ash); opacity: 0.7; }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--input-line);
  border-radius: 0;
  padding: 10px 2px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--paper);
  outline: none;
  transition: border-color 0.15s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ash); }
.field textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.55;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  cursor: pointer;
  /* An explicit background is required, not transparent: the native
     option popup inherits it, and a transparent select makes the browser
     paint the popup near-white — which hid the near-white option text in
     dark mode. --surface matches the dialog, so the closed control looks
     exactly the same as before. */
  background-color: var(--surface);
}
.field select option {
  background-color: var(--surface);
  color: var(--paper);
}
/* Chevron for the selects, drawn in CSS so it follows the theme */
.field:has(select)::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 16px;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--ash);
  border-bottom: 1.6px solid var(--ash);
  transform: rotate(45deg);
  pointer-events: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-bottom-color: var(--cta); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--cta);
  box-shadow: 0 1px 0 0 var(--cta);
}
/* Invalid wins over the amber focus line, focused or not */
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-bottom-color: var(--heat); }
.field input[aria-invalid="true"]:focus-visible,
.field select[aria-invalid="true"]:focus-visible,
.field textarea[aria-invalid="true"]:focus-visible {
  border-bottom-color: var(--heat);
  box-shadow: 0 1px 0 0 var(--heat);
}

.apply-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.apply-actions .btn { font-size: 16px; padding: 15px 32px; }
.apply-actions .btn:disabled { opacity: 0.6; cursor: wait; }
.apply-fine {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ash);
}

.apply-status {
  display: none;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
}
.apply-status.show { display: flex; }
.apply-status .status-icon { display: flex; flex-shrink: 0; margin-top: 2px; }
.apply-status.ok .status-icon { color: var(--yield); }
.apply-status.err .status-icon { color: var(--heat); }
.apply-status .status-text { font-size: 16px; line-height: 1.55; color: var(--cream); }

/* ============ FOOTER ============ */
.footer {
  background: var(--night);
}
.footer-top {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 40px 44px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 50px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand p {
  margin: 0;
  font-size: 16px;
  color: var(--ash);
  line-height: 1.6;
  max-width: 380px;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col .col-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--ash);
}
.footer-col a, .footer-col .txt {
  font-size: 15px;
  color: var(--latte);
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--paper); }
.footer-col .muted { color: var(--ash); }

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px 36px;
}
.footer-bottom span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ash);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .problem-grid { grid-template-columns: 1fr; gap: 44px; }

  /* Route turns vertical */
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::before {
    top: 24px;
    bottom: 24px;
    left: 23px;
    right: auto;
    border-top: none;
    border-left: 2px dashed var(--route-line);
  }
  .step {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 24px;
    row-gap: 6px;
    align-items: start;
  }
  .step .step-num { grid-row: 1 / span 2; }
  .step .step-title { margin-top: 10px; }
  .step-desc { max-width: 56ch; }

  .modules { grid-template-columns: repeat(2, 1fr); }
  .subscribe-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
}

/* Tablet + down: fold the inline nav links into the burger menu, but keep
   the full animated lockup — there's still room for it beside the burger. */
@media (max-width: 900px) {
  .nav-inner { padding: 14px 22px; gap: 14px; }
  .nav-links { gap: 12px; }
  .nav-links .nav-link { display: none; }
  .theme-toggle { width: 36px; height: 36px; }

  .nav-burger {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--paper);
    cursor: pointer;
    padding: 0;
  }
  .nav-burger svg { width: 22px; height: 22px; }
  .nav-burger .icon-close { display: none; }
  .nav-burger[aria-expanded="true"] .icon-burger { display: none; }
  .nav-burger[aria-expanded="true"] .icon-close { display: block; }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
    padding: 6px 22px 12px;
    animation: nl-menu-in 0.22s cubic-bezier(0.19, 1, 0.22, 1);
  }
  .mobile-link {
    padding: 15px 2px;
    font-size: 16px;
    font-weight: 500;
    color: var(--latte);
    border-bottom: 1px solid var(--line-soft);
    transition: color 0.15s ease;
  }
  .mobile-link:last-child { border-bottom: none; }
  .mobile-link:hover { color: var(--paper); }
}

@media (max-width: 680px) {
  .section { padding: 84px 22px 0; }
  .hero-inner { padding: 64px 22px 60px; }
  .hero-orbit { max-width: 380px; }
  .brand { gap: 10px; }
  .partners-inner { padding: 24px 22px; gap: 18px; }
  .partners-list { justify-content: flex-start; gap: 18px 24px; }
  .modules { grid-template-columns: 1fr; gap: 36px; }
  .supply-grid { grid-template-columns: 1fr; gap: 44px; }
  .supply-card { padding-right: 0; }
  .supply-card + .supply-card {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 44px;
  }
  .problem-copy h2, .section-head h2 { font-size: 32px; }
  .subscribe { margin-top: 100px; }
  .subscribe-inner { padding: 72px 22px; }
  .subscribe-copy h2 { font-size: 30px; }
  .subscribe-form { flex-direction: column; align-items: stretch; }
  .footer-top { grid-template-columns: 1fr; padding: 56px 22px 36px; }
  .footer-bottom { padding: 0 22px 32px; }
}

/* Phones: collapse the lockup to just the O·C eye mark (the favicon)
   and shorten the CTA so the bar never crowds. */
@media (max-width: 560px) {
  .lockup { gap: 0; }
  .lk-word > span, .lk-sub { display: none; }
  .nav-cta { padding: 10px 18px; font-size: 14px; }
  .nav-cta .cta-long { display: none; }
  .nav-cta .cta-short { display: inline; }

  .apply-dialog { padding: 26px 22px; border-radius: 18px; }
  .apply-heading h2 { font-size: 23px; }
  .field-row { grid-template-columns: 1fr; }
  .apply-actions { gap: 14px; }
  .apply-actions .btn { width: 100%; text-align: center; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit .oc-tw,
  .orbit .oc-eye,
  .orbit .oc-blink,
  .orbit .oc-wisp,
  .orbit .oc-in-l,
  .orbit .oc-in-r,
  .starfield circle {
    animation: none !important;
  }
  /* keep the steam invisible rather than frozen mid-rise; the stream
     items rest at their attribute start positions */
  .orbit .oc-wisp { opacity: 0; }
  body, .hero .starfield, .link-arrow svg { transition: none; }
  .theme-options, .mobile-menu, .lockup .oc-eye, .lockup .oc-blink { animation: none; }
  .apply-dialog[open], .apply-dialog[open]::backdrop { animation: none; }
}
