/* Design tokens — mirror lib/tokens.ts + design-book/db-foundations.jsx. */
:root {
  --dg-purple: #7C3AED;
  --dg-purple-dark: #6D28D9;
  --dg-purple-light: #A78BFA;
  --dg-purple-50: #F5F3FF;
  --dg-purple-100: #EDE9FE;
  --dg-purple-200: #DDD6FE;
  --dg-purple-700: #6D28D9;
  --dg-purple-900: #4C1D95;

  --slate-50: #F8FAFC;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0F172A;

  --dg-success: #22C55E;
  --dg-warning: #F59E0B;
  --dg-error: #EF4444;

  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20,16,40,.08);
  --shadow-md: 0 4px 16px rgba(20,16,40,.10);
  --shadow-lg: 0 12px 32px rgba(20,16,40,.16);
  --shadow-xl: 0 30px 80px rgba(20,16,40,.22);
  --shadow-purple-glow: 0 0 0 6px rgba(124,58,237,.16), 0 4px 12px rgba(124,58,237,.45);
  --shadow-focus: 0 0 0 3px rgba(124,58,237,.40);

  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--slate-900);
  line-height: 1.55;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--dg-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--dg-purple); outline-offset: 2px; border-radius: 2px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky; top: 0; z-index: 100;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--slate-900);
}
.brand-mic {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--dg-purple); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(124,58,237,.4);
}
.nav-links { display: flex; gap: 24px; font-size: 14px; }
.nav-links a { color: var(--slate-600); }
.nav-links a:hover { color: var(--dg-purple); }

/* Hero */
.hero { padding: 96px 24px 64px; text-align: center; }
.hero h1 {
  font-size: 56px; line-height: 1.1; font-weight: 800; margin: 0 0 20px;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--dg-purple) 0%, var(--dg-purple-900) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tagline { font-size: 19px; color: var(--slate-600); max-width: 640px; margin: 0 auto 32px; }
.cta-row { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Buttons (matches design-book Section 8) */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: var(--r-lg); font-weight: 600; font-size: 14px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  font-family: inherit; cursor: pointer; border: 1px solid transparent;
}
.cta:hover { transform: translateY(-1px); text-decoration: none; }
.cta:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.cta:active { transform: translateY(1px); }

.cta.primary {
  background: var(--dg-purple); color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.30);
}
.cta.primary:hover { background: var(--dg-purple-dark); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.40); }
.cta.primary.big { padding: 16px 32px; font-size: 16px; }

.cta.ghost { background: transparent; color: var(--dg-purple); border-color: var(--dg-purple-light); }
.cta.ghost:hover { background: var(--dg-purple-50); }

.micro { margin-top: 16px; color: var(--slate-600); font-size: 13px; }

/* Demo frame */
.demo { padding: 24px 24px 64px; }
.demo-frame {
  border-radius: var(--r-3xl); overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--slate-200);
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1F1B2E 0%, #2A2440 100%);
  display: flex; align-items: center; justify-content: center;
}
.demo-placeholder { color: rgba(255,255,255,0.7); font-size: 15px; }

