/* ============================================================
   VoiceMode — canonical landing (voicemode.dev)
   Coral / White visual design — wimo, VMMT-120
   Anchored on the established brand coral (#d1684e) from the
   VoiceMode Connect receiver, inverted to a light front-door.
   Zero dependencies, system fonts — edge-served, fast.
   ============================================================ */

:root {
  /* --- Coral ramp (brand anchor: #d1684e) --- */
  --coral-700: #a8432e;   /* link text on white (AA on canvas) */
  --coral-600: #c45c43;   /* hover / deep */
  --coral-500: #d1684e;   /* BRAND — primary accent, CTAs */
  --coral-400: #e0805f;   /* lighter accent */
  --coral-300: #ec9d80;   /* soft accent, glows */
  --coral-100: #f9e3d9;   /* tinted surface */
  --coral-50:  #fdf1ea;   /* faint wash */

  /* --- Warm neutrals (white-dominant) --- */
  --canvas:    #fffdfb;   /* page background — warm white, not pure */
  --surface:   #ffffff;   /* cards */
  --surface-2: #fdf6f1;   /* alt surface / inset */
  --ink:       #241c18;   /* text primary — warm near-black */
  --ink-2:     #6b5d55;   /* text secondary — warm grey */
  --ink-3:     #9b8b81;   /* text tertiary / captions */
  --border:    #f0e2d9;   /* warm hairline */
  --border-2:  #e7d4c8;   /* stronger border */

  /* --- Code panel (the one dark moment — a warm terminal) --- */
  --code-bg:   #241c18;
  --code-fg:   #f3e9e2;
  --code-dim:  #b8a195;   /* comments */
  --code-coral:#ef9d80;

  /* --- Type scale (1.25 minor-third) --- */
  --t-xs: 0.78rem;
  --t-sm: 0.9rem;
  --t-base: 1.05rem;
  --t-lg: 1.3rem;
  --t-xl: 1.7rem;
  --t-2xl: 2.3rem;
  --t-3xl: 3.1rem;
  --t-4xl: 3.9rem;

  /* --- Spacing --- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-8: 3rem;
  --s-10: 4.5rem;
  --s-12: 6rem;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(74, 42, 28, 0.05);
  --shadow:    0 6px 24px rgba(74, 42, 28, 0.08);
  --shadow-lg: 0 18px 50px rgba(74, 42, 28, 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background-color: var(--canvas);
  color: var(--ink);
  font-size: var(--t-base);
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* warm coral glow at top, fades to clean white — gentle, not blobby */
  background-image:
    radial-gradient(1100px 520px at 50% -180px, var(--coral-50) 0%, transparent 70%),
    radial-gradient(700px 400px at 100% 8%, rgba(236, 157, 128, 0.10) 0%, transparent 60%);
  background-repeat: no-repeat;
}

/* ---------- Layout primitives ---------- */
/* horizontal-only padding so it doesn't clobber section { padding: vertical 0 } */
.wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--s-5); padding-right: var(--s-5); }
.narrow { max-width: 760px; }
section { padding: var(--s-10) 0; }
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral-600);
  margin-bottom: var(--s-3);
}
h2 {
  font-size: var(--t-2xl);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: var(--s-4);
}
h3 { font-size: var(--t-lg); font-weight: 620; letter-spacing: -0.015em; }
p { color: var(--ink-2); }
a { color: var(--coral-700); text-decoration: none; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 253, 251, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 680; letter-spacing: -0.02em; color: var(--ink); font-size: 1.08rem; }
.brand .seal { flex: none; border-radius: 50%; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: var(--s-5); }
.nav-links a { color: var(--ink-2); font-size: var(--t-sm); font-weight: 520; transition: color var(--dur) var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-connect { color: var(--ink-3); }
.nav-gh {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--ink) !important;
  transition: all var(--dur) var(--ease);
}
.nav-gh:hover { border-color: var(--coral-300); background: var(--coral-50); }

