/* ==========================================================================
   Thematica AI — Design Tokens
   Redesign v2: warm ivory + deep ink + rich teal, restrained secondary
   hues for codes/themes. Fraunces (display) paired with Plus Jakarta Sans
   (body/UI). All text pairings re-verified against WCAG AAA (7:1) where
   previously held; secondary code colors verified at AA (4.5:1)+.
   ========================================================================== */

:root {
  /* Color — structural (ink replaces the old navy as the "primary" role) */
  --color-primary: #221F1A;
  --color-primary-hover: #141210;
  --color-primary-contrast: #FFFFFF;

  /* Rich teal accent — 7.33:1 as text-on-ivory, 7.90:1 as white-on-fill */
  --color-accent: #0A5C50;
  --color-accent-hover: #073F37;
  --color-accent-contrast: #FFFFFF;

  --color-background: #FAF6EE;
  --color-surface: #FFFFFF;
  --color-foreground: #221F1A;
  --color-muted: #F1EADC;
  --color-muted-foreground: #4F4A40;
  --color-border: #E7DFD0;

  /* Restrained secondary palette for code/theme tags — desaturated,
     warm-harmonized, each verified >=4.5:1 on ivory as text */
  --color-code-clay: #9C4A2E;
  --color-code-ochre: #7A5A14;
  --color-code-slate: #44566B;
  --color-code-sage: #3F5C3C;

  --color-success: #15803D;
  --color-success-bg: #ECFDF3;
  --color-destructive: #B91C1C;
  --color-destructive-bg: #FEF2F2;

  --color-ring: var(--color-accent);

  /* Typography — Fraunces for selected display headlines, Plus Jakarta
     Sans everywhere else (UI chrome, body copy, card/component text) */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.75rem;
  --fs-4xl: 3.5rem;
  --lh-tight: 1.2;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* Spacing (standard density, 8px rhythm) */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;
  --space-9: 8rem;

  /* Layout */
  --container-max: 72rem;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Motion */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.10), 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}
/* Fraunces on the two display-weight levels only (hero, section heads) —
   h3/h4 (card titles, component headings) stay in Jakarta Sans for
   legibility at small sizes, per "selected headlines" in the brief. */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
}
/* Fluid clamps instead of a single breakpoint jump: scales smoothly from
   phone to desktop so there's no awkward snap at exactly 640px, and gives
   small phones a meaningfully smaller headline instead of just "slightly
   smaller" — see mobile pass notes on hero height. */
h1 { font-size: clamp(1.75rem, 1.1rem + 3.2vw, var(--fs-4xl)); }
h2 { font-size: clamp(1.5rem, 1.05rem + 2.3vw, var(--fs-3xl)); }
h3 { font-size: var(--fs-xl); }
p { margin: 0 0 var(--space-3); color: var(--color-muted-foreground); }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

section { padding-block: var(--space-8); }
@media (max-width: 640px) {
  section { padding-block: var(--space-7); }
}
@media (max-width: 374px) {
  .container { padding-inline: 20px; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Focus visibility (never remove) */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-3);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--duration-base) var(--ease-standard);
}
.skip-link:focus { top: var(--space-3); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-background) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

/* So an anchor jump (e.g. "Explore the workflow") lands below the sticky
   header instead of right behind it. ~73px measured header height + gap. */
#workflow, #waitlist, #faq {
  scroll-margin-top: 88px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--color-primary);
  cursor: pointer;
}
.brand .brand-mark { width: 32px; height: 32px; flex-shrink: 0; }

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-muted-foreground);
  padding: var(--space-1) 0;
  position: relative;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-standard);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-primary); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

/* Sliding indicator (JS-positioned) replaces the static underline above once active */
.nav-indicator {
  position: absolute;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
              width 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 200ms ease;
}
.nav-links.has-indicator a[aria-current="page"]::after { display: none; }
@media (max-width: 860px) {
  .nav-indicator { display: none; }
}

.nav-cta { display: flex; align-items: center; gap: var(--space-3); }

/* The one real CTA lives in the header at every width down to 480px.
   Below that it relocates into the mobile menu instead of ever showing
   twice — see the two media queries below. */
.nav-links .mobile-cta { display: none; }
/* .nav-links a {color: muted-foreground} otherwise wins over .btn-primary's
   white text — same specificity count, but this rule is declared later. */