/* Features (cards = design-book Section 10) */
.features { padding: 64px 24px; }
.features h2, .privacy h2, .faq h2 {
  font-size: 32px; margin: 0 0 32px; text-align: center;
  font-weight: 700; letter-spacing: -0.5px;
}
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-2xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.feature:hover {
  border-color: var(--dg-purple-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.feature p { margin: 0; color: var(--slate-600); font-size: 14px; line-height: 1.5; }

/* Privacy */
.privacy { padding: 24px 24px 64px; }
.privacy ul { max-width: 720px; margin: 0 auto 16px; padding-left: 22px; color: var(--slate-600); font-size: 15px; }
.privacy p { max-width: 720px; margin: 0 auto; color: var(--slate-600); font-size: 14px; text-align: center; }

/* FAQ accordion */
.faq { padding: 24px 24px 64px; }
.faq details {
  border: 1px solid var(--slate-200); border-radius: var(--r-xl); padding: 16px 18px; margin-bottom: 10px;
  max-width: 720px; margin-left: auto; margin-right: auto;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--dg-purple); font-weight: 700; }
.faq details[open] summary::after { content: '–'; }
.faq details[open] summary { margin-bottom: 8px; color: var(--dg-purple); }
.faq p { margin: 0; color: var(--slate-600); font-size: 14px; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--dg-purple) 0%, var(--dg-purple-dark) 100%);
  padding: 64px 0; margin-top: 32px; text-align: center; color: #fff;
}
.cta-band h2 { font-size: 32px; margin: 0 0 24px; font-weight: 700; letter-spacing: -0.5px; }
.cta-band .cta.primary { background: #fff; color: var(--dg-purple); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.cta-band .cta.primary:hover { background: var(--dg-purple-50); }

footer { border-top: 1px solid var(--slate-200); padding: 24px 0; text-align: center; }
footer small { color: var(--slate-500); font-size: 13px; }
footer a { color: var(--slate-500); }
footer a:hover { color: var(--dg-purple); }

/* Kbd badge */
kbd {
  display: inline-block; padding: 2px 6px; font-size: 12px;
  background: var(--dg-purple-50); color: var(--dg-purple); border-radius: 4px;
  border: 1px solid var(--dg-purple-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 640px) {
  .hero { padding: 64px 24px 48px; }
  .hero h1 { font-size: 40px; }
  .tagline { font-size: 17px; }
  .features h2, .privacy h2, .faq h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta, .feature { transition: none; }
}

/* --- Brand lockup + Chrome CTA (brand book) --- */
.hero-badge {
  width: 104px; height: 104px; margin: 0 auto 28px; position: relative;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 25%, var(--dg-purple-light) 0%, var(--dg-purple) 46%, var(--dg-purple-dark) 100%);
  box-shadow: var(--shadow-purple-glow);
  display: flex; align-items: center; justify-content: center;
}
.hero-badge svg { width: 50px; height: 50px; }
.hero-badge .rec-dot {
  position: absolute; right: 16px; bottom: 16px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--dg-error); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .5);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-badge .rec-dot { animation: recpulse 1.6s ease-in-out infinite; }
  @keyframes recpulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .7; } }
}

/* Chrome-logo CTA — signals a jump to the Chrome Web Store */
.cta { gap: 8px; }
.chrome-logo { display: block; flex: 0 0 auto; }

/* Demo poster on brand purple (was off-brand navy) */
.demo-frame {
  background: linear-gradient(135deg, var(--dg-purple) 0%, var(--dg-purple-dark) 55%, var(--dg-purple-900) 100%);
}

/* --- Animated demo scene: Gmail dictation + cartoon speaker --- */
.demo-scene {
  width: 100%; height: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 28px; padding: 28px 32px;
}

/* Gmail compose window — blue frame */
.gwin {
  flex: 1 1 auto; max-width: 520px; background: #fff; color: var(--slate-900);
  border: 2px solid #4285F4; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 44px rgba(20, 16, 40, .28); font-size: 13px;
}
.gwin-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #F1F3F4; color: #3c4043; font-weight: 600; font-size: 12px; padding: 8px 12px;
}
.gwin-ctrls { display: flex; gap: 6px; }
.gwin-ctrls i { width: 11px; height: 2px; background: #9aa0a6; border-radius: 2px; }
.gwin-row { display: flex; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #EDEFF1; color: var(--slate-700); }
.gwin-lbl { color: #9aa0a6; min-width: 52px; }
.gwin-body { padding: 14px; min-height: 78px; line-height: 1.5; color: var(--slate-900); }
.gwin-body .caret {
  display: inline-block; width: 2px; height: 15px; margin-left: 1px; vertical-align: -2px;
  background: var(--dg-purple);
}
.gwin-tools { display: flex; align-items: center; gap: 10px; padding: 8px 14px 14px; }
.gwin-send { background: #1a73e8; color: #fff; font-weight: 600; font-size: 12px; padding: 7px 18px; border-radius: 999px; }
.gwin-mic {
  position: relative; width: 30px; height: 30px; border-radius: 50%;
  background: var(--dg-purple); display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .5);
}
.gwin-mic svg { width: 16px; height: 16px; }
.gwin-rec {
  position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--dg-error); border: 2px solid #fff;
}
.gwin-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600;
  color: var(--dg-purple); background: var(--dg-purple-50); padding: 5px 10px; border-radius: 999px;
}
.gwin-pill .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--dg-error); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2.5px; height: 5px; background: var(--dg-purple); border-radius: 2px; }

