/* ==========================================================================
   Ascend AI Automations, one-page site
   Design tokens first. Two themes (auto via prefers-color-scheme), one accent.
   Radius system: pills for interactive controls and chips, 16px for panels
   and media, 12px for small icon tiles. Phone bezel is exempt (device shape).
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Light theme (default). All pairs verified WCAG AA or better. */
  --bg: #F7F7F8;
  --surface: #FDFDFE;
  --surface-2: #F0F1F4;
  --line: #E3E4E9;
  --text: #18181B;
  --text-2: #52525B;
  --accent: #1D4ED8;          /* the one accent, everywhere */
  --accent-soft: #E8EEFC;     /* tinted fills */
  --accent-text: #1D4ED8;     /* accent-colored text on bg/surface */
  --band: #1B3FA8;            /* deep-blue final CTA band */
  --band-text: #FCFCFD;
  --band-text-2: #EAF0FF;
  --on-accent: #FCFCFD;
  --shadow: 0 1px 2px rgb(29 41 82 / 0.06), 0 12px 32px rgb(29 41 82 / 0.07);
  --shadow-lg: 0 2px 4px rgb(29 41 82 / 0.08), 0 24px 56px rgb(29 41 82 / 0.13);

  --r-panel: 16px;
  --r-tile: 12px;
  --r-pill: 999px;

  --container: 1400px;
  --nav-h: 68px;
  --glow: 13%;
  --bg-alt: #F1F2F5;
}

/* Dark tokens. Applied by system preference, or forced via
   <html data-theme="dark"> (data-theme="light" forces light).
   Keep this block and the [data-theme] copy below in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0D11;
    --surface: #15161C;
    --surface-2: #1B1D25;
    --line: #262933;
    --text: #F4F4F5;
    --text-2: #A1A1AA;
    --accent: #1D4ED8;
    --accent-soft: #17233F;
    --accent-text: #8AB0FA;
    --band: #1B3FA8;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.45), 0 24px 56px rgb(0 0 0 / 0.5);
    --glow: 26%;
    --bg-alt: #10121A;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0D11;
  --surface: #15161C;
  --surface-2: #1B1D25;
  --line: #262933;
  --text: #F4F4F5;
  --text-2: #A1A1AA;
  --accent: #1D4ED8;
  --accent-soft: #17233F;
  --accent-text: #8AB0FA;
  --band: #1B3FA8;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.45), 0 24px 56px rgb(0 0 0 / 0.5);
  --glow: 26%;
  --bg-alt: #10121A;
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light dark;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; }

img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 3vw, 2rem);
}

.ic {
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
  flex: none;
}

section { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* Alternating section bands, one theme family (leftclick-style rhythm) */
.sec-alt { background: var(--bg-alt); }

/* Tighter vertical rhythm (home page content sections) */
.tight { padding-block: clamp(2.75rem, 5vw, 4.5rem) !important; }
.tight .section-head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.band.tight { margin-block: 0; }

:root[data-theme="light"] { color-scheme: light; }

/* Floating theme toggle, bottom right. JS-only feature: hidden without JS. */
.theme-toggle { display: none; }
.js .theme-toggle {
  position: fixed;
  right: clamp(1rem, 2vw, 1.5rem);
  bottom: clamp(1rem, 2vw, 1.5rem);
  z-index: 60;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-2); }
.theme-toggle:active { transform: translateY(1px); }
.theme-toggle .ic { width: 20px; height: 20px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: 600 0.9375rem/1.2 "Geist", system-ui, sans-serif;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.pressed { transform: translateY(1px) scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: #1A46C2; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--text-2); }

.btn-inverse {
  background: var(--band-text);
  color: var(--band);
}
.btn-inverse:hover { background: #FFFFFF; }

.btn-lg { padding: 0.95rem 1.75rem; font-size: 1.0625rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ---------- Nav ---------- */

.nav-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-suffix { font-weight: 500; color: var(--text-2); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .btn-nav { margin-left: auto; }
}
@media (max-width: 480px) {
  .brand-suffix { display: none; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(4rem, 8vw, 6.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6.8fr) minmax(0, 5.2fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero-copy h1 {
  /* Sized so the longest line fits the column: 2 lines max on desktop */
  font-size: clamp(2.35rem, 4.3vw, 3.3rem);
  font-weight: 700;
  max-width: 23ch;
}

/* Short punchy headlines (home, case pages) get more scale */
.hero-copy h1.display-lg {
  font-size: clamp(2.6rem, 5vw, 3.7rem);
  max-width: 19ch;
}

/* Hero background video (speed-to-lead): faint b-roll under a heavy wash */
.hero-video .hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  /* TEST MODE: blur disabled. Restore: filter: blur(2px); transform: scale(1.03); */
}
.hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}
.hero-video::before { z-index: 2; }
.hero-video .hero-center-inner { z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  .hero-bg-video { display: none; }
}
html.noanim .hero-bg-video { display: none; }

/* Case-study hero: the main page's centered hero, minus the ticker.
   Doubled class beats .hero-center h1's margin-top:auto regardless of order. */
.hero-center.hero-case h1 {
  margin-top: 0;
  font-size: clamp(2.6rem, 4.6vw, 3.6rem);
  max-width: 24ch;
}
.hero-center.hero-case .hero-ctas {
  margin-top: 1.6rem;
  justify-content: center;
}

/* Demo as its own section: phone or console centered on the band */
.demo-stage { max-width: 460px; margin-inline: auto; }
.demo-stage .phone { margin: 0 auto; max-width: none; }
.demo-stage .phone-caption { margin: 0.9rem auto 0; max-width: none; text-align: center; }
.console { margin-inline: auto; }

/* Split hero variant for pages whose demo is a console (wider than the phone) */
.hero-grid-console { grid-template-columns: minmax(0, 5.6fr) minmax(0, 6.4fr); }
.hero-grid-console .console { max-width: none; }
.hero-grid .variants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-copy h1.h1-sm {
  font-size: clamp(2.2rem, 3.4vw, 2.55rem);
  max-width: 26ch;
}

/* Solo hero: editorial copy only, demo lives in the section below */
.hero-solo { max-width: 48rem; }
.hero-solo h1 {
  /* Wide enough that the longest case-page headline breaks to 2 lines max */
  font-size: clamp(2.5rem, 4.3vw, 3.3rem);
  font-weight: 700;
  max-width: 30ch;
}
.hero-solo .hero-sub { max-width: 58ch; }

/* Centered manifesto hero (home): full-viewport, glow, stat-style build row */
.hero-center {
  position: relative;
  overflow: hidden;
  padding-block: 0;
}
.hero-center::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    54% 46% at 50% 16%,
    color-mix(in srgb, var(--accent) var(--glow), transparent),
    transparent 70%
  );
}
.hero-center-inner {
  position: relative;
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* no bottom padding: the ticker band sits flush on the section edge */
  padding-block: 3.5rem 0;
}
.hero-center h1 {
  /* margin-top auto pairs with the ticker's, so the headline block sits
     centered between the nav and the bottom strip */
  margin-top: auto;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 20ch;
}
.hero-center .hero-sub {
  margin-top: 1.6rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  max-width: 54ch;
}

.hero-builds {
  margin-top: 2.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem clamp(1.75rem, 4vw, 3.5rem);
}
.hb {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--text);
  text-align: center;
}
.hb strong {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: color 0.2s ease;
}
.hb span { font-size: 0.875rem; color: var(--text-2); }
.hb:hover strong { color: var(--accent-text); }

@media (min-width: 721px) {
  .hb + .hb {
    border-left: 1px solid var(--line);
    padding-left: clamp(1.75rem, 4vw, 3.5rem);
  }
}
@media (max-width: 720px) {
  .hero-builds { flex-direction: column; gap: 1.4rem; }
}

.hero-center .btn-xl { margin-top: 1.6rem; }

/* Screenshot/test harness (?noanim): compact hero so full-page captures work */
html.noanim .hero-center-inner { min-height: 0; padding-block: 5.5rem 0; }
.btn-xl { padding: 1.05rem 2.1rem; font-size: 1.125rem; }

/* Bottom-of-fold ticker: business types now, client logos later */
.ticker {
  /* full viewport width; the hero's overflow:hidden absorbs scrollbar excess */
  width: 100vw;
  margin-top: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.6rem, 2.6vw, 2.2rem);
  padding-inline: max(clamp(1.25rem, 3vw, 2rem), calc((100vw - var(--container)) / 2 + clamp(1.25rem, 3vw, 2rem)));
  display: flex;
  align-items: center;
  gap: 2rem;
  text-align: left;
}
.ticker-label {
  flex: none;
  font-size: 0.9375rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
}
.ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; width: max-content; }
.ticker-row {
  list-style: none;
  margin: 0;
  padding: 0 3.75rem 0 0;
  display: flex;
  gap: 3.75rem;
}
.ticker-row li {
  white-space: nowrap;
  font-size: clamp(1rem, 1.3vw, 1.1875rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0.72;
}
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: ticker-scroll 48s linear infinite; }
}
@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .ticker { flex-direction: column; align-items: flex-start; gap: 0.55rem; padding-top: 0.9rem; }
  .ticker-label { font-size: clamp(0.7rem, 3.3vw, 0.85rem); }
  .ticker-row { gap: clamp(1.6rem, 6vw, 2.5rem); padding-right: clamp(1.6rem, 6vw, 2.5rem); }

  /* Fluid phone hero: every element scales with the device viewport
     (vw-driven, dvh-guarded) so the fold composition is proportionate
     on any phone size */
  .hero-center h1,
  .hero-center.hero-case h1 {
    font-size: clamp(1.7rem, min(8.4vw, 4.6dvh), 2.8rem);
    letter-spacing: -0.02em;
  }
  .hero-center .hero-sub {
    font-size: clamp(0.9rem, 4.2vw, 1.125rem);
    margin-top: clamp(0.8rem, 3vw, 1.4rem);
  }
  .hero-center .btn-xl {
    margin-top: clamp(1rem, 3.4vw, 1.5rem);
    width: 100%;
    max-width: min(85vw, 340px);
    padding-block: clamp(0.85rem, 3vw, 1.1rem);
    font-size: clamp(1rem, 4.3vw, 1.15rem);
  }
  .hero-center.hero-case .hero-ctas {
    margin-top: clamp(1rem, 3.4vw, 1.5rem);
    width: 100%;
    gap: clamp(0.5rem, 2.2vw, 0.85rem);
  }
  .hero-center.hero-case .hero-ctas .btn {
    flex: 1 1 auto;
    font-size: clamp(0.9rem, 3.9vw, 1.0625rem);
  }
  .case-tag {
    font-size: clamp(0.65rem, 3vw, 0.8rem);
    letter-spacing: 0.12em;
    margin-bottom: clamp(0.8rem, 2.8vw, 1.2rem);
  }
  .ticker { padding-top: clamp(0.7rem, 2.4vw, 1rem); }
  .ticker-row li { font-size: clamp(0.85rem, 4vw, 1rem); }
}

.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-text);
  margin-bottom: 1.2rem;
}

.hero-sub {
  margin-top: 1.4rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--text-2);
  max-width: 52ch;
}

.hero-ctas {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 18ch; }
  .hero-visual { max-width: 440px; }
}

/* ---------- Phone demo (real working component) ---------- */

.phone {
  /* Bezel radius mimics the device, exempt from the panel radius scale. */
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 1.1rem 1.3rem;
  max-width: 420px;
  margin-left: auto;
}

.phone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0.25rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.phone-contact { display: flex; align-items: center; gap: 0.65rem; }

.phone-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phone-name { display: block; font-weight: 650; font-size: 0.9375rem; line-height: 1.25; }
.phone-status { display: block; font-size: 0.8125rem; color: var(--text-2); }

.phone-booked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill);
}

.phone-thread {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 1rem;
  min-height: 505px;
}

.msg {
  max-width: 88%;
  padding: 0.62rem 0.9rem;
  border-radius: var(--r-panel);
  font-size: 0.9rem;
  line-height: 1.45;
}

.msg-event {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  padding: 0.1rem 0.15rem;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 550;
}

.msg-in {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}

.msg-out {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.draft {
  border: 1.5px dashed color-mix(in srgb, var(--accent-text) 55%, var(--line));
  border-radius: var(--r-panel);
  padding: 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.draft-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--accent-text);
  margin-bottom: 0.45rem;
}

.draft p { font-size: 0.9rem; line-height: 1.45; }

.draft-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Steps stay out of the layout until the demo reveals them.
   JS adds .entering (restores display, still transparent), then .shown. */
.phone.is-animated [data-step]:not(.entering):not(.shown) { display: none; }
.phone.is-animated [data-step].entering { opacity: 0; transform: translateY(10px); }
.phone.is-animated [data-step].shown {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-caption {
  margin-top: 1rem;
  max-width: 420px;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-2);
  text-align: left;
}

