/* ============================================================
   Snack — website. Scandinavian minimalism.
   Tokens mirror the app (snack/ui/web-src/app.css) so the
   marketing site and the product feel like one brand.
   ============================================================ */

:root {
  --bg: #FAFAF7;
  --bg-tint-a: rgba(58, 111, 236, 0.06);
  --bg-tint-b: rgba(217, 198, 156, 0.10);
  --surface: #FFFFFF;
  --surface-hover: #F4F2EC;
  --border: #E7E5DF;
  --border-strong: #D5D2CA;

  --text: #16181D;
  --text-muted: #6B7280;
  --text-subtle: #9CA3AF;

  --accent: #3A6FEC;
  --accent-hover: #2E5DD1;
  --accent-subtle: #E8EFFD;
  --recording: #D9534F;
  --success: #4C9A6E;
  --warning: #C98A2F;

  --font-sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1080px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.04), 0 2px 8px rgba(22, 24, 29, 0.04);
  --shadow: 0 4px 24px rgba(22, 24, 29, 0.07);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161B;
    --bg-tint-a: rgba(91, 133, 240, 0.10);
    --bg-tint-b: rgba(217, 198, 156, 0.05);
    --surface: #1D2027;
    --surface-hover: #262A33;
    --border: #2B2F38;
    --border-strong: #3A3F4A;

    --text: #E7EAF0;
    --text-muted: #9097A3;
    --text-subtle: #5F6671;

    --accent: #5B85F0;
    --accent-hover: #7095F2;
    --accent-subtle: #1B2538;
    --recording: #E66B66;
    --success: #6CB48C;
    --warning: #D9A84F;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.25);
    --shadow: 0 4px 28px rgba(0,0,0,0.4);

    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at 100% 0%, var(--bg-tint-a), transparent 55%),
    radial-gradient(circle at 0% 100%, var(--bg-tint-b), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 650; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

section { padding: 88px 0; }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 62ch; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font-weight: 600; font-size: 1rem; padding: 13px 24px; border-radius: var(--radius);
  border: 1px solid transparent; transition: all 180ms var(--ease-out); cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; font-size: 1.15rem; }
.brand img { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.96rem; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 24px; gap: 18px;
  }
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn-ghost { display: none; }
}

/* ---- Hero ---- */
.hero { padding: 84px 0 64px; text-align: center; }
.hero h1 { max-width: 16ch; margin-left: auto; margin-right: auto; }
.hero .lead { margin: 18px auto 32px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 0.9rem; color: var(--text-subtle); }
.hero-badges { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 40px; color: var(--text-muted); font-size: 0.92rem; }
.hero-badges span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ---- Grid cards ---- */
.grid { display: grid; gap: 22px; }
.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: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }
.card .ic {
  width: 42px; height: 42px; border-radius: var(--radius); background: var(--accent-subtle);
  color: var(--accent); display: grid; place-items: center; margin-bottom: 16px;
}
.card .ic svg { width: 22px; height: 22px; }

/* ---- Steps ---- */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px){ .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-left: 8px; }
.step .num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--text-muted); margin: 0; }

/* ---- Use cases ---- */
.usecase { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-bottom: 64px; }
.usecase:nth-child(even) .uc-media { order: -1; }
@media (max-width: 760px){ .usecase { grid-template-columns: 1fr; gap: 20px; } .usecase:nth-child(even) .uc-media { order: 0; } }
.uc-media {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm); min-height: 190px; display: grid; align-content: center; gap: 10px;
}
.uc-quote { font-size: 1.05rem; color: var(--text); font-style: italic; }
.uc-cursor { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.9rem; }

/* ---- How-it-works mockup (animated illustration) ---- */
.mockup {
  max-width: 640px; margin: 34px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.mockup-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface-hover); }
.dotrow { display: inline-flex; gap: 6px; }
.dotrow i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.mockup-title { font-size: 0.85rem; color: var(--text-muted); }
.mockup-body { padding: 26px 22px; min-height: 118px; font-size: 1.12rem; line-height: 1.6; }
.mockup-text { margin: 0; display: inline; color: var(--text); transition: opacity 400ms var(--ease-out); }
.mockup-text.fade { opacity: 0; }
.type-cursor { display: inline-block; width: 2px; margin-left: 1px; color: var(--accent); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mockup-hint { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.hint-label { font-size: 0.85rem; color: var(--text-muted); }
.wave { display: inline-flex; align-items: center; gap: 4px; height: 22px; }
.wave i { width: 4px; height: 6px; border-radius: 999px; background: var(--border-strong); }
.mockup.speaking .wave i { background: var(--accent); animation: wave 0.9s ease-in-out infinite; }
.mockup.speaking .hint-label { color: var(--accent); }
.wave i:nth-child(1) { animation-delay: 0s; }
.wave i:nth-child(2) { animation-delay: 0.12s; }
.wave i:nth-child(3) { animation-delay: 0.24s; }
.wave i:nth-child(4) { animation-delay: 0.36s; }
.wave i:nth-child(5) { animation-delay: 0.48s; }
@keyframes wave { 0%,100% { height: 6px; } 50% { height: 20px; } }
.demo-fine { margin-top: 16px; font-size: 0.82rem; color: var(--text-subtle); }
@media (prefers-reduced-motion: reduce) {
  .type-cursor, .mockup.speaking .wave i { animation: none; }
}

/* ---- FAQ ---- */
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 20px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-muted); margin: 0 0 16px; }

/* ---- CTA band ---- */
.cta-band { background: var(--accent); color: #fff; border-radius: var(--radius-xl); padding: 56px 40px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 52ch; margin: 0 auto 26px; }
.cta-band .btn-ghost { background: #fff; color: var(--accent); border-color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,0.9); color: var(--accent); }

/* ---- Article ---- */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.article .meta { color: var(--text-subtle); font-size: 0.9rem; margin-bottom: 32px; }
.article h2 { margin-top: 44px; }
.article h3 { margin-top: 28px; }
.article ul, .article ol { color: var(--text-muted); padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article blockquote { border-left: 3px solid var(--accent); margin: 24px 0; padding: 4px 20px; color: var(--text-muted); font-style: italic; }
.article .answer { font-size: 1.15rem; color: var(--text); border-left: 3px solid var(--accent); padding: 2px 20px; margin: 0 0 28px; }

.post-list { display: grid; gap: 20px; }
.post-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.post-card h3 { color: var(--text); margin-bottom: 6px; }
.post-card p { color: var(--text-muted); margin: 0; }
.post-card .meta { color: var(--text-subtle); font-size: 0.85rem; margin-bottom: 10px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-grid h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-muted); margin-bottom: 10px; font-size: 0.95rem; }
.footer-col a:hover { color: var(--text); }
.footer-brand { max-width: 280px; }
.footer-brand p { color: var(--text-muted); font-size: 0.92rem; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color:#fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0; z-index: 100; }
.skip-link:focus { left: 0; color: #fff; }

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