/* ==========================================================================
   VoiceWriter — landing page. Compact, centered hero, one animated centerpiece.
   ========================================================================== */

:root {
  --bg:        #000000;
  --panel:     #0c0c0f;
  --panel-2:   #101014;
  --border:    rgba(255, 255, 255, 0.09);
  --border-mid:rgba(255, 255, 255, 0.16);
  --text:      #ededed;
  --dim:       #8a8a8f;
  --accent:    #b23859;
  --accent-2:  #d6486c;
  --accent-press: #8f2947;
  --on-accent: #fff2f5;
  --logo-mark: #340016;

  --maxw: 980px;
  --pad: 24px;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* soft radial glow behind the hero, fixed */
.bg-glow {
  position: fixed;
  inset: -20vh 0 auto 0;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(closest-side at 50% 0%,
      rgba(178, 56, 89, 0.16),
      rgba(178, 56, 89, 0.05) 55%,
      transparent 75%);
  animation: glow 9s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { opacity: 0.75; transform: translateY(0) scale(1); }
  50%      { opacity: 1;    transform: translateY(14px) scale(1.04); }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 9px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em;
  background: transparent; color: var(--text);
  border: 1.5px solid rgba(178, 56, 89, 0.4);
  border-radius: 12px;
  padding: 12px 22px; cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  background-color: rgba(178, 56, 89, 0.08);
  color: #fff; transform: translateY(-1px);
}
.btn-sm { padding: 8px 15px; font-size: 0.9rem; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 1.02rem; border-radius: 13px; }

.btn-ghost { border-color: transparent; color: var(--dim); }
.btn-ghost:hover { border-color: rgba(178, 56, 89, 0.4); color: #fff; }

.btn-accent { color: #fff; border-color: var(--accent); }
.btn-accent:hover {
  border-color: var(--accent-2);
  background-color: rgba(178, 56, 89, 0.14);
  box-shadow: 0 8px 30px -12px rgba(178, 56, 89, 0.6);
}
.btn-accent::after {
  content: ""; flex-shrink: 0; width: 15px; height: 15px; margin-left: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b23859'%3E%3Crect x='3' y='3' width='8.5' height='8.5' rx='1'/%3E%3Crect x='12.5' y='3' width='8.5' height='8.5' rx='1'/%3E%3Crect x='3' y='12.5' width='8.5' height='8.5' rx='1'/%3E%3Crect x='12.5' y='12.5' width='8.5' height='8.5' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-lg.btn-accent::after { width: 17px; height: 17px; }
.sz { font-size: 0.76rem; opacity: 0.65; margin-left: 6px; font-weight: 500; }

/* keycap */
.k, .stage-key .k {
  font-family: var(--font-mono); font-size: 0.72em;
  background: var(--panel-2); border: 1px solid var(--border-mid);
  border-bottom-width: 2px; border-radius: 5px;
  padding: 2px 6px; color: var(--text); margin: 0 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}
.site-header.scrolled {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark { border-radius: 6px; display: block; }

/* ---------- Hero (centered) ---------- */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding-top: 64px;
  padding-bottom: 40px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  margin: 0 auto 20px;
  max-width: 16ch;
}
.ink { position: relative; display: inline-block; color: var(--accent); padding-bottom: 2px; }
.ink-line {
  position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left center;
  animation: ink 3.6s ease-in-out infinite;
}
@keyframes ink {
  0% { transform: scaleX(0); }
  35% { transform: scaleX(1); }
  75% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) { .ink-line { transform: scaleX(1); animation: none; } }

.lead {
  font-size: 1.08rem; color: var(--dim);
  max-width: 52ch; margin: 0 auto 28px;
}
.hero-actions {
  display: flex; gap: 13px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-meta { font-size: 0.85rem; color: var(--dim); margin: 0 0 44px; }

/* ---------- Signature stage: waveform → typed line ---------- */
.stage {
  max-width: 720px; margin: 0 auto;
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), #060608);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(178, 56, 89, 0.06) inset;
  overflow: hidden;
}
.stage-inner { padding: 30px 26px 22px; }

.wave {
  display: flex; align-items: center; justify-content: center;
  gap: 3px; height: 54px; margin-bottom: 22px;
}
.wave i {
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  height: 20%;
  animation: bar 1.1s ease-in-out infinite;
}
.wave i:nth-child(3n)  { animation-delay: -0.15s; }
.wave i:nth-child(3n+1){ animation-delay: -0.45s; }
.wave i:nth-child(4n)  { animation-delay: -0.75s; }
.wave i:nth-child(5n)  { animation-delay: -0.30s; }
@keyframes bar { 0%, 100% { height: 15%; opacity: 0.55; } 50% { height: 92%; opacity: 1; } }
/* dimmed state once the "speaking" is done */
.stage.done .wave i { animation-play-state: paused; height: 14%; opacity: 0.3; }

.typed {
  min-height: 2.4em;
  margin: 0 auto 18px;
  max-width: 42ch;
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.35rem; line-height: 1.55; color: #fff;
  text-align: left;
}
.caret {
  display: inline-block; width: 2px; height: 1.05em;
  background: var(--accent); vertical-align: text-bottom; margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.stage-key {
  font-size: 0.76rem; color: var(--dim);
  border-top: 1px solid var(--border);
  padding-top: 14px; text-align: center;
}

/* ---------- Slab: how + cards ---------- */
.slab { position: relative; z-index: 1; padding-block: 64px; border-top: 1px solid var(--border); }
.slab-head { text-align: center; max-width: 40ch; margin: 0 auto 40px; }
.slab-head h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 10px; }
.slab-head p { color: var(--dim); margin: 0; }

.flow {
  list-style: none; margin: 0 0 44px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.flow li { display: flex; gap: 12px; align-items: flex-start; }
.flow .n {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid rgba(178, 56, 89, 0.5);
}
.flow p { margin: 0; font-size: 0.94rem; color: var(--dim); }
.flow p .k { color: var(--text); }

.flow-compact {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.card:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
  background: var(--panel-2);
}
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card h3::before {
  content: ""; display: block; width: 22px; height: 3px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}
.card p { margin: 0; font-size: 0.92rem; color: var(--dim); }

/* ---------- Refine wheel demo ---------- */
.wheel-slab { border-top: none; }
.wheel-demo {
  display: flex; align-items: center; justify-content: center; gap: 40px;
  flex-wrap: wrap; margin-bottom: 44px;
}
.wheel-svg { width: 220px; height: 220px; flex-shrink: 0; }
.wheel-ring-bg { fill: var(--panel); stroke: var(--border-mid); stroke-width: 1; }
.wedge {
  fill: rgba(178, 56, 89, 0.08);
  stroke: var(--border);
  stroke-width: 1.5;
  transition: fill 0.2s ease;
}
.wheel-svg:hover .wedge { fill: rgba(178, 56, 89, 0.14); }
.wedge.w1 { fill: rgba(178, 56, 89, 0.22); }
.wedge.w2 { fill: rgba(214, 72, 108, 0.16); }
.wedge.w3 { fill: rgba(178, 56, 89, 0.16); }
.wedge.w4 { fill: rgba(214, 72, 108, 0.10); }
.wedge.w5 { fill: rgba(178, 56, 89, 0.10); }
.wedge.w6 { fill: rgba(214, 72, 108, 0.06); }
.wheel-hub { fill: var(--bg); stroke: var(--border-mid); stroke-width: 1.5; }

.wheel-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wheel-legend li {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.92rem; color: var(--dim);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.d1 { background: rgba(178, 56, 89, 0.9); }
.d2 { background: rgba(214, 72, 108, 0.9); }
.d3 { background: rgba(178, 56, 89, 0.6); }
.d4 { background: rgba(214, 72, 108, 0.55); }
.d5 { background: rgba(178, 56, 89, 0.4); }
.d6 { background: rgba(214, 72, 108, 0.35); }

/* ---------- API key cards ---------- */
.keys-cards { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.key-card p:first-of-type { margin-bottom: 16px; }
.key-card .flow-compact .n { border-color: rgba(178, 56, 89, 0.5); }

/* header nav item hidden on small screens to avoid crowding */
@media (max-width: 760px) {
  .nav-hide-sm { display: none; }
}

/* ---------- Download ---------- */
.get { position: relative; z-index: 1; padding-block: 64px 80px; border-top: 1px solid var(--border); }
.get-card {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  border: 1px solid var(--border-mid); border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  position: relative;
}
/* moving gradient hairline on top of the card */
.get-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  background-size: 220% 100%;
  animation: slide 4s linear infinite;
}
@keyframes slide { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .get-card::before { animation: none; } }

.get-main { padding: 40px 36px; }
.get-main h2 { font-size: 1.7rem; margin-bottom: 10px; }
.get-lead { color: var(--dim); margin: 0 0 24px; font-size: 0.95rem; }
.get-btn { width: 100%; margin-bottom: 12px; }
.get-btn-alt { border-color: var(--border-mid); color: var(--dim); }
.get-btn-alt:hover { border-color: var(--accent); color: #fff; }
.get-links { margin: 14px 0 0; font-size: 0.82rem; color: var(--dim); }
.get-links a { color: var(--dim); }
.get-links a:hover { color: var(--accent-2); }

.get-side {
  background: #060608;
  border-left: 1px solid var(--border);
  padding: 36px 30px;
  display: flex; flex-direction: column; gap: 16px;
}
.get-side p { margin: 0; font-size: 0.88rem; color: var(--dim); }
.get-side strong { color: var(--text); font-weight: 600; }

.setup-steps {
  margin-top: 18px;
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  background: var(--panel);
  padding: 26px 30px;
}
.setup-steps-head { margin: 0 0 16px; font-size: 0.95rem; color: var(--text); }
.setup-steps-head strong { color: var(--accent-2); }
.setup-steps .flow-compact { gap: 14px; }
.setup-steps .flow-compact p { color: var(--dim); font-size: 0.92rem; }
.setup-steps .flow-compact strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 30px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--dim);
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--text); }
.footer-brand img { border-radius: 5px; }
.footer-inner a { color: var(--dim); }
.footer-inner a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .flow { grid-template-columns: 1fr; gap: 14px; }
  .cards, .keys-cards { grid-template-columns: 1fr; }
  .get-card { grid-template-columns: 1fr; }
  .get-side { border-left: none; border-top: 1px solid var(--border); }
  .wheel-demo { gap: 24px; }
}
@media (max-width: 520px) {
  .hero { padding-top: 44px; }
  .hero-actions .btn { width: 100%; }
  .typed { font-size: 1.15rem; }
  .get-main, .get-side { padding: 28px 22px; }
  .footer-inner { justify-content: flex-start; }
}