@media (max-width: 940px) {
  .phone, .phone-caption { margin-left: 0; }
}

/* ---------- Problem (editorial) ---------- */

.problem { padding-block: clamp(4.5rem, 9vw, 8rem); }

.problem-inner { max-width: 58rem; }

.problem h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.problem p {
  margin-top: 1.35rem;
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 68ch;
}

.problem-pull {
  color: var(--accent-text);
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* ---------- Section heads (stacked, never split) ---------- */

.section-head { max-width: 62rem; margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }
.section-head h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); font-weight: 700; }
.section-head p { margin-top: 0.85rem; color: var(--text-2); font-size: 1.0625rem; max-width: 66ch; }

/* ---------- How it works (vertical rail) ---------- */

.how { padding-block: clamp(4rem, 8vw, 7rem); }

.rail {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 56rem;
  position: relative;
}

.rail::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--line);
}

.rail-node {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding: 1.05rem 0;
}

.rail-icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-tile);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.rail-icon .ic { width: 22px; height: 22px; }

.rail-node h3 { font-size: 1.1875rem; font-weight: 650; margin-top: 0.55rem; }
.rail-node p { margin-top: 0.4rem; color: var(--text-2); font-size: 0.9875rem; max-width: 56ch; }

/* The differentiator step gets the accent treatment */
.rail-node-key {
  margin-block: 0.6rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--accent-text) 45%, var(--line));
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
}
.rail-node-key .rail-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.rail-node-key h3 { font-size: 1.3125rem; margin-top: 0.65rem; }

.key-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 0.28rem 0.75rem;
}

@media (max-width: 560px) {
  .rail::before { left: 19px; }
  .rail-icon { width: 40px; height: 40px; }
  .rail-icon .ic { width: 19px; height: 19px; }
  .rail-node { gap: 0.95rem; }
  .rail-node-key { padding: 1.1rem 1rem; }
}

/* ---------- Demo video ---------- */

.demo { padding-block: clamp(4rem, 8vw, 7rem); }

.demo-inner { max-width: 72rem; }

.demo h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.video-frame {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-panel);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background:
    radial-gradient(120% 140% at 15% 0%, #24315E 0%, transparent 55%),
    radial-gradient(130% 120% at 90% 100%, #17244A 0%, transparent 60%),
    #101322;
}

.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.video-poster {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #F4F6FC;
  font-family: inherit;
}

.video-play {
  width: 74px;
  height: 74px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 34px rgb(13 28 82 / 0.55);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-play .ic { width: 30px; height: 30px; margin-left: 3px; }
.video-poster:hover .video-play { transform: scale(1.06); }
.video-poster:active .video-play { transform: scale(0.97); }

.video-label { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }

/* ---------- What we build (bento) ---------- */

.build { padding-block: clamp(4rem, 8vw, 7rem); }

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.1rem;
}

.cell {
  grid-column: span 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: clamp(1.5rem, 3vw, 2.1rem);
}

.cell:nth-child(1) { grid-column: span 7; }
.cell:nth-child(4) { grid-column: span 7; }

.cell-icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: var(--r-tile);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-sizing: border-box;
}

.cell h3 { margin-top: 1.1rem; font-size: 1.25rem; font-weight: 650; }
.cell p { margin-top: 0.6rem; color: var(--text-2); font-size: 0.9875rem; max-width: 62ch; }

.cell-featured {
  background:
    radial-gradient(140% 150% at 100% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 58%);
  border-color: color-mix(in srgb, var(--accent-text) 30%, var(--line));
}

.cell-tinted { background: var(--surface-2); }

/* Explicit span utilities (used on the home grid) */
.bento .s7 { grid-column: span 7; }
.bento .s6 { grid-column: span 6; }
.bento .s5 { grid-column: span 5; }
.bento .s4 { grid-column: span 4; }

@media (max-width: 860px) {
  .bento > article { grid-column: 1 / -1 !important; }
}

/* ---------- Who it's for (chip cloud) ---------- */

.who { padding-block: clamp(4rem, 8vw, 7rem); }

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9875rem;
  letter-spacing: -0.01em;
}
.chip .ic { width: 1.15em; height: 1.15em; color: var(--accent-text); }

/* ---------- Final CTA band ---------- */

