/* ============================================
   OTPless - Design System
   Inspired by Resend's editorial precision
   ============================================ */

/* Fonts loaded via <link> in HTML head for better performance.
   See <link rel="preload" as="style"> pattern in each page's <head>. */

:root, [data-theme="dark"] {
  /* Core */
  --black: #000000;
  --white: #FDFDFD;
  --bg: #000000;
  --bg-elev: #0A0A0A;
  --bg-elev-2: #121212;

  /* Grays (Radix-inspired, dark) */
  --g1: #0A0A0A;
  --g2: #111111;
  --g3: #161616;
  --g4: #1C1C1C;
  --g5: #232323;
  --g6: #2E2E2E;
  --g7: #3A3A3A;
  --g8: #595959;   /* 3.5:1 - large text or decorative only */
  --g9: #7A7A7A;   /* 4.6:1 - passes WCAG AA normal text */
  --g10: #8A8A8A;  /* 5.6:1 - passes AA */
  --g11: #B4B4B4;
  --g12: #EEEEEE;

  /* Semantic text tokens (use these in components, not --white directly) */
  --text: #FDFDFD;          /* primary body text */
  --text-strong: #FFFFFF;   /* headlines */
  --on-primary: #000000;    /* text on primary button */
  --on-accent: #06231A;     /* dark ink on bright mint accent — contrast ~12:1 */

  /* Surface helpers (theme-aware replacements for hardcoded rgba(255,255,255,…)) */
  --surface-1: rgba(255, 255, 255, 0.02);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.06);
  --surface-4: rgba(255, 255, 255, 0.08);
  --hairline: rgba(255, 255, 255, 0.06);

  /* Signature accent - electric green (SNA "live signal") */
  --accent: #00E58F;
  --accent-soft: #00E58F22;
  --accent-glow: #00E58F44;

  /* Functional */
  --blue: #4A9EFF;
  --amber: #FFB020;
  --red: #FF5454;

  /* Type */
  --font-display: 'Instrument Serif', 'Lora', 'Times New Roman', 'Times', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'CommitMono', ui-monospace, 'SF Mono', monospace;

  /* Spacing & rhythm */
  --max-w: 1200px;
  --max-w-narrow: 880px;
  --pad-x: clamp(20px, 5vw, 48px);

  /* Borders */
  --border: 1px solid rgba(255, 255, 255, 0.08);
  --border-strong: 1px solid rgba(255, 255, 255, 0.14);

  /* Theme-specific assets */
  --logo-full: url("/assets/otpless-logo-full-white-240.png");
  --hero-glow-color: #00E58F22;
  --grain-opacity: 0.035;

  /* Headline gradient — bright on dark */
  --gradient-text-from: #FFFFFF;
  --gradient-text-to: #B4B4B4;

  /* Elevated panel gradient (demo shells, CTA banners, code blocks) */
  --panel-bg-from: #0a0a0a;
  --panel-bg-to: #050505;
  --panel-bg-deep: #050505;        /* solid for code blocks */
  --panel-glow: rgba(0, 229, 143, 0.08);

  --overlay-bg: rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}

/* ============================================
   LIGHT THEME — editorial paper
   Warm off-white, deep ink, deep forest accent.
   Same brand DNA, translated to ink-on-paper.
   ============================================ */
