/* ==========================================================================
   PlainVoice website - Tessera design system (dark only)
   Tokens lifted from the app's Brand/Brand.swift so the site matches 1:1.
   ========================================================================== */

/* ---- Fonts (self-hosted, same files as the app) ---- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* surfaces */
  --page:        #0F1F1C;
  --card:        #162B27;
  --sunken:      #0A1714;
  /* accent */
  --pulse:       #C9F24A;
  --citron:      #EDE57A;  /* hover only */
  /* support (decorative only) */
  --lavender:    #C2A4DE;
  --violet:      #A98BE8;
  /* text */
  --paper:       #F4F2EA;
  --mist:        #9AA29B;
  --mist-deep:   #6E7672;
  /* hairlines */
  --line:        rgba(244, 242, 234, 0.10);
  --line-hover:  rgba(244, 242, 234, 0.18);
  /* stamp */
  --stamp:       rgba(201, 242, 74, 0.32);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1200px;
  --r-pill: 999px;
  --r-card: 16px;
  --r-input: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { list-style: none; padding: 0; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Type primitives ---- */
.display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  padding-bottom: 0.08em;           /* italic descender clearance */
  font-size: clamp(2.6rem, 6vw, 4.6rem);
}
.display--mid { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.display--big { font-size: clamp(2.4rem, 5.2vw, 4rem); }

.stamp {
  position: relative;
  font-style: italic;
  white-space: nowrap;
}
.stamp::before {
  content: "";
  position: absolute;
  left: -0.12em; right: -0.12em;
  top: 12%; bottom: 12%;
  background: var(--stamp);
  border-radius: 4px;
  transform: rotate(-1.4deg);
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}
.eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pulse);
  box-shadow: 0 0 10px 1px rgba(201, 242, 74, 0.7);
}

.prose {
  color: var(--mist);
  max-width: 58ch;
  font-size: 1.06rem;
  line-height: 1.65;
}
.prose--center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--pulse {
  background: var(--pulse);
  color: #0A1714;
  padding: 13px 14px 13px 22px;
}
.btn--pulse:hover { background: var(--citron); transform: translateY(-2px); }
.btn--pulse:active { transform: translateY(0) scale(0.99); }
.btn__chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #0A1714; color: var(--pulse);
}
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line-hover);
}
.btn--ghost:hover { border-color: var(--paper); transform: translateY(-1px); }

.keycap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--paper);
  background: var(--sunken);
  border: 1px solid var(--line-hover);
  border-radius: 8px;
}

/* ---- Masthead ---- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(15, 31, 28, 0.72);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 24px;
}
.wordmark {
  font-family: var(--serif); font-style: italic; font-size: 26px;
  letter-spacing: -0.01em; color: var(--paper);
}
.wordmark--sm { font-size: 22px; }
.mast-nav { display: flex; gap: 28px; }
.mast-nav a {
  font-size: 14px; color: var(--mist); position: relative; padding: 4px 0;
  transition: color 0.2s var(--ease);
}
.mast-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--pulse); transition: right 0.3s var(--ease);
}
.mast-nav a:hover { color: var(--paper); }
.mast-nav a:hover::after { right: 0; }
.masthead__right { display: flex; align-items: center; gap: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--mist);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
}
.chip__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pulse);
  box-shadow: 0 0 8px 1px rgba(201, 242, 74, 0.7);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---- Section rhythm ---- */
main > section { padding: clamp(72px, 11vw, 132px) 0; }
main > section[id] { scroll-margin-top: 72px; }   /* anchors land below the sticky masthead */
.section-head { margin-bottom: clamp(36px, 5vw, 60px); }
.section-head .eyebrow { margin-bottom: 18px; }

/* ---- Hero ---- */
.hero { padding-top: clamp(48px, 7vw, 92px); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.display { overflow-wrap: break-word; }
.hero__copy .eyebrow { margin-bottom: 22px; }
.hero .display { margin-bottom: 26px; }
.lede { color: var(--mist); font-size: 1.16rem; line-height: 1.6; max-width: 44ch; }
.hero__actions {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 34px;
}
.hero__hotkey {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--mist-deep);
}
.hero__hotkey span { margin-left: 4px; }

.hero__media { position: relative; }
.shot {
  border: 1px solid var(--line-hover);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--sunken);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgba(244, 242, 234, 0.06);
}

/* ---- Dictation HUD demo (hero) ----
   A looping "hold hotkey → speak → text pops in" vignette that mirrors the
   app's real floating HUD. States driven by JS: .is-listening / .is-typing / .is-idle */