.nav-links a.mobile-cta.btn-primary {
  color: var(--color-accent-contrast);
  justify-content: center;
}
.nav-links a.mobile-cta.btn-primary:hover { color: var(--color-accent-contrast); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-primary);
}
.nav-toggle:hover { background: var(--color-muted); }

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 64px var(--space-4) auto var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2);
    transform-origin: top;
    transform: scaleY(0.96) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
  }
  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1) translateY(0);
  }
  .nav-links a {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
  }
  .nav-links a:hover { background: var(--color-muted); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 480px) {
  .nav-cta .btn-primary { display: none; }
  .nav-links .mobile-cta {
    display: flex;
    margin: var(--space-3) var(--space-2) var(--space-2);
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 220ms var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard);
  min-height: 44px;
  touch-action: manipulation;
}
/* Only used as a CSS fallback when JS press/magnetic handling isn't active */
.btn:active { transform: scale(0.97); }

/* Soft directional sheen — a single considered sweep on hover, not a loop.
   z-index: -1 keeps it behind the button's own (unwrapped) text node: inline
   text in normal flow paints before positioned descendants at z-index >= 0,
   so without this the sweep would briefly wash out the label. `isolation:
   isolate` above scopes the negative z-index to this button, not the page. */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    color-mix(in srgb, currentColor 22%, transparent) 50%,
    transparent 70%);
  transform: translateX(-130%);
  transition: transform 550ms cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
  z-index: -1;
}
.btn:hover::after { transform: translateX(130%); }
.btn > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn::after { display: none; }
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-accent-hover); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-muted); border-color: var(--color-primary); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-muted); }

.btn-block { width: 100%; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  /* Less bottom padding than the old --space-8: the brief flagged the gap
     to the first content section as too large. Sections below opt into
     .section-tight for reduced top padding so the two meet in the middle
     rather than stacking two full paddings. */
  padding-block: var(--space-9) var(--space-6);
  overflow: hidden;
}
@media (max-width: 640px) {
  /* .hero's own padding-block above beats the generic mobile `section`
     rule (class vs element specificity) regardless of media query order,
     so it needs its own override — otherwise mobile keeps the desktop
     128px top padding, which (combined with the old fixed h1 size) was
     pushing the product preview to ~950px down on a 700px-tall viewport. */
  .hero { padding-block: var(--space-6) var(--space-4); }
}
section.section-tight { padding-top: var(--space-5); }
.hero-motif {
  position: absolute;
  inset: -10% -5% auto auto;
  width: min(60%, 640px);
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
  mask-image: linear-gradient(to left, black 35%, transparent 85%);
  -webkit-mask-image: linear-gradient(to left, black 35%, transparent 85%);
}
.hero-motif svg { width: 100%; height: auto; }
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 9%, var(--color-background));
  border: 1px solid color-mix(in srgb, var(--color-accent) 28%, transparent);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.hero h1 { color: var(--color-primary); }
.hero-lede {
  font-size: var(--fs-lg);
  color: var(--color-muted-foreground);
  margin-bottom: var(--space-5);
  max-width: 38rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.hero-note {
  font-size: var(--fs-xs);
  color: var(--color-muted-foreground);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  /* Asymmetric, visual-forward: the preview carries more weight than the
     copy column, per "substantial product preview" in the brief. */
  grid-template-columns: 0.95fr 1.15fr;
  gap: var(--space-7);
  align-items: center;
}
.hero-grid .hero-inner { max-width: none; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---- Illustrative app-window mockup ---- */
.hero-visual {
  position: relative;
  isolation: isolate;
}
/* A second, receded card peeking out behind the main window — cheap depth
   cue that reads as "a real application with more behind it," not just a
   single flat screenshot. */
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 20px -14px -18px 14px;
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  z-index: -1;
}
.app-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  background: var(--color-surface);
}
.app-window-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}
.app-window-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-border); }
.app-window-title {
  margin-left: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-muted-foreground);
}
.app-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
}
.app-transcript {
  /* Raw data gets its own typeface (IBM Plex Mono) distinct from the
     Plus Jakarta Sans UI chrome around it — a small but real signal that
     this is source material, not interface copy. */
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  padding: var(--space-4);
  font-size: 0.92rem;
  line-height: var(--lh-relaxed);
  color: var(--color-muted-foreground);
  border-right: 1px solid var(--color-border);
}
.app-transcript .excerpt {
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-foreground);
  border-radius: 4px;
  padding: 0.05em 0.15em;
  box-shadow: inset 0 -1.5px 0 var(--color-accent);
  transition: background 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard);
  cursor: default;
}
/* Hovering/focusing a suggested code highlights its source excerpt —
   a small, honest demonstration of "connection to source material"
   inside the mockup already labeled as illustrative, not a real feature. */