[data-theme="light"] {
  --black: #0E0E0C;
  --white: #F8F6F1;
  --bg: #F8F6F1;
  --bg-elev: #FBFAF6;
  --bg-elev-2: #FFFFFF;

  /* Inverted ramp — tuned for warm paper, not pure inversion */
  --g1: #FBFAF6;
  --g2: #F4F2EC;
  --g3: #ECEAE3;
  --g4: #E2DFD7;
  --g5: #D4D1C7;
  --g6: #B8B4A8;
  --g7: #8E8A7E;
  --g8: #6E6A60;
  --g9: #545048;
  --g10: #3F3C36;
  --g11: #2A2824;
  --g12: #161510;

  /* Semantic text */
  --text: #161510;          /* primary text — full ink */
  --text-strong: #0E0E0C;   /* headlines */
  --on-primary: #F8F6F1;    /* text on primary button */
  --on-accent: #FFFFFF;     /* text on green accent fills — keep light for contrast */

  /* Surface helpers — ink at low alpha */
  --surface-1: rgba(14, 14, 12, 0.02);
  --surface-2: rgba(14, 14, 12, 0.04);
  --surface-3: rgba(14, 14, 12, 0.06);
  --surface-4: rgba(14, 14, 12, 0.08);
  --hairline: rgba(14, 14, 12, 0.06);

  /* Accent — deep forest green. Holds AAA contrast on warm paper. */
  --accent: #1F6B47;
  --accent-soft: #1F6B4715;
  --accent-glow: #1F6B4730;

  /* Functional — re-tuned for white */
  --blue: #1B5FCC;
  --amber: #B47200;
  --red: #C0322B;

  /* Borders — ink at low alpha */
  --border: 1px solid rgba(14, 14, 12, 0.08);
  --border-strong: 1px solid rgba(14, 14, 12, 0.16);

  /* Light-theme assets */
  --logo-full: url("/assets/otpless-logo-full-240.png");
  --hero-glow-color: transparent;   /* drop the glow on light */
  --grain-opacity: 0.020;

  /* Headline gradient — deep ink fading to softer ink, readable on cream */
  --gradient-text-from: #0E0E0C;
  --gradient-text-to: #545048;

  /* Elevated panel gradient — warm whites layered on cream */
  --panel-bg-from: #FFFFFF;
  --panel-bg-to: #FBFAF6;
  --panel-bg-deep: #FFFFFF;        /* solid for code blocks */
  --panel-glow: rgba(31, 107, 71, 0.06);   /* deep forest accent at low alpha */

  --overlay-bg: #F8F6F1;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  /* 16px on mobile (WCAG-friendly), scales up to 17px on wider viewports */
  font-size: clamp(16px, 1.1vw + 13px, 17px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  scroll-behavior: smooth;
}

/* Reduced-motion guard: kill non-essential animations + transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .eyebrow .dot,
  .ping::before,
  .ping::after,
  .phone-sweep,
  .cascade-row.verifying::after { animation: none !important; }
}

/* ===== Sticky floating CTA (appears after 400px scroll) ===== */
.sticky-cta {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 60;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sticky-cta.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sticky-cta .btn {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 143, 0.25), 0 0 24px rgba(0, 229, 143, 0.18);
  backdrop-filter: blur(8px);
}
@media (max-width: 760px) {
  .sticky-cta { right: 12px; bottom: 12px; }
  .sticky-cta .btn { padding: 10px 14px; font-size: 13px; }
}

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

/* Subtle grain overlay (Resend texture) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Type system ===== */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g10);
  font-weight: 400;
}

.eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
}

.h-hero {
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
}

.h-section {
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.h-card {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
}

p { margin: 0; text-wrap: pretty; }

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--g11);
  max-width: 56ch;
}

.muted { color: var(--g10); }
.dim { color: var(--g9); }

.gradient-text {
  background: linear-gradient(180deg, var(--gradient-text-from, #FFFFFF) 0%, var(--gradient-text-to, #B4B4B4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.accent-text { color: var(--accent); }

/* ===== Layout ===== */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  position: relative;
  z-index: 2;
}

.container-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

section { position: relative; z-index: 2; }

.section-pad { padding: clamp(80px, 12vh, 140px) 0; }
.section-pad-sm { padding: clamp(56px, 8vh, 96px) 0; }

.divider {
  border: none;
  height: 1px;
  background: var(--surface-4);
  margin: 0;
}

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

/* Reserve header height before layout.js mounts the nav, so the
   page doesn't flash an empty top band on every navigation. */
[data-otpless-header] {
  display: block;
  height: 64px;
  border-bottom: var(--border);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
[data-theme="light"] [data-otpless-header] {
  background: rgba(248, 246, 241, 0.7);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(0, 0, 0, 0.6);
  border-bottom: var(--border);
  transition: transform 0.28s cubic-bezier(.2, .7, .2, 1), background 0.2s ease;
  will-change: transform;
}
.nav.nav-hidden {
  transform: translateY(-100%);
}
@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
  .nav.nav-hidden { transform: none; }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.logo img { height: 30px; width: auto; display: block; }
/* .logo::after green dot removed */
.footer .logo img { height: 24px; }

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

.nav-links a {
  color: var(--g11);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text-strong); }
.nav-links a.is-active { color: var(--text-strong); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a { white-space: nowrap; }
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-left { gap: 0; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--text-strong);
  color: var(--on-primary);
  border-color: var(--text-strong);
}

.btn-primary:hover {
  background: var(--g12);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--surface-4);
}

.btn-text {
  background: transparent;
  color: var(--g11);
  padding: 6px 0;
  border: none;
}

.btn-text:hover { color: var(--text-strong); }

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }

.arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ===== Cards / surfaces ===== */

.card {
  background: var(--g2);
  border: var(--border);
  border-radius: 12px;
  padding: 28px;
}

.surface {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: var(--border);
  border-radius: 16px;
}

/* ===== Code block ===== */

.code-block {
  background: var(--panel-bg-deep);
  border: var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--g11);
  overflow-x: auto;
}

.code-block .kw { color: #C586C0; }
.code-block .str { color: #CE9178; }
.code-block .fn { color: #DCDCAA; }
.code-block .com { color: var(--g8); font-style: italic; }
.code-block .var { color: #9CDCFE; }
.code-block .num { color: #B5CEA8; }

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

.footer {
  border-top: var(--border);
  padding: 64px 0 48px;
  margin-top: 80px;
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

.footer h4 {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--g10);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer-links a {
  color: var(--g11);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text-strong); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: var(--border);
  font-size: 13px;
  color: var(--g10);
}
.footer-legal {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-legal a {
  color: var(--g10);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-legal a:hover { color: var(--text-strong); }

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

.hero {
  padding: clamp(80px, 14vh, 160px) 0 clamp(60px, 10vh, 120px);
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 700px;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
  filter: blur(40px);
  z-index: 1;
  opacity: 0.6;
}

/* ===== Misc utility ===== */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-12 { gap: 48px; }

.center { text-align: center; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--g11);
}

.tag-accent {
  background: var(--accent-soft);
  border-color: rgba(0, 229, 143, 0.25);
  color: var(--accent);
}

/* Live ping */
.ping {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
}
.ping::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
}
.ping::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--g5); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--g7); }

/* Selection */
::selection { background: var(--accent); color: var(--on-accent); }

/* Skip link - accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 8px;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Visually hidden - accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Stronger focus state for all interactive elements */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ping::after { animation: none !important; }
}


/* =============================================================
   CONTACT FORM (used by contact)
   Originally Talk-to-sales chrome - modal removed, form retained.
   ============================================================= */
.tts-form { display: flex; flex-direction: column; gap: 14px; }

.tts-row { display: grid; gap: 14px; }
.tts-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .tts-row-2 { grid-template-columns: 1fr; } }

.tts-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.tts-field > span {
  font-size: 12px;
  color: var(--g11);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.tts-field .tts-opt {
  color: var(--g9);
  font-weight: 400;
  font-size: 11px;
}
.tts-field input,
.tts-field select,
.tts-field textarea {
  width: 100%;
  background: var(--g2);
  border: 1px solid var(--g5);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tts-field input::placeholder,
.tts-field textarea::placeholder { color: var(--g8); }
.tts-field input:hover,
.tts-field select:hover,
.tts-field textarea:hover { border-color: var(--g7); }
.tts-field input:focus,
.tts-field select:focus,
.tts-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--g3);
  box-shadow: 0 0 0 3px rgba(0,229,143,0.15);
}
.tts-field textarea { resize: vertical; min-height: 84px; }
.tts-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238A8A8A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.tts-field [aria-invalid="true"] {
  border-color: var(--red);
  background: rgba(255, 84, 84, 0.04);
}
.tts-field [aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 84, 84, 0.15);
}
.tts-field em[data-err],
.tts-check em[data-err] {
  font-style: normal;
  font-size: 11.5px;
  color: var(--red);
  min-height: 0;
}
.tts-field em[data-err]:empty,
.tts-check em[data-err]:empty { display: none; }

.tts-callout[hidden] { display: none !important; }
.tts-callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel-glow);
  border: 1px solid rgba(0,229,143,0.25);
  border-radius: 10px;
  font-size: 13px;
  color: var(--g12);
  line-height: 1.5;
  align-items: flex-start;
}
.tts-callout .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  margin-top: 6px;
  flex-shrink: 0;
}
.tts-callout b { color: var(--text-strong); font-weight: 500; }

.tts-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--g11);
  line-height: 1.5;
  padding: 4px 0;
  cursor: pointer;
}
.tts-check input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.tts-check a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.tts-check em[data-err] { grid-column: 2; margin-top: 2px; }