/* Cartoon stick-figure speaker */
.speaker { flex: 0 0 auto; width: 180px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bubble {
  position: relative; background: #fff; color: var(--slate-900);
  border: 2px solid #1E293B; border-radius: 16px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  max-width: 180px; min-height: 18px; margin-bottom: 18px; box-shadow: 0 6px 16px rgba(20, 16, 40, .25);
  transition: opacity .4s ease;
}
.bubble::after {
  content: ''; position: absolute; left: 30px; bottom: -11px;
  border: 10px solid transparent; border-top-color: #1E293B; border-bottom: 0;
}
.bubble::before {
  content: ''; position: absolute; left: 32px; bottom: -7px; z-index: 1;
  border: 8px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.demo-scene.fade .bubble { opacity: 0; }
.stick { width: 120px; height: 160px; overflow: visible; }
.stick line { stroke: #fff; stroke-width: 5; stroke-linecap: round; fill: none; }
.stick .head { fill: #fff; }
.stick .eye { fill: var(--dg-purple-900); }
.stick .mouth { fill: var(--dg-purple-900); transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  .gwin-rec, .gwin-pill .pdot { animation: recpulse 1.4s ease-in-out infinite; }
  .eq i { animation: eqbar .9s ease-in-out infinite; }
  .eq i:nth-child(2) { animation-delay: .15s; }
  .eq i:nth-child(3) { animation-delay: .30s; }
  .eq i:nth-child(4) { animation-delay: .45s; }
  @keyframes eqbar { 0%, 100% { height: 4px; } 50% { height: 12px; } }
  .gwin-body .caret { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .stick { animation: bob 3s ease-in-out infinite; }
  @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  .demo-scene.talking .mouth { animation: talk .3s ease-in-out infinite; }
  @keyframes talk { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
  .demo-scene.talking .arm {
    transform-box: view-box; transform-origin: 60px 66px;
    animation: wave .7s ease-in-out infinite alternate;
  }
  @keyframes wave { from { transform: rotate(0deg); } to { transform: rotate(-18deg); } }
}

@media (max-width: 720px) {
  .demo-frame { aspect-ratio: auto; }
  .demo-scene { flex-direction: column; gap: 18px; padding: 22px; }
  .speaker { width: auto; flex-direction: row; align-items: flex-end; gap: 12px; }
  .bubble { margin-bottom: 0; }
}

/* Anchor offset under the sticky header */
section[id] { scroll-margin-top: 84px; }

/* --- Guide / how-to steps --- */
.guide { padding: 64px 24px 8px; }
.guide h2, .tips h2 { font-size: 32px; margin: 0 0 20px; text-align: center; font-weight: 700; letter-spacing: -0.5px; }
.guide-intro { max-width: 720px; margin: 0 auto 34px; text-align: center; color: var(--slate-600); font-size: 17px; line-height: 1.6; }
.steps { max-width: 720px; margin: 0 auto; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative; padding: 15px 0 15px 52px; border-bottom: 1px solid var(--slate-200);
  color: var(--slate-700); font-size: 15px; line-height: 1.55;
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--dg-purple); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.steps li strong { color: var(--slate-900); }

/* Feature use-case line */
.feature .use { margin: 10px 0 0; color: var(--dg-purple); font-size: 13px; font-weight: 600; }

/* --- Tips --- */
.tips { padding: 40px 24px 64px; }
.tips-list { max-width: 720px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 12px; }
.tips-list li {
  background: var(--dg-purple-50); border: 1px solid var(--dg-purple-100); border-radius: var(--r-xl);
  padding: 14px 18px; color: var(--slate-700); font-size: 15px; line-height: 1.55;
}
.tips-list li strong { color: var(--slate-900); }

/* --- Floating "Add to Chrome" --- */
.sticky-cta {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px;
  background: var(--dg-purple); color: #fff; text-decoration: none;
  box-shadow: 0 10px 30px rgba(124, 58, 237, .45);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .15s ease;
}
.sticky-cta.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sticky-cta:hover { background: var(--dg-purple-dark); text-decoration: none; }
.sticky-cta:focus-visible { box-shadow: var(--shadow-focus); outline: none; }

/* --- Nav fits on mobile (Guide · Features · FAQ · Privacy) --- */
@media (max-width: 640px) {
  .brand span:last-child { display: none; }   /* keep the mic, drop the wordmark */
  .nav-links { gap: 14px; font-size: 13px; }
  .sticky-cta { right: 12px; bottom: 12px; padding: 11px 16px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: opacity .01s; }
}