.hud {
  position: absolute;
  left: -26px; bottom: -30px;
  z-index: 2;
  width: min(380px, 94%);
  padding: 15px 18px 13px;
  background: rgba(22, 43, 39, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-hover);
  border-radius: var(--r-card);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
}
.hud__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hud__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mist-deep);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hud.is-listening .hud__dot {
  background: var(--pulse);
  box-shadow: 0 0 10px 1px rgba(201, 242, 74, 0.7);
  animation: pulse 1.6s var(--ease) infinite;
}
.hud__bars { display: flex; align-items: center; gap: 3px; height: 20px; flex: 1; }
.hud__bars i {
  width: 3px; height: 4px; border-radius: 2px;
  background: var(--pulse); opacity: 0.9;
  transition: height 0.35s var(--ease);
}
.hud.is-listening .hud__bars i { animation: hudbar 0.72s ease-in-out infinite alternate; }
.hud__bars i:nth-child(1) { --h: 9px;  animation-delay: 0ms; }
.hud__bars i:nth-child(2) { --h: 15px; animation-delay: 110ms; }
.hud__bars i:nth-child(3) { --h: 11px; animation-delay: 60ms; }
.hud__bars i:nth-child(4) { --h: 19px; animation-delay: 170ms; }
.hud__bars i:nth-child(5) { --h: 13px; animation-delay: 40ms; }
.hud__bars i:nth-child(6) { --h: 17px; animation-delay: 140ms; }
.hud__bars i:nth-child(7) { --h: 10px; animation-delay: 90ms; }
.hud__bars i:nth-child(8) { --h: 16px; animation-delay: 200ms; }
.hud__bars i:nth-child(9) { --h: 12px; animation-delay: 50ms; }
@keyframes hudbar { from { height: 4px; } to { height: var(--h, 14px); } }
.keycap--hud { height: 24px; font-size: 12px; transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease); }
.hud.is-listening .keycap--hud {
  transform: translateY(1px);
  border-color: rgba(201, 242, 74, 0.55);
  color: var(--pulse);
}
.hud__line {
  min-height: calc(1.5em * 2);
  font-size: 15px; line-height: 1.5;
  color: var(--paper);
}
.hud__w {
  display: inline-block;
  opacity: 0; transform: translateY(6px);
  animation: wordin 0.35s var(--ease) forwards;
}
@keyframes wordin { to { opacity: 1; transform: none; } }
.hud__caret {
  display: inline-block;
  width: 2px; height: 1.05em;
  margin-left: 3px; vertical-align: -0.12em;
  background: var(--pulse);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---- Problem ---- */
.problem { border-top: 1px solid var(--line); }
.problem__inner { max-width: 900px; }
.problem .display { margin-bottom: 24px; }

/* ---- How it works ---- */
.how { border-top: 1px solid var(--line); }
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.step {
  padding: 34px 30px 30px 0;
  border-right: 1px solid var(--line);
}
.step:last-child { border-right: 0; padding-right: 0; }
.step__num {
  font-family: var(--serif); font-style: italic; font-size: 2.6rem;
  color: var(--pulse); display: block; line-height: 1; margin-bottom: 20px;
}
.step__title { font-size: 1.3rem; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.step__body { color: var(--mist); font-size: 1rem; max-width: 34ch; }

/* ---- Privacy ---- */
.privacy { border-top: 1px solid var(--line); background: var(--sunken); }
.privacy__inner {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(36px, 6vw, 84px); align-items: center;
}
.privacy .display { margin-bottom: 26px; }
.stats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.stat { background: var(--page); padding: 22px 26px; }
.stat__k { font-size: 13px; color: var(--mist); letter-spacing: 0.01em; }
.stat__v {
  font-family: var(--serif); font-style: italic; color: var(--pulse);
  font-size: 2.4rem; line-height: 1.1; margin-top: 4px;
}

/* ---- Features bento ---- */
.features { border-top: 1px solid var(--line); }
.bento {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.cell:hover { border-color: var(--line-hover); transform: translateY(-3px); }
.cell--wide { grid-column: span 2; }
.cell__title { font-size: 1.22rem; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.cell__body { color: var(--mist); font-size: 1rem; max-width: 46ch; }

/* first wide cell tinted with the product screenshot vibe via a soft gradient */
.cell--wide:first-child {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 242, 74, 0.10), transparent 46%),
    var(--card);
}

/* ---- Translation ---- */
.translate { border-top: 1px solid var(--line); background: var(--sunken); }
.translate__grid {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 80px); align-items: center;
}
.translate .display { margin-bottom: 22px; }
.translate__demo { display: grid; gap: 16px; justify-items: stretch; }
.tcard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 22px 24px;
}
.tcard--out { border-color: rgba(201, 242, 74, 0.28); }
.tcard__lang {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--mist-deep);
}
.tcard__text {
  font-family: var(--serif); font-style: italic; font-size: 1.5rem;
  line-height: 1.3; margin-top: 8px;
}
.tcard__text--muted { color: var(--mist); }
.tcard--out .tcard__text { color: var(--paper); }
.tcard__arrow { display: flex; justify-content: center; color: var(--pulse); }