.app-transcript .excerpt.is-linked {
  background: color-mix(in srgb, var(--color-accent) 32%, transparent);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}
.app-codes {
  padding: var(--space-4);
  background: var(--color-background);
}
.app-codes-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted-foreground);
  margin-bottom: var(--space-2);
}
.code-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-2);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-1);
  color: var(--color-foreground);
  cursor: pointer;
  transition: border-color 220ms var(--ease-standard), background 220ms var(--ease-standard), transform 220ms var(--ease-standard);
}
.code-chip:hover, .code-chip:focus-visible {
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
  transform: translateX(2px);
}
.code-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.code-chip .count { color: var(--color-muted-foreground); font-weight: 500; }
.app-codes .ai-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.app-codes .ai-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: ai-tag-pulse 2.4s ease-in-out infinite;
}
@keyframes ai-tag-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@media (max-width: 560px) {
  .app-body { grid-template-columns: 1fr; }
  .app-transcript { border-right: none; border-bottom: 1px solid var(--color-border); }
}

/* ==========================================================================
   Sections / Cards
   ========================================================================== */

.section-head {
  max-width: 40rem;
  margin: 0 auto var(--space-7);
  text-align: center;
}
.section-head h2 { color: var(--color-primary); }
.section-head .eyebrow { margin-bottom: var(--space-3); }

.alt-surface { background: var(--color-surface); border-block: 1px solid var(--color-border); }

.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: color-mix(in srgb, var(--color-accent) 30%, var(--color-border)); }

/* Cursor-tracked spotlight — JS sets --mx/--my on mousemove; CSS-only fallback (centered) if JS never runs */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--color-accent) 9%, transparent),
    transparent 72%);
  opacity: 0;
  transition: opacity 300ms var(--ease-standard);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .card::before { display: none; }
}

.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--color-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background var(--duration-base) var(--ease-standard), color var(--duration-base) var(--ease-standard);
}
.card-icon svg { width: 22px; height: 22px; }
.card:hover .card-icon {
  transform: scale(1.08) rotate(-4deg);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

.card h3 { color: var(--color-foreground); margin-bottom: var(--space-2); }

.badge-soon {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-muted);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.6rem;
  margin-left: var(--space-1);
  vertical-align: middle;
}

/* ==========================================================================
   Principle banner
   ========================================================================== */

.principle {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  gap: var(--space-5);
  align-items: center;
}
.principle p { color: rgba(255,255,255,0.86); margin: 0; }
.principle h3 { color: #fff; margin-bottom: var(--space-2); }
.principle-icon { width: 48px; height: 48px; flex-shrink: 0; color: var(--color-accent); }
@media (max-width: 640px) {
  .principle { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Workflow showcase — varied compositions instead of a repeated grid:
   a big panel + a small panel, then alternating text/visual rows, then a
   light-touch pair for the two smaller, more modest claims.
   ========================================================================== */

.showcase-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
  margin-bottom: var(--space-7);
}
@media (max-width: 880px) {
  .showcase-row { grid-template-columns: 1fr; }
}

.showcase-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}
.showcase-panel h3 {
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.05rem + 1.6vw, var(--fs-2xl));
  font-weight: 600;
}
.showcase-panel .eyebrow { margin-bottom: var(--space-3); }

/* Small "researcher review controls" panel — a short checklist-style UI */
.review-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.review-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-foreground);
}
.review-list .review-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
}
.review-list .review-icon svg { width: 13px; height: 13px; }
.review-list strong { display: block; }
.review-list span.detail { color: var(--color-muted-foreground); font-size: var(--fs-xs); }