/* honeypot */
.tts-hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.tts-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.tts-submit {
  position: relative;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tts-submit:disabled { opacity: 0.7; cursor: not-allowed; }
.tts-submit--success { background: var(--accent) !important; color: var(--on-accent) !important; border-color: var(--accent) !important; opacity: 1 !important; }
.tts-submit-loader[hidden] { display: none !important; }
.tts-submit-label[hidden] { display: none !important; }
.tts-submit-loader { display: inline-flex; }
.tts-reply { font-size: 12px; color: var(--g10); }
.tts-reply a { color: var(--g12); text-decoration: underline; text-underline-offset: 2px; }

.tts-error {
  background: rgba(255, 84, 84, 0.08);
  border: 1px solid rgba(255, 84, 84, 0.3);
  color: #ff9b9b;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

/* ================== SUCCESS VIEW ================== */
.tts-success { padding: 8px 0; }
.tts-success-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(0,229,143,0.12);
  border: 1px solid rgba(0,229,143,0.4);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 20px;
}
.tts-success h3 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 500;
}
.tts-success-msg {
  color: var(--g11);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.55;
}
.tts-success-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  border: var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  margin: 0 0 24px;
}
.tts-success-meta div { display: flex; flex-direction: column; gap: 4px; }
.tts-success-meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--g9);
  margin: 0;
}
.tts-success-meta dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-strong);
}

.tts-next {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.tts-next-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--g11);
  line-height: 1.4;
}
.tts-next-step span {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--g11);
  flex-shrink: 0;
}

/* =============================================================
   LEGAL PAGES (privacy / terms)
   ============================================================= */
.legal-wrap {
  padding: clamp(80px, 12vh, 120px) 0 clamp(60px, 10vh, 100px);
  position: relative;
  overflow: hidden;
}
.legal-wrap .glow {
  position: absolute; top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 1100px; height: 500px;
  background: radial-gradient(ellipse at center, var(--panel-glow), transparent 60%);
  filter: blur(40px); pointer-events: none; z-index: 0;
}
.legal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  position: relative;
  z-index: 1;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 880px) {
  .legal-grid { grid-template-columns: 1fr; gap: 32px; }
}

.legal-toc {
  position: sticky;
  top: 24px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 12px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.legal-toc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--g9);
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: var(--border);
}
.legal-toc a {
  color: var(--g10);
  text-decoration: none;
  padding: 6px 0;
  line-height: 1.4;
  transition: color 0.15s;
  border-left: 1px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
}
.legal-toc a:hover { color: var(--text-strong); }
.legal-toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
}
@media (max-width: 880px) {
  .legal-toc { position: static; max-height: none; padding: 16px; border: var(--border); border-radius: 12px; background: var(--surface-1); }
}

.legal-content {
  max-width: 720px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--g11);
}
.legal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.legal-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.legal-content h1 {
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--text-strong);
}
.legal-content .legal-updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--g9);
  margin: 0 0 40px;
  padding-bottom: 32px;
  border-bottom: var(--border);
}
.legal-content h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--text-strong);
  margin: 56px 0 16px;
  scroll-margin-top: 24px;
}
.legal-content h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-strong);
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
}
.legal-content p { margin: 0 0 16px; }
.legal-content p strong { color: var(--text-strong); font-weight: 500; }
.legal-content ul, .legal-content ol {
  margin: 0 0 20px;
  padding-left: 22px;
}
.legal-content li { margin-bottom: 10px; }
.legal-content li::marker { color: var(--g8); }
.legal-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,229,143,0.4); }
.legal-content a:hover { text-decoration-color: var(--accent); }
.legal-callout {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--surface-1);
  border: var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--g11);
}
.legal-callout dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; }
.legal-callout dt { font-family: var(--font-mono); font-size: 11px; color: var(--g9); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.legal-callout dd { margin: 0; color: var(--text-strong); font-size: 13.5px; }

.legal-content .legal-uppercase {
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--g10);
  background: var(--surface-1);
  padding: 16px 20px;
  border: var(--border);
  border-radius: 10px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}


/* =============================================================
   COOKIE CONSENT
   ============================================================= */
.cc-banner-host { position: fixed; left: 24px; bottom: 24px; z-index: 9000; max-width: 420px; pointer-events: none; }
.cc-banner-host .cc-card {
  background: linear-gradient(180deg, var(--panel-bg-from), var(--panel-bg-to));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  color: var(--text-strong);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .24s ease, transform .24s cubic-bezier(.2,.7,.2,1);
}
.cc-banner-host.show .cc-card { opacity: 1; transform: translateY(0); }

