/* Talkbar site — monochrome-first, Geist Sans for prose, Geist Mono for identifiers only.
   The product name lives in ONE place: --product-name below. */

:root {
  --product-name: "Talkbar";

  --font: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  --bg: #ffffff;
  --bar: #f2f2f2;
  --fg: #171717;
  --fg-2: #666666;
  --border: #eaeaea;
  --border-2: #d4d4d4;
  --btn-bg: #171717;
  --btn-fg: #ffffff;
  --focus: #0070f3;

  /* the pill's own material, from docs/design-spec.md */
  --pill: #000000;
  --pill-edge: transparent;
  --ink-1: rgba(255, 255, 255, 0.92);
  --ink-2: rgba(255, 255, 255, 0.6);
  --ink-3: rgba(255, 255, 255, 0.36);
  --plate: rgba(255, 255, 255, 0.08);
  --plate-2: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.1);
  --field: rgba(255, 255, 255, 0.06);
  --field-stroke: rgba(255, 255, 255, 0.18);
  --segment-on: rgba(255, 255, 255, 0.18);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;
  --r-s: 6px; --r: 8px;

  --gutter: 80px;
  --bar-h: 30px;
  --ease-shape: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --bar: #141414;
    --fg: #ededed;
    --fg-2: #a1a1a1;
    --border: #262626;
    --border-2: #3a3a3a;
    --btn-bg: #ededed;
    --btn-fg: #0a0a0a;
    --pill-edge: rgba(255, 255, 255, 0.14);
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bar: #141414;
  --fg: #ededed;
  --fg-2: #a1a1a1;
  --border: #262626;
  --border-2: #3a3a3a;
  --btn-bg: #ededed;
  --btn-fg: #0a0a0a;
  --pill-edge: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[data-name]::before { content: var(--product-name); }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: 56px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }
.lede { font-size: 20px; color: var(--fg-2); max-width: 640px; }
.body { font-size: 17px; color: var(--fg-2); }
.small { font-size: 15px; color: var(--fg-2); }
.meta { font-size: 14px; color: var(--fg-2); }
.mono { font-family: var(--mono); font-size: 0.94em; }
.skip { position: absolute; left: -999px; top: var(--s2); }
.skip:focus { left: var(--s4); z-index: 10; background: var(--bg); padding: var(--s2) var(--s3); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); width: 100%; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s6); align-items: start; }
.grid12 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; }
.stack-3 { gap: var(--s3); }
.stack-4 { gap: var(--s4); }
.stack-5 { gap: var(--s5); }
.stack-6 { gap: var(--s6); }
.stack-8 { gap: var(--s8); }
.stack-10 { gap: var(--s10); }
.cluster { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }

section, footer { border-top: 1px solid var(--border); }
.section-pad { padding-top: var(--s20); padding-bottom: var(--s20); }
.hero { padding-top: 152px; padding-bottom: 96px; }
.hero-text { max-width: 440px; }
/* Desktop: the pill hangs right of centre so the box it grows into fills the hero's right half beside the text. */
@media (min-width: 1000px) {
  #pill { left: calc(50% + 200px); }
  .hero-text { max-width: min(440px, calc(50vw - 114px)); }
}
@media (max-width: 999px) {
  .hero { padding-top: 250px; }
}
.states { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: center; gap: 16px; }
.states .pill { position: static; margin: 0; }
.pill.mini { --w: 48px; width: 48px; }
.pill.mini .pill-row { padding: 0; justify-content: center; }
.states-caption { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: var(--r);
  font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--bg); color: var(--fg);
}
.btn:hover { border-color: var(--fg-2); }
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn.primary:hover { opacity: 0.88; }

/* rows: the evidence tables (invariants, contrast, faq) */
.rows { border-top: 1px solid var(--border); }
.row2 { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); padding: var(--s5) 0; border-bottom: 1px solid var(--border); }
.row2 > * { min-width: 0; }
.row2 .k { font-size: 17px; line-height: 1.4; font-weight: 500; }
.row2.narrow { grid-template-columns: 120px 1fr; padding: var(--s4) 0; }
.row2.narrow .k { font-size: 15px; }