/* ---------- Hero ---------- */
.hero { padding-top: var(--s-10); padding-bottom: var(--s-8); text-align: center; }
.hero .seal-lg { margin: 0 auto var(--s-5); display: block; }
.hero h1 {
  font-size: var(--t-4xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--ink);
  margin-bottom: var(--s-4);
}
.hero h1 .accent { color: var(--coral-500); }
.hero .tagline {
  font-size: var(--t-lg);
  color: var(--ink-2);
  max-width: 600px;
  margin: 0 auto var(--s-6);
  line-height: 1.5;
}
.cta-row { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 13px 24px; border-radius: 999px;
  font-size: var(--t-base); font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
}
.btn-primary {
  background: var(--coral-500); color: #fff !important;
  box-shadow: 0 6px 18px rgba(209, 104, 78, 0.32);
}
.btn-primary:hover { background: var(--coral-600); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(209, 104, 78, 0.40); }
.btn-ghost {
  background: var(--surface); color: var(--ink) !important;
  border-color: var(--border-2);
}
.btn-ghost:hover { border-color: var(--coral-300); background: var(--coral-50); }

.compat {
  margin-top: var(--s-6);
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4);
  font-size: var(--t-sm); color: var(--ink-3);
  font-family: var(--mono);
}
.compat strong { color: var(--coral-600); font-weight: 600; }
.compat .dot { color: var(--border-2); }

/* ---------- Hero — split layout (Variant B) ---------- */
.hero.split-hero { text-align: left; padding-bottom: var(--s-8); }
.split {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-8); align-items: center;
}
.split .eyebrow { margin-bottom: var(--s-3); }
.split h1 {
  font-size: var(--t-4xl); font-weight: 700; letter-spacing: -0.04em;
  line-height: 1.03; color: var(--ink); margin-bottom: var(--s-4);
}
.split h1 .accent { color: var(--coral-500); }
.split .tagline {
  font-size: var(--t-lg); color: var(--ink-2);
  max-width: 460px; margin: 0 0 var(--s-6); line-height: 1.5;
}
.split .cta-row,
.split .compat { justify-content: flex-start; }

.convo {
  background: var(--code-bg); border-radius: var(--radius-lg);
  padding: var(--s-5); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--t-sm); line-height: 1.7;
}
.convo .turn { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); align-items: flex-start; }
.convo .turn:last-child { margin-bottom: 0; }
.convo .who {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
}
.convo .who.you { background: #3a2c25; color: #e9d6cb; }
.convo .who.vm { background: var(--coral-500); color: #fff; }
.convo .said { color: var(--code-fg); padding-top: 3px; }
.convo .said .muted { color: var(--code-dim); }
.convo .wave { display: inline-flex; gap: 3px; align-items: flex-end; height: 15px; margin-left: 6px; vertical-align: middle; }
.convo .wave i { width: 3px; background: var(--coral-300); border-radius: 2px; animation: bar 1.1s ease-in-out infinite; }
.convo .wave i:nth-child(1){height:7px;animation-delay:0s}
.convo .wave i:nth-child(2){height:14px;animation-delay:.15s}
.convo .wave i:nth-child(3){height:10px;animation-delay:.3s}
.convo .wave i:nth-child(4){height:15px;animation-delay:.45s}
.convo .wave i:nth-child(5){height:6px;animation-delay:.6s}
@keyframes bar { 0%,100%{transform:scaleY(0.6)} 50%{transform:scaleY(1)} }

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ---------- Demo video ---------- */
.video-frame {
  position: relative; width: 100%; padding-bottom: 56.25%;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.video-frame::after {
  /* soft coral halo */
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  pointer-events: none;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-halo {
  position: relative;
  border-radius: var(--radius-lg);
}
.video-halo::before {
  content: ""; position: absolute; inset: -22px -22px;
  background: radial-gradient(closest-side, rgba(224,128,95,0.22), transparent 75%);
  z-index: -1; border-radius: 40px;
}

/* ---------- Quick start ---------- */
.qs-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-5); margin-top: var(--s-6); }
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: var(--s-5);
  box-shadow: var(--shadow);
}
.card .badge {
  display: inline-block; font-size: var(--t-xs); font-weight: 600;
  font-family: var(--mono); letter-spacing: 0.04em;
  color: var(--coral-700); background: var(--coral-100);
  padding: 3px 10px; border-radius: 999px; margin-bottom: var(--s-3);
}
.card h3 { margin-bottom: var(--s-4); }

.code {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius-sm);
  padding: var(--s-4) var(--s-4);
  font-family: var(--mono); font-size: var(--t-sm); line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  position: relative;
}
.code .c { color: var(--code-dim); }      /* comment */
.code .p { color: var(--code-coral); }     /* prompt / emphasis */