.cc-card .cc-head h3 { font-size: 15px; margin: 0 0 6px; font-weight: 500; letter-spacing: -0.005em; }
.cc-card .cc-head p { font-size: 13px; line-height: 1.5; color: var(--g11); margin: 0 0 14px; }
.cc-card .cc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cc-card .cc-link { font-size: 11px; color: var(--g10); text-decoration: underline; text-underline-offset: 2px; }
.cc-card .cc-link:hover { color: var(--text-strong); }

.cc-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.cc-btn-primary { background: var(--accent); color: var(--on-accent); }
.cc-btn-primary:hover { background: #00ffa0; }
.cc-btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-strong); border-color: rgba(255,255,255,0.12); }
.cc-btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.cc-btn-ghost { background: transparent; color: var(--g11); }
.cc-btn-ghost:hover { color: var(--text-strong); background: rgba(255,255,255,0.04); }

/* ---------- Modal (Customize) ---------- */
body.cc-locked { overflow: hidden; }
.cc-modal-host { position: fixed; inset: 0; z-index: 9100; pointer-events: none; }
.cc-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: auto;
}
.cc-modal-host.show .cc-backdrop { opacity: 1; }

.cc-modal {
  position: fixed; inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transition: opacity .24s ease, transform .24s cubic-bezier(.2,.7,.2,1);
  pointer-events: auto;
}
.cc-modal-host.show .cc-modal { opacity: 1; transform: translateY(0) scale(1); }

.cc-modal-inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, var(--panel-bg-from), var(--panel-bg-to));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
@media (max-width: 560px) { .cc-modal-inner { padding: 28px 20px 22px; border-radius: 16px; } .cc-modal { padding: 12px; } }

.cc-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--g11);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s;
}
.cc-close:hover { background: rgba(255,255,255,0.08); color: var(--text-strong); }

.cc-modal h2 {
  font-size: 22px; letter-spacing: -0.015em; font-weight: 500;
  margin: 0 0 8px;
}
.cc-modal-sub { font-size: 13px; color: var(--g11); line-height: 1.55; margin: 0 0 20px; }

.cc-cat { padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.cc-cat:first-of-type { border-top: 1px solid rgba(255,255,255,0.06); }
.cc-cat-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cc-cat-row > div:first-child { flex: 1; }
.cc-cat-row h4 { font-size: 14px; font-weight: 500; margin: 0 0 4px; color: var(--text-strong); }
.cc-cat-row p { font-size: 12.5px; color: var(--g10); line-height: 1.5; margin: 0; }

.cc-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.cc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cc-toggle-track {
  width: 36px; height: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  transition: background .15s;
  position: relative;
}
.cc-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s cubic-bezier(.2,.7,.2,1);
}
.cc-toggle input:checked + .cc-toggle-track { background: var(--accent); }
.cc-toggle input:checked + .cc-toggle-track .cc-toggle-knob { transform: translateX(16px); background: var(--on-accent); }
.cc-toggle-locked { font-size: 11px; color: var(--g9); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 10px; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; }