/* faq */
details { border-bottom: 1px solid var(--border); }
summary { list-style: none; cursor: pointer; padding: var(--s5) 0; font-size: 17px; font-weight: 500; display: flex; justify-content: space-between; gap: var(--s4); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--fg-2); font-weight: 400; flex: none; }
details[open] summary::after { content: "–"; }
details > p { padding: 0 0 var(--s5); }

/* price block */
.price-box { padding: 28px; border: 1px solid var(--border); border-radius: var(--r); }
.price { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.price small { font-size: 17px; font-weight: 400; color: var(--fg-2); letter-spacing: 0; }
.price-box ul { padding-left: 18px; color: var(--fg-2); font-size: 15px; line-height: 1.7; }

/* ---------- the menu bar and the pill ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  height: var(--bar-h); background: var(--bar); border-bottom: 1px solid var(--border);
}
.bar .wrap { max-width: none; padding-left: var(--s6); padding-right: var(--s6); height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; }
.bar nav { display: flex; gap: var(--s5); font-weight: 400; color: var(--fg-2); }
.bar nav a { text-decoration: none; color: inherit; }
.bar nav a:hover { color: var(--fg); }
.bar .side { display: flex; align-items: center; gap: var(--s4); }

/* stage: a strip of menu bar for the step drawings */
.stage { position: relative; height: 64px; background: var(--bar); border-bottom: 1px solid var(--border); overflow: hidden; }
.stage.tall { height: 200px; }

.pill {
  --w: 280px;
  position: absolute; left: 50%; top: 0; width: var(--w); margin-left: calc(var(--w) / -2);
  background: var(--pill); color: var(--ink-1);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 1px 0 var(--pill-edge), 1px 0 0 var(--pill-edge), -1px 0 0 var(--pill-edge);
  font: 500 13px/1 var(--sys);
  transition: width 380ms var(--ease-shape), margin-left 380ms var(--ease-shape), border-radius 380ms var(--ease-shape), transform 120ms ease-out;
  white-space: nowrap;
}
.pill.wide, .pill[data-state="hearing"], .pill[data-state="transcribing"], .pill[data-state="ready"], .pill[data-state="pressed"] { --w: 420px; }
.pill.expanded, .pill[data-state="ready"], .pill[data-state="pressed"] { border-radius: 0 0 20px 20px; }
.pill[data-state="pressed"] { transform: scale(0.98); transform-origin: 50% 0; }
/* concave ears where the pill meets the bar: a shape cut, not a decoration */
.pill::before, .pill::after {
  content: ""; position: absolute; top: 0; width: 8px; height: 8px;
  background: radial-gradient(circle at 0 100%, transparent 8px, var(--pill) 8.5px);
}
.pill::before { left: -8px; }
.pill::after { right: -8px; transform: scaleX(-1); }

.pill-row { height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.pill-row .glyph { width: 18px; height: 18px; flex: none; display: flex; align-items: center; justify-content: center; position: relative; }
.glyph > span { display: none; }
.g-ring { width: 8px; height: 8px; border: 1.5px solid var(--ink-3); border-radius: 50%; }
.g-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-1); animation: breathe 2.4s ease-in-out infinite; }
.g-bars { display: flex; gap: 2px; align-items: center; height: 12px; }
.g-bars i { display: block; width: 2px; height: 3px; border-radius: 1px; background: var(--ink-1); }
.g-dots { display: flex; gap: 2.5px; align-items: center; }
.g-dots i { display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-1); animation: blink 1.2s ease-in-out infinite; }
.g-dots i:nth-child(2) { animation-delay: 0.2s; }
.g-dots i:nth-child(3) { animation-delay: 0.4s; }
.g-check { width: 12px; height: 12px; }
.g-check svg { display: block; width: 12px; height: 12px; }
.pill[data-state="off"] .g-ring,
.pill[data-state="listening"] .g-dot, .pill[data-state="ready"] .g-dot, .pill[data-state="pressed"] .g-dot,
.pill[data-state="hearing"] .g-bars,
.pill[data-state="transcribing"] .g-dots,
.pill[data-state="sent"] .g-check { display: flex; }
.pill[data-state="sent"] .g-check { display: block; }