/* Copy-to-clipboard button — appears on hover/focus */
.code .copy {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1;
  color: var(--code-dim); background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px;
  padding: 5px 9px; cursor: pointer; opacity: 0;
  transition: opacity var(--dur) var(--ease), color var(--dur), background var(--dur), border-color var(--dur);
}
.code:hover .copy, .code:focus-within .copy { opacity: 1; }
.code .copy:hover { color: var(--code-fg); background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
.code .copy.done { color: var(--code-coral); border-color: var(--code-coral); }
@media (hover: none) { .code .copy { opacity: 1; } }  /* touch: always visible */
.code-caption { font-size: var(--t-sm); color: var(--ink-3); margin-top: var(--s-3); }

/* ---------- Privacy highlight ---------- */
.privacy {
  background: linear-gradient(180deg, var(--coral-50), var(--surface));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
}
.privacy .badge {
  display: inline-block; font-size: var(--t-xs); font-weight: 600;
  font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: var(--coral-500);
  padding: 3px 10px; border-radius: 999px; margin-bottom: var(--s-3);
}
.privacy .code { margin-top: var(--s-4); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-top: var(--s-6); }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s-5);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.feature:hover { transform: translateY(-3px); border-color: var(--coral-300); box-shadow: var(--shadow); }
.feature .ficon {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: var(--s-4);
  background: var(--coral-100); color: var(--coral-600);
}
.feature h3 { font-size: var(--t-base); margin-bottom: var(--s-2); }
.feature p { font-size: var(--t-sm); }

/* ---------- Requirements ---------- */
.req {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s-6);
}
.req ul { list-style: none; display: grid; gap: var(--s-3); }
.req li { display: flex; gap: var(--s-3); align-items: flex-start; color: var(--ink-2); font-size: var(--t-sm); }
.req li .tick { color: var(--coral-500); flex: none; margin-top: 2px; }

/* ---------- Resources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-top: var(--s-5); }
.res {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink) !important; font-size: var(--t-sm); font-weight: 540;
  transition: all var(--dur) var(--ease);
}
.res:hover { border-color: var(--coral-300); background: var(--coral-50); transform: translateY(-2px); }
.res svg { color: var(--coral-600); flex: none; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--border);
  padding: var(--s-8) 0;
  margin-top: var(--s-8);
  background: var(--surface-2);
}
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.foot .brand { font-size: 1rem; }
.foot-meta { color: var(--ink-3); font-size: var(--t-sm); }
.foot-meta a { color: var(--ink-2); }
.foot-meta a:hover { color: var(--coral-700); }
.foot-links { display: flex; gap: var(--s-5); font-size: var(--t-sm); }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--coral-700); }

/* ---------- Section header helper ---------- */
.sec-head { margin-bottom: var(--s-2); }
.sec-head .lead { color: var(--ink-2); font-size: var(--t-lg); max-width: 640px; }