/* Alternating text + illustration rows */
.feature-alt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
  margin-bottom: var(--space-7);
}
.feature-alt-row.is-reversed .feature-alt-visual { order: 2; }
.feature-alt-row.is-reversed .feature-alt-text { order: 1; }
@media (max-width: 880px) {
  .feature-alt-row, .feature-alt-row.is-reversed { grid-template-columns: 1fr; }
  .feature-alt-row.is-reversed .feature-alt-visual,
  .feature-alt-row.is-reversed .feature-alt-text { order: unset; }
}
.feature-alt-text h3 { font-size: clamp(1.375rem, 1.05rem + 1.6vw, var(--fs-2xl)); font-family: var(--font-display); font-weight: 600; color: var(--color-foreground); }
.feature-illustration {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.feature-illustration svg { width: 100%; height: auto; max-width: 320px; }

/* Light-touch pair for the two more modest claims */
.feature-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 640px) {
  .feature-pair { grid-template-columns: 1fr; }
}
.feature-pair-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.feature-pair-item .card-icon { margin-bottom: 0; }
.feature-pair-item h4 { color: var(--color-foreground); margin-bottom: var(--space-1); font-size: var(--fs-base); }
.feature-pair-item p { font-size: var(--fs-sm); }

/* ==========================================================================
   Product-status strip — a quiet, scannable alternative to a loud banner
   ========================================================================== */

.status-strip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.status-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.status-strip-head h3 { margin: 0; color: var(--color-foreground); }
.status-strip-head a { font-size: var(--fs-sm); font-weight: 700; color: var(--color-accent); }
.status-strip-head a:hover { text-decoration: underline; }
.status-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 820px) {
  /* 820, not 760: at exactly 768px (a common tablet width) every other
     multi-column section on the page has already stacked — leaving this
     one at 3 cramped columns reads as an inconsistent, unfinished layout. */
  .status-list { grid-template-columns: 1fr; }
}
.status-list li {
  font-size: var(--fs-sm);
  color: var(--color-muted-foreground);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border);
}
.status-list strong { display: block; color: var(--color-foreground); font-size: var(--fs-sm); margin-bottom: 2px; }

/* ==========================================================================
   Audience — a simple divided list instead of three identical cards
   ========================================================================== */

.audience-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 820px) {
  .audience-list { grid-template-columns: 1fr; gap: var(--space-5); }
}
.audience-item {
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-accent);
}
.audience-item h3 { font-size: var(--fs-lg); color: var(--color-foreground); margin-bottom: var(--space-2); }
.audience-item p { font-size: var(--fs-sm); }

/* ==========================================================================
   Mockup frame (labeled illustrative visuals)
   ========================================================================== */

.mockup {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mockup-caption {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--color-muted-foreground);
  margin-top: var(--space-2);
  font-style: italic;
}

/* ==========================================================================
   Waitlist form
   ========================================================================== */

.waitlist {
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  color: #fff;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.waitlist h2 { color: #fff; }
.waitlist .section-head p { color: rgba(255,255,255,0.8); }
.waitlist .section-head { color: #fff; }
.waitlist-motif {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  max-width: 420px;
  height: auto;
  z-index: -1;
  pointer-events: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  max-width: 40rem;
  margin: 0 auto;
}
.form-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: rgba(255,255,255,0.9);
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: inherit;
  /* Hard 16px, not the --fs-sm token (15px): iOS Safari auto-zooms on
     focus for any input font-size under 16px, which is jarring on a form. */
  font-size: 16px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  min-height: 44px;
  transition: background 220ms var(--ease-standard), border-color 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,0.45); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 5px rgba(255,255,255,0.10);
}
.field-error {
  color: #FCA5A5;
  font-size: var(--fs-xs);
  margin-top: var(--space-1);
  display: none;
}
.field.has-error input, .field.has-error select { border-color: #FCA5A5; }
.field.has-error .field-error { display: block; }
.field.has-error .consent { color: #FCA5A5; }
.field.has-error .consent input { outline: 1.5px solid #FCA5A5; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.75);
  transition: color 220ms var(--ease-standard);
  /* The whole row is the real tap target (it's a <label>, so tapping the
     text toggles the box too) — pad it out for a comfortable >=44px hit
     area without inflating the visible 22px checkbox itself. */
  padding-block: 7px;
  cursor: pointer;
}
.consent a { text-decoration: underline; color: #fff; }

/* Custom checkbox: native input kept for a11y/keyboard/AT, visuals replaced.
   The check mark pops in with a slight overshoot (back-out) rather than a flat fade. */
.consent input[type="checkbox"] {
  /* Explicitly reset everything .field input sets (padding, min-height,
     width:100%) — that rule also matches this element since it's an
     <input> inside a .field wrapper, and its 0.8rem/1rem padding plus
     44px min-height were silently inflating this 20px box to ~35x44. */
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  margin-top: 2px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}
.consent input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 11px;
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 45% 68%);
  transform: scale(0);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.consent input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.consent input[type="checkbox"]:checked::before { transform: scale(1); }
.consent input[type="checkbox"]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .consent input[type="checkbox"]::before { transition: none; }
}

.form-actions { text-align: center; margin-top: var(--space-2); }
.form-status { text-align: center; margin-top: var(--space-3); font-size: var(--fs-sm); min-height: 1.2em; }
.form-status[data-state="success"] { color: #BBF7D0; }
.form-status[data-state="error"] { color: #FCA5A5; }

.waitlist-success {
  text-align: center;
  padding: var(--space-5) 0;
}
.waitlist-success .check-circle {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-3);
  color: #BBF7D0;
}
/* Stroke-draw animation for the success check: JS sets each path's dash
   length via getTotalLength() and toggles .is-drawn to animate it in. */
.check-circle circle, .check-circle path {
  stroke-dasharray: var(--dash-len, 0);
  stroke-dashoffset: var(--dash-len, 0);
  transition: stroke-dashoffset 650ms var(--ease-standard);
}
.check-circle circle { transition-delay: 0ms; }
.check-circle path { transition-delay: 300ms; }
.check-circle.is-drawn circle,
.check-circle.is-drawn path {
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .check-circle circle, .check-circle path {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    transition: none;
  }
}
.hidden { display: none !important; }

/* honeypot — hidden from sighted users and screen readers, kept out of tab order */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-4);
}
.faq-item:first-child { border-top: 1px solid var(--color-border); }
.faq-q {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-foreground);
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.faq-q .chev { width: 20px; height: 20px; color: var(--color-muted-foreground); transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1); flex-shrink: 0; }
.faq-item[data-open="true"] .chev { transform: rotate(180deg); }