.ticker { flex: 1; min-width: 0; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%); }
.ticker-text { display: inline-block; padding: 0 10px; transition: transform 300ms linear; color: var(--ink-1); }
.pill[data-state="off"] .ticker-text, .pill[data-state="ready"] .ticker-text, .pill[data-state="pressed"] .ticker-text, .pill[data-state="sent"] .ticker-text { color: var(--ink-2); }

/* the expanded body: grows out of the pill, one shape */
.pill-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 380ms var(--ease-shape); }
.pill-body > div { overflow: hidden; min-height: 0; opacity: 0; transform: translateY(-4px); transition: opacity 200ms ease-in 0ms, transform 200ms ease-in 0ms; }
.pill.expanded .pill-body, .pill[data-state="ready"] .pill-body, .pill[data-state="pressed"] .pill-body { grid-template-rows: 1fr; }
.pill.expanded .pill-body > div, .pill[data-state="ready"] .pill-body > div, .pill[data-state="pressed"] .pill-body > div { opacity: 1; transform: none; transition: opacity 200ms ease-out 100ms, transform 200ms ease-out 100ms; }
.buffer { margin: 2px 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--field-stroke); min-height: 54px; font: 400 13px/18px var(--sys); white-space: normal; }
.buffer .arriving { color: var(--ink-2); }
.prow { display: flex; align-items: center; gap: 4px; padding: 7px 10px; height: 40px; }
.bt { height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--sys); color: var(--ink-2); }
.bt.send { background: var(--ink-1); color: #000; padding: 0 8px 0 12px; }
.pill[data-state="pressed"] .bt.send { background: rgba(255, 255, 255, 0.72); }
.bt.send kbd { font: 500 10.5px/1 var(--mono); opacity: 0.6; }
.hairline { height: 1px; margin: 0 12px; background: var(--hairline); }
.seg { height: 22px; border-radius: 11px; background: var(--field); padding: 2px; display: inline-flex; }
.seg span { height: 18px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; font: 500 11px/1 var(--sys); color: var(--ink-3); }
.seg span.on { background: var(--segment-on); color: var(--ink-1); }
.pill .ink2 { color: var(--ink-2); }

@keyframes breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --gutter: 32px; }
  h1 { font-size: 44px; }
  .grid12 { grid-template-columns: 1fr; row-gap: var(--s8); }
  .grid12 > * { grid-column: auto !important; }
  .three { grid-template-columns: 1fr !important; }
  .row2 { grid-template-columns: 1fr; gap: var(--s2); }
  .row2.narrow { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; --bar-h: 24px; }
  h1 { font-size: 38px; }
  h2 { font-size: 26px; }
  .lede { font-size: 17px; }
  .hero { padding-top: 230px; padding-bottom: 56px; }
  .section-pad { padding-top: var(--s12); padding-bottom: var(--s12); }
  .bar nav { display: none; }
  .bar .wrap { font-size: 12px; }
  .pill { --w: 250px; font-size: 12px; border-radius: 0 0 10px 10px; }
  .pill.wide, .pill[data-state="hearing"], .pill[data-state="transcribing"], .pill[data-state="ready"], .pill[data-state="pressed"] { --w: min(360px, calc(100vw - 24px)); }
  .pill-row { padding: 0 12px; }
  .pill::before, .pill::after { width: 6px; height: 6px; background: radial-gradient(circle at 0 100%, transparent 6px, var(--pill) 6.5px); }
  .pill::before { left: -6px; } .pill::after { right: -6px; }
  .btn { width: 100%; height: 48px; font-size: 16px; }
  .cluster { flex-direction: column; align-items: stretch; }
  .price-box { padding: var(--s6); }
  .stage.tall { height: 260px; }
  footer .wrap { flex-direction: column; gap: var(--s2); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill, .pill-body, .pill-body > div, .ticker-text { transition: none; }
  .g-dot, .g-dots i { animation: none; opacity: 1; }
}