.cc-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 14px; justify-content: flex-end; }
@media (max-width: 480px) { .cc-modal-actions { flex-direction: column-reverse; } .cc-modal-actions .cc-btn { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .cc-banner-host .cc-card,
  .cc-modal,
  .cc-backdrop,
  .cc-toggle-track,
  .cc-toggle-knob { transition: none !important; }
}


/* =============================================================
   COOKIE CONSENT - Light theme overrides
   The cc-* block uses hardcoded dark gradients. Override the
   surfaces/text wholesale for light mode.
   ============================================================= */
[data-theme="light"] .cc-banner-host .cc-card,
[data-theme="light"] .cc-modal-inner {
  background: linear-gradient(180deg, #FFFFFF, #FBFAF6);
  border-color: rgba(14, 14, 12, 0.10);
  box-shadow: 0 30px 80px rgba(14, 14, 12, 0.18), 0 0 0 1px rgba(14, 14, 12, 0.04);
  color: var(--text);
}
[data-theme="light"] .cc-card .cc-link:hover,
[data-theme="light"] .cc-btn-ghost:hover,
[data-theme="light"] .cc-close:hover,
[data-theme="light"] .cc-btn-secondary,
[data-theme="light"] .cc-cat-row h4 { color: var(--text-strong); }
[data-theme="light"] .cc-btn-secondary { background: var(--surface-2); border-color: var(--surface-4); }
[data-theme="light"] .cc-btn-secondary:hover { background: var(--surface-3); border-color: rgba(14,14,12,0.18); }
[data-theme="light"] .cc-btn-ghost:hover { background: var(--surface-2); }
[data-theme="light"] .cc-close { background: var(--surface-2); border-color: var(--surface-4); }
[data-theme="light"] .cc-close:hover { background: var(--surface-3); }
[data-theme="light"] .cc-cat,
[data-theme="light"] .cc-cat:first-of-type { border-top-color: rgba(14, 14, 12, 0.08); }
[data-theme="light"] .cc-toggle-track { background: rgba(14, 14, 12, 0.12); }
[data-theme="light"] .cc-toggle input:checked + .cc-toggle-track .cc-toggle-knob { background: var(--bg); }
[data-theme="light"] .cc-toggle-locked { border-color: var(--surface-4); }
[data-theme="light"] .cc-btn-primary { color: var(--on-accent); }
[data-theme="light"] .cc-btn-primary:hover { background: #178A57; }

/* =============================================================
   GLOBAL LIGHT THEME OVERRIDES
   For specific spots that can't be expressed by tokens alone.
   ============================================================= */
[data-theme="light"] .nav {
  background: rgba(248, 246, 241, 0.7);
}
[data-theme="light"] .nav-drawer {
  background: rgba(248, 246, 241, 0.96);
}
[data-theme="light"] .code-block {
  background: #FFFFFF;
  color: var(--g10);
}
[data-theme="light"] .code-block .kw { color: #8B2D8B; }
[data-theme="light"] .code-block .str { color: #A33914; }
[data-theme="light"] .code-block .fn { color: #6F5400; }
[data-theme="light"] .code-block .var { color: #1B5FCC; }
[data-theme="light"] .code-block .num { color: #2C7A1F; }
[data-theme="light"] .sticky-cta .btn {
  box-shadow: 0 14px 40px rgba(14, 14, 12, 0.18), 0 0 0 1px rgba(14, 14, 12, 0.06), 0 4px 12px rgba(14, 14, 12, 0.08);
}

/* =============================================================
   LIGHT-THEME SHADOW REPAIRS
   The dark theme uses heavy rgba(0,0,0,0.5–0.7) drop shadows and
   white inset highlights. On warm paper those read as muddy,
   smudgy halos and stray pale rings. Re-tune to soft ink shadows
   that match editorial paper depth.
   ============================================================= */

/* Phone bezel — home + silent-network-auth share the same DOM class.
   Replace dark drop shadow with layered ink shadow; remove inset
   white highlight (only readable on dark); keep dark inner bezel. */
[data-theme="light"] .phone {
  box-shadow:
    0 1px 2px rgba(14, 14, 12, 0.08),
    0 8px 20px rgba(14, 14, 12, 0.10),
    0 28px 60px -12px rgba(14, 14, 12, 0.22),
    0 0 0 9px #0d0d0f inset;
  border-color: rgba(14, 14, 12, 0.16);
}

/* Silent-network-auth phone uses a different inner ring + heavier shadow.
   Override fully so the cream var(--g3) ring doesn't appear inside the
   dark bezel. */
[data-theme="light"] .snauth-page .phone,
[data-theme="light"] .silent-network-auth .phone {
  box-shadow:
    0 1px 2px rgba(14, 14, 12, 0.08),
    0 12px 28px rgba(14, 14, 12, 0.10),
    0 40px 80px -16px rgba(14, 14, 12, 0.22),
    inset 0 0 0 6px #1a1a1d;
}

/* Phone keyboard slide-up: softer ink lift, not a black smudge. */
[data-theme="light"] .phone-keyboard,
[data-theme="light"] .phone .keyboard,
[data-theme="light"] .keyboard-overlay {
  box-shadow: 0 -6px 18px rgba(14, 14, 12, 0.08);
}

/* Hero demo step "active" glow — dark theme uses neon mint; on paper
   the deep-forest accent at lower alpha reads cleaner. */
[data-theme="light"] .demo-step.active .ix {
  box-shadow: 0 0 0 4px rgba(31, 107, 71, 0.12);
}

/* Cookie consent card + modal — dark drop shadow already overridden by
   the .cc-modal-inner rule above for the modal, but the banner card
   wasn't getting a softer shadow. Apply a paper-appropriate lift. */
[data-theme="light"] .cc-banner-host .cc-card,
[data-theme="light"] .cc-modal-inner {
  box-shadow:
    0 1px 2px rgba(14, 14, 12, 0.06),
    0 12px 32px rgba(14, 14, 12, 0.10),
    0 32px 64px -16px rgba(14, 14, 12, 0.18),
    0 0 0 1px rgba(14, 14, 12, 0.06);
}

/* Sparkly small dot glows (eyebrow dot, status pip, list bullets):
   --accent-glow in light theme is a faint forest tint — the existing
   `0 0 8px var(--accent-glow)` reads as almost nothing. Bump it. */
[data-theme="light"] .eyebrow .dot,
[data-theme="light"] .legal-content h2::before,
[data-theme="light"] .tts-field .lead-icon-dot {
  box-shadow: 0 0 0 3px rgba(31, 107, 71, 0.10);
}

/* Phone island pulse + status dots — the dark-theme box-shadow of
   `0 0 6–12px var(--accent)` produces a faint halo on cream that
   barely registers. Tighten the spread + drop alpha-driven glows. */
[data-theme="light"] .phone-island-dot,
[data-theme="light"] .ds-status .d,
[data-theme="light"] .session-tab.active .dot,
[data-theme="light"] .ds-needle::before,
[data-theme="light"] .funnel-rule.is-active .pip {
  box-shadow: 0 0 0 2px rgba(31, 107, 71, 0.16);
}
[data-theme="light"] .ds-status.is-stepup .d,
[data-theme="light"] .session-tab.active.suspicious .dot,
[data-theme="light"] .ds-needle.is-stepup::before,
[data-theme="light"] .funnel-rule.step-up.is-active .pip {
  box-shadow: 0 0 0 2px rgba(180, 114, 0, 0.18);
}
[data-theme="light"] .ds-status.is-block .d,
[data-theme="light"] .session-tab.active.blocked .dot,
[data-theme="light"] .ds-needle.is-block::before,
[data-theme="light"] .funnel-rule.block.is-active .pip {
  box-shadow: 0 0 0 2px rgba(192, 50, 43, 0.18);
}

/* Mobile-auth pulse dot — same treatment. */
[data-theme="light"] .mauth-page .pulse-dot,
[data-theme="light"] .mauth-page .sig-dot {
  box-shadow: 0 0 0 3px rgba(31, 107, 71, 0.14);
}

/* Mobile-auth arch core — bright green outer shadow on cream goes
   muddy. Replace with a soft ink lift + faint forest tint. */
[data-theme="light"] .arch-core {
  box-shadow:
    0 0 0 1px rgba(31, 107, 71, 0.10) inset,
    0 12px 28px -10px rgba(14, 14, 12, 0.10);
}

/* Demo step success badge ("✓") on home — bright green halo. */
[data-theme="light"] .demo-step.done .ix,
[data-theme="light"] .flow-step.done .ix {
  box-shadow: 0 4px 14px -4px rgba(31, 107, 71, 0.30);
}

/* Form-field focus ring — the bright neon `rgba(0,229,143,0.15)`
   doesn't match the deep forest accent. */
[data-theme="light"] .tts-field input:focus,
[data-theme="light"] .tts-field textarea:focus {
  box-shadow: 0 0 0 3px rgba(31, 107, 71, 0.14);
}
[data-theme="light"] .tts-field [aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(192, 50, 43, 0.14);
}
[data-theme="light"] ::selection { background: var(--accent); color: var(--on-accent); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--g5); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--g7); }
[data-theme="light"] body::before {
  /* Slightly darker grain on warm paper */
  filter: invert(1);
}
/* Logo swap: show white logo in dark, colored logo in light */
.logo .logo-light { display: none; }
[data-theme="light"] .logo .logo-dark { display: none; }
[data-theme="light"] .logo .logo-light { display: inline-flex; }

/* Hide the empty hero glow on light theme */
[data-theme="light"] .hero-glow { display: none; }


/* =============================================================
   THEME TOGGLE BUTTON (sun/moon in nav)
   ============================================================= */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: var(--border);
  color: var(--g10);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.theme-toggle svg { width: 15px; height: 15px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 720px) {
  .theme-toggle { width: 36px; height: 36px; }
}

/* Smooth transitions when toggling */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.2s ease, color 0.18s ease, border-color 0.18s ease, fill 0.18s ease, stroke 0.18s ease !important;
}


/* =============================================================
 * GLOBAL RESPONSIVE
 * Site-wide layout that adapts across breakpoints.
 * Used by every page; do not move into a page-specific file.
 * ============================================================= */
 * Site-wide layout that adapts across breakpoints.
 * Used by every page; do not move into a page-specific file.
 * ============================================================= */

/* Overflow / minimum width guards */
html, body { overflow-x: hidden; }
body { min-width: 320px; }

/* Images and SVGs never break out of their container */
img, svg { max-width: 100%; height: auto; }

/* Hero glow shouldn't overflow viewport */
.hero-glow {
  max-width: 100vw;
  width: min(1100px, 100vw);
}


/* -----------------------------------------------------------
 * NAV - hamburger + drawer (≤1080)
 * Lives here (not page CSS) because every page has the nav.
 * --------------------------------------------------------- */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: var(--border-strong);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-burger:hover { background: var(--surface-3); }
.nav-burger svg { width: 18px; height: 18px; }

.nav-drawer {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: var(--border);
  z-index: 49;
  padding: 24px var(--pad-x) 32px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.nav-drawer-links a {
  display: block;
  font-size: 16px;
  color: var(--g11);
  padding: 14px 0;
  border-bottom: 1px solid var(--surface-3);
  transition: color 0.15s;
}
.nav-drawer-links a:hover,
.nav-drawer-links a.is-active { color: var(--text-strong); }
.nav-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.nav-drawer-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 14px;
}

@media (max-width: 1080px) {
  .nav-burger { display: inline-flex; }
  .nav-drawer { display: block; }
  .nav-right .btn-text { display: none; } /* "Sign in" goes to drawer */
}

@media (max-width: 720px) {
  .nav-right .btn-ghost { display: none; }
  .nav-right .btn-primary {
    padding: 8px 12px;
    font-size: 13px;
  }
  .nav-inner { gap: 8px; }
}

@media (max-width: 380px) {
  .nav-right .btn-primary span.arrow { display: none; }
}

/* Body lock when drawer open */
body.nav-drawer-open { overflow: hidden; }


/* -----------------------------------------------------------
 * TRUST STRIP - used on home + others
 * --------------------------------------------------------- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 48px 0;
  border-top: var(--border);
  border-bottom: var(--border);
}
@media (max-width: 880px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
    padding: 36px 0;
  }
}
@media (max-width: 480px) {
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}


/* -----------------------------------------------------------
 * SECTION PADDING / CONTAINER GUTTERS
 * --------------------------------------------------------- */
@media (max-width: 480px) {
  :root { --pad-x: 20px; }
  .section-pad { padding: clamp(56px, 10vh, 80px) 0; }
  .section-pad-sm { padding: clamp(40px, 7vh, 64px) 0; }
}


/* -----------------------------------------------------------
 * FOOTER - small breakpoints
 * --------------------------------------------------------- */
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding-top: 24px;
  }
  .footer-legal { flex-wrap: wrap; gap: 12px 16px; }
}


/* -----------------------------------------------------------
 * TOUCH TARGETS - 44px minimum on coarse pointers
 * --------------------------------------------------------- */
@media (pointer: coarse), (max-width: 760px) {
  .btn-sm { padding: 10px 14px; font-size: 13px; min-height: 40px; }
  .cc-close { width: 40px; height: 40px; }
  .nav-drawer-links a { padding: 16px 0; }
}


/* -----------------------------------------------------------
 * COOKIE BANNER on mobile
 * --------------------------------------------------------- */
@media (max-width: 480px) {
  .cc-banner-host {
    left: 12px; right: 12px; bottom: 12px;
    max-width: none;
  }
  .cc-card .cc-actions { gap: 6px; }
  .cc-card .cc-actions .cc-btn { flex: 1 1 auto; padding: 10px 12px; }
}


/* -----------------------------------------------------------
 * Reduced motion - drawer transition
 * --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .nav-drawer { transition: none; }
}


/* =============================================================
 * PAGE TRANSITIONS (transitions.js)
 * ============================================================= */

/* Whole-page cross-fade — old slides up/fades, new rises in */
::view-transition-old(root) {
  animation: vt-out 0.20s ease both;
}
::view-transition-new(root) {
  animation: vt-in  0.28s ease both;
}

@keyframes vt-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes vt-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fallback animations for browsers without View Transitions API */
@keyframes page-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-leaving {
  animation: page-fade-out 0.20s ease both;
  pointer-events: none;
}
.page-entering {
  animation: page-fade-in 0.28s ease both;
}

/* Respect reduced-motion for all transition animations */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page-content),
  ::view-transition-new(page-content) {
    animation-duration: 0.01ms;
  }
  .page-leaving,
  .page-entering {
    animation-duration: 0.01ms;
  }
}