.band {
  margin-block: clamp(2rem, 5vw, 4rem) 0;
  background: var(--band);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.band h2 {
  color: var(--band-text);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700;
}

.band p {
  margin-top: 0.8rem;
  color: var(--band-text-2);
  font-size: 1.125rem;
  max-width: 44ch;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
}

.footer-legal {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--text-2);
}

@media (max-width: 720px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { margin-left: 0; }
}

/* ---------- Semantic state colors (demo consoles only) ---------- */

:root {
  --ok: #15803D;
  --ok-soft: #E4F4EA;
  --warn: #B45309;
  --warn-soft: #FBEFDD;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok: #4ADE80;
    --ok-soft: #12291B;
    --warn: #FBBF24;
    --warn-soft: #2E2413;
  }
}
:root[data-theme="dark"] {
  --ok: #4ADE80;
  --ok-soft: #12291B;
  --warn: #FBBF24;
  --warn-soft: #2E2413;
}

/* ---------- Builds panel (home hero) ---------- */

.builds-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-lg);
  padding: 0.65rem;
  max-width: 520px;
  margin-left: auto;
  width: 100%;
}

.builds-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.75rem 0.85rem 0.7rem;
}
.builds-head h2 { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.builds-head span { font-size: 0.8125rem; color: var(--text-2); }

.build-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.85rem;
  border-radius: var(--r-tile);
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.2s ease;
}
.build-row:hover { background: var(--surface-2); }
.build-row + .build-row { margin-top: 0.15rem; }

.build-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-tile);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.build-icon .ic { width: 20px; height: 20px; }

.build-info { min-width: 0; flex: 1; }
.build-name { display: block; font-weight: 650; font-size: 0.9375rem; line-height: 1.3; }
.build-status {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-2);
  height: 1.2em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: no-preference) {
  .build-status { transition: opacity 0.3s ease; }
  .build-status.swap { opacity: 0; }
}
.build-row .ic-go { color: var(--text-2); transition: transform 0.2s ease, color 0.2s ease; }
.build-row:hover .ic-go { color: var(--accent-text); transform: translate(2px, -2px); }

@media (max-width: 940px) {
  .builds-panel { margin-left: 0; }
}

/* ---------- Some of our work (photo cards, home) ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.work-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}
.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent-text) 35%, var(--line));
}

.work-card img {
  width: 100%;
  /* height:auto beats the img height attribute so aspect-ratio can apply */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.work-body { padding: 1.15rem 1.25rem 1.35rem; }
.work-body h3 { font-size: 1.25rem; font-weight: 650; }
.work-ind {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-text);
}
.work-body .work-line { margin-top: 0.55rem; color: var(--text-2); font-size: 0.9375rem; }
.work-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.95rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent-text);
}
.work-go .ic { transition: transform 0.2s ease; }
.work-card:hover .work-go .ic { transform: translate(2px, -2px); }

@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- Case index (home) ---------- */

.index-list { display: flex; flex-direction: column; }

.index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 2.5rem;
  align-items: center;
  padding: 1.9rem 0.25rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.index-row:last-child { border-bottom: 1px solid var(--line); }

.index-row h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 650;
  transition: color 0.2s ease;
}
.index-row p { margin-top: 0.45rem; color: var(--text-2); font-size: 1rem; max-width: 56ch; }

.index-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}
.index-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-text);
  font-weight: 600;
}
.index-go .ic { transition: transform 0.2s ease; }
.index-row:hover h3 { color: var(--accent-text); }
.index-row:hover .index-go .ic { transform: translate(2px, -2px); }

@media (max-width: 720px) {
  .index-row { grid-template-columns: 1fr; }
  .index-meta { order: -1; }
}

/* ---------- How we work (rectangles joined by connector lines) ---------- */

.steps {
  display: flex;
  align-items: stretch;
}
.step {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 1.4rem 1.5rem 1.55rem;
}
.step h3 { margin-top: 1rem; font-size: 1.1875rem; font-weight: 650; }
.step p { margin-top: 0.5rem; color: var(--text-2); font-size: 0.9375rem; }
.step p + p { margin-top: 0.65rem; }

.step-link {
  flex: none;
  align-self: center;
  width: clamp(1.25rem, 3vw, 3rem);
  height: 2px;
  background: var(--line);
}

@media (max-width: 860px) {
  .steps { flex-direction: column; }
  .step-link { width: 2px; height: 1.5rem; margin-left: 2.2rem; align-self: flex-start; }
}

/* Centered CTA under a section's content */
.section-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