/* grid-rows 0fr/1fr trick: animates to the content's real height, however
   long it is, instead of guessing a fixed max-height that can clip text. */
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-standard);
}
.faq-a > p { overflow: hidden; min-height: 0; }
.faq-item[data-open="true"] .faq-a { grid-template-rows: 1fr; }
.faq-a p { padding-top: var(--space-2); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6);
  background: var(--color-surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; color: var(--color-primary); margin-bottom: var(--space-2); }
.footer-brand .brand-mark { width: 26px; height: 26px; }
.footer-col h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted-foreground); margin-bottom: var(--space-2); }
.footer-col a, .footer-col p { display: block; font-size: var(--fs-sm); color: var(--color-muted-foreground); margin-bottom: var(--space-2); cursor: pointer; }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-muted-foreground);
}

/* ==========================================================================
   Page header (inner pages)
   ========================================================================== */

.page-hero {
  padding-block: var(--space-8) var(--space-6);
  text-align: center;
}
.page-hero .eyebrow { margin-bottom: var(--space-3); }
.page-hero h1 { color: var(--color-primary); }
.page-hero p { max-width: 42rem; margin-inline: auto; font-size: var(--fs-lg); }

.prose { max-width: 42rem; margin-inline: auto; }
.prose h2 { color: var(--color-primary); margin-top: var(--space-6); }
.prose ul { color: var(--color-muted-foreground); padding-left: 1.2em; }
.prose li { margin-bottom: var(--space-2); }

.founder {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  align-items: start;
  max-width: 48rem;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .founder { grid-template-columns: 1fr; }
}
.founder-portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  overflow: hidden;
}
.founder-portrait img { width: 100%; height: 100%; object-fit: cover; }
.founder-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: var(--space-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--color-accent);
  border-radius: var(--radius-sm);
}
.founder-link svg { flex-shrink: 0; }
.founder-link span { border-bottom: 1.5px solid transparent; transition: border-color 220ms var(--ease-standard); }
.founder-link:hover span { border-bottom-color: currentColor; }

@media (max-width: 640px) {
  /* Full-width square on a phone pushes the bio a whole screen down. */
  .founder-portrait { max-width: 280px; }
}

/* Reveal base state (GSAP targets this; JS removes if reduced-motion/no-JS) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; }

/* ==========================================================================
   Page-leave transition
   A soft fade over the moment of leaving a page, not a loading curtain on
   arrival — kept to opacity only so it reads as polish, not a delay.
   ========================================================================== */

.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-background);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.page-transition-overlay.is-active { opacity: 1; }