/* Output words pop in one-by-one once the demo scrolls into view (spans added by JS). */
.js .tw { display: inline-block; opacity: 0; transform: translateY(8px); }
.js .translate__demo.is-in .tw { animation: wordin 0.45s var(--ease) forwards; }
.js .translate__demo.is-in .tcard__arrow svg { animation: nudge 1.4s var(--ease) 0.15s 2; }
@keyframes nudge { 50% { transform: translateX(6px); } }

/* ---- Requirements ---- */
.reqs { border-top: 1px solid var(--line); }
.reqs__inner {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
}
.req { padding: 24px 26px; border-right: 1px solid var(--line); }
.req:last-child { border-right: 0; }
.req__k { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--mist-deep); margin-bottom: 8px; }
.req__v { font-size: 1.08rem; color: var(--paper); font-weight: 500; }

/* ---- Waitlist ---- */
.waitlist { border-top: 1px solid var(--line); }
.waitlist__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.waitlist .display { margin-bottom: 22px; }
.wl-form { margin-top: 36px; }
.wl-form__row {
  display: flex; gap: 12px; max-width: 520px; margin: 0 auto;
}
.field {
  flex: 1; min-width: 0;
  background: var(--sunken);
  border: 1px solid var(--line-hover);
  border-radius: var(--r-input);
  color: var(--paper);
  font-family: var(--sans); font-size: 16px;
  padding: 14px 16px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field::placeholder { color: var(--mist-deep); }
.field:focus {
  outline: none;
  border-color: var(--pulse);
  box-shadow: 0 0 0 3px rgba(201, 242, 74, 0.18);
}
.wl-form .btn--pulse { padding: 13px 14px 13px 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wl-form__msg { min-height: 22px; margin-top: 16px; font-size: 14px; color: var(--mist); }
.wl-form__msg.is-ok { color: var(--pulse); }
.wl-form__msg.is-err { color: #E8B7B0; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.footer__line { color: var(--mist); font-size: 14px; }
.footer__meta { color: var(--mist-deep); font-size: 13px; }
.footer__link { color: var(--mist); border-bottom: 1px solid var(--line-hover); transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.footer__link:hover { color: var(--pulse); border-color: var(--pulse); }

/* ---- Reveal on scroll (only hides when JS can bring it back) ---- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hud { position: relative; left: 0; bottom: 0; margin: -34px auto 0; width: min(380px, 100%); }
  .privacy__inner, .translate__grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
  .step:last-child { border-bottom: 0; }
  .bento { grid-template-columns: 1fr 1fr; }
  .cell--wide { grid-column: span 2; }
  .reqs__inner { grid-template-columns: 1fr 1fr; }
  .req:nth-child(2) { border-right: 0; }
  .req:nth-child(1), .req:nth-child(2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .mast-nav { display: none; }
  .masthead__inner { height: 60px; }
  .chip { display: none; }
  .masthead__right .btn { display: none; }   /* hero + waitlist carry the CTA on small screens */
  .hero .display { font-size: clamp(2.15rem, 9vw, 2.9rem); }
  .lede { font-size: 1.05rem; max-width: 100%; }
  .hero__actions { gap: 16px; }
  .bento { grid-template-columns: 1fr; }
  .cell--wide { grid-column: span 1; }
  .reqs__inner { grid-template-columns: 1fr; }
  .req { border-right: 0; border-bottom: 1px solid var(--line); }
  .req:last-child { border-bottom: 0; }
  .wl-form__row { flex-direction: column; }
  .wl-form .btn--pulse { justify-content: center; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .btn, .cell, .mast-nav a::after { transition: none; }
  /* HUD + translate demos fall back to a complete static frame */
  .hud__w, .js .tw { opacity: 1 !important; transform: none !important; }
  .hud__caret { display: none; }
  .hud__bars i { height: var(--h, 10px) !important; }
}