/* ---------- Demo consoles (ads + books) ---------- */

.console-section { padding-block: clamp(1rem, 3vw, 2rem) clamp(4rem, 8vw, 7rem); }

.console {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-lg);
  max-width: 1080px;
  overflow: hidden;
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.console-head h3 { font-size: 1rem; font-weight: 650; }
.console-note { font-size: 0.8125rem; color: var(--text-2); }

.console-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }

.rule-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rule-chip {
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.8rem;
  background: var(--bg);
}

/* Ad variant cards */
.variants {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.variant {
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  padding: 0.7rem 0.8rem;
  background: var(--bg);
  transition: border-color 0.3s ease, opacity 0.3s ease;
}
.variant.is-winner { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.variant.is-paused { opacity: 0.55; }
.variant-name { font-size: 0.8125rem; font-weight: 650; display: block; }
.variant-hook { font-size: 0.8125rem; color: var(--text-2); display: block; margin-top: 0.15rem; min-height: 2.4em; }
.variant-stats {
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.variant-stats strong { color: var(--text); font-weight: 650; }
.variant-state {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 650;
  border-radius: var(--r-pill);
  padding: 0.22rem 0.6rem;
}
.variant-state.testing { background: var(--accent-soft); color: var(--accent-text); }
.variant-state.winner { background: var(--ok-soft); color: var(--ok); }
.variant-state.paused { background: var(--surface-2); color: var(--text-2); }
.variant-state.queued { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 720px) {
  .variants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Budget allocation: segmented 100% bar, no background track */
.alloc { display: flex; flex-direction: column; gap: 0.4rem; }
.alloc-label { font-size: 0.8125rem; font-weight: 550; color: var(--text-2); }
.alloc-bar {
  display: flex;
  height: 10px;
  border-radius: var(--r-pill);
  overflow: hidden;
  gap: 2px;
}
.alloc-seg { transition: flex-grow 0.8s cubic-bezier(0.16, 1, 0.3, 1); background: var(--accent); }
.alloc-seg.dim { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }

/* Feed rows (both consoles) */
.feed { display: flex; flex-direction: column; gap: 0.5rem; }

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-tile);
  background: var(--bg);
  border: 1px solid var(--line);
}
.feed-row .ic { width: 18px; height: 18px; margin-top: 2px; }
.feed-row.ok .ic { color: var(--ok); }
.feed-row.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--bg)); }
.feed-row.warn .ic { color: var(--warn); }
.feed-row.event { border-style: dashed; color: var(--text-2); }
.feed-row .amount { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.feed-main { flex: 1; min-width: 0; }
.feed-sub { display: block; color: var(--text-2); font-size: 0.8375rem; margin-top: 0.2rem; }
.feed-actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; }

/* Console rows reserve their space while hidden (visibility, not display),
   so the demo renders at its final size immediately and never resizes */
.console.is-animated [data-step] { visibility: hidden; opacity: 0; }
.console.is-animated [data-step].entering { visibility: visible; opacity: 0; transform: translateY(10px); }
.console.is-animated [data-step].shown {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Digest card (books console finale) */
.digest {
  border: 1.5px solid color-mix(in srgb, var(--accent-text) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  border-radius: var(--r-tile);
  padding: 0.85rem 1rem;
}
.digest-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  font-size: 0.9375rem;
  color: var(--accent-text);
}
.digest p { margin-top: 0.45rem; font-size: 0.9rem; color: var(--text); }

/* ---------- Next case strip ---------- */

.next-case { padding-block: 0 clamp(3rem, 6vw, 5rem); }
.next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s ease;
}
.next-link:hover { border-color: color-mix(in srgb, var(--accent-text) 45%, var(--line)); }
.next-link small { display: block; font-size: 0.8125rem; color: var(--text-2); font-weight: 550; }
.next-link strong { display: block; font-size: 1.1875rem; font-weight: 650; margin-top: 0.2rem; }
.next-link .ic { color: var(--accent-text); }

/* ---------- Footer case links ---------- */

.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-left: auto; }
.footer-nav a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.footer-nav a:hover { color: var(--accent-text); }

/* ---------- Scroll reveal ---------- */


@media (prefers-reduced-motion: reduce) {
  .phone.is-animated [data-step],
  .console.is-animated [data-step] { opacity: 1; transform: none; transition: none; }
  .alloc-seg { transition: none; }
}