/* ---------- Inline link underline animation ---------- */
.ul { position: relative; color: var(--coral-700); font-weight: 540; }
.ul::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--coral-500); transition: width var(--dur) var(--ease);
}
.ul:hover::after { width: 100%; }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible {
  outline: 2.5px solid var(--coral-400); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .qs-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: var(--t-3xl); }
}
@media (max-width: 560px) {
  :root { --t-4xl: 2.6rem; --t-3xl: 2.2rem; --t-2xl: 1.85rem; }
  .nav-links .nav-hide { display: none; }
  .res-grid { grid-template-columns: 1fr; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
  section { padding: var(--s-8) 0; }
}

/* ============================================================
   DARK THEME — follows the visitor's system setting.
   Warm near-black canvas, coral stays the accent. The light
   page inverted, so both read as one VoiceMode family.
   Coral ramp remapped for contrast on dark; tints become
   translucent coral so badges/icons sit on dark surfaces.
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    /* Warm neutrals — inverted */
    --canvas:    #1a1310;   /* warm near-black page */
    --surface:   #221912;   /* cards */
    --surface-2: #2a1e17;   /* alt surface / inset */
    --ink:       #f4ebe4;   /* text primary — warm off-white */
    --ink-2:     #c4b3a8;   /* text secondary */
    --ink-3:     #9c8b80;   /* text tertiary / captions */
    --border:    #382a23;   /* warm hairline */
    --border-2:  #4a3830;   /* stronger border */

    /* Coral remapped for legibility on dark.
       --coral-500 (brand) is unchanged so CTA buttons keep
       white-on-coral contrast. The "link/deep" tones lift. */
    --coral-700: #f0a98d;   /* link text on dark (was deep) */
    --coral-600: #ec9d80;   /* eyebrows, icons */
    --coral-100: rgba(224, 128, 95, 0.16);  /* tinted dark surface (badges) */
    --coral-50:  rgba(224, 128, 95, 0.08);  /* faint wash (glows) */

    /* Code panel — push darker so it separates from canvas */
    --code-bg:   #120c09;

    /* Shadows go neutral-dark instead of warm-brown */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow:    0 6px 24px rgba(0, 0, 0, 0.50);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.60);
  }

  /* Nav uses a literal translucent white — override for dark */
  .nav { background: rgba(26, 19, 16, 0.82); }

  /* Privacy card: gradient top is now a translucent coral over dark */
  .privacy { background: linear-gradient(180deg, var(--coral-50), var(--surface)); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ---------- GitHub star button (nav social proof) ---------- */
.gh-star { display: inline-flex; align-items: stretch; font-family: var(--mono); font-size: var(--t-sm); line-height: 1; }
.gh-star .gh-btn,
.gh-star .gh-count {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  color: var(--ink); text-decoration: none; border: 1px solid var(--border-2);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.gh-star .gh-btn { background: var(--surface-2); border-radius: 7px 0 0 7px; }
.gh-star .gh-btn:hover { background: var(--coral-50); border-color: var(--coral-300); }
.gh-star .gh-count { background: var(--surface); border-left: none; border-radius: 0 7px 7px 0; margin-left: 5px; position: relative; font-variant-numeric: tabular-nums; }
.gh-star .gh-count:hover { background: var(--coral-50); }
.gh-star .gh-count::before {
  content: ''; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px;
  transform: translateY(-50%) rotate(45deg); background: var(--surface);
  border-left: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2);
}
.gh-star .gh-icon { width: 16px; height: 16px; flex: none; display: block; }


/* ---------- Listen (latest podcast episode) ---------- */
.pod { display: flex; gap: var(--s-5); align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-5); box-shadow: var(--shadow); }
.pod-play { flex: none; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; background: var(--coral-500); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(209, 104, 78, 0.32); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.pod-play:hover { background: var(--coral-600); transform: translateY(-1px); }
.pod-play svg { width: 26px; height: 26px; display: block; }
.pod-play .ic-pause { display: none; }
.pod-play.playing .ic-play { display: none; }
.pod-play.playing .ic-pause { display: block; }
.pod-body { flex: 1 1 auto; min-width: 0; }
.pod-body .eyebrow { margin-bottom: var(--s-1); }
.pod-body h3 { margin-bottom: var(--s-2); }
.pod-blurb { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-3); line-height: 1.55; }
.pod-bar { height: 5px; border-radius: 999px; background: var(--border-2); overflow: hidden; }
.pod-bar-fill { height: 100%; width: 0; background: var(--coral-500); border-radius: 999px; transition: width 0.15s linear; }
.pod-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-2); font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); }
.pod-meta .ul { color: var(--coral-700); }
@media (max-width: 560px) { .pod { flex-direction: column; align-items: flex-start; } }
