/* Vocazap (vocazap.app): a dictionary page with one electric colour. Tokens = apps/Vocazap/Design/TOKENS.md and Sources/UI/Theme.swift,
   designed per mode (never inverted). Ink stamp boxes: 1.5px ink border + hard 3px offset ink shadow, no blur. No gradients, no glow. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

:root {
  --paper: #F4F1EA;
  --surface: #FFFFFF;
  --ink: #17161A;
  --on-ink: #F4F1EA;
  --muted: #6B6760;
  --hairline: #DDD8CD;
  --volt: #FFC400;
  --on-volt: #17161A;
  --miss: #D9452B;
  --on-miss: #FFFFFF;
  --cobalt: #2F3BD6;
  --shadow: #17161A;
  --radius: 14px;
  --serif: "Newsreader", "New York", ui-serif, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121318;
    --surface: #1C1D24;
    --ink: #F1EEE6;
    --on-ink: #121318;
    --muted: #9C9AA3;
    --hairline: #2C2E37;
    --volt: #FFD23F;
    --miss: #FF6B55;
    --cobalt: #8C93FF;
    --shadow: #000000;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { overflow-wrap: break-word; font-family: var(--serif); font-weight: 650; letter-spacing: -0.01em; line-height: 1.12; margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: 8px; z-index: 9; }
.skip:focus { left: 16px; }

/* The stamp */
.stamp {
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 3px 3px 0 0 var(--shadow);
}
@media (prefers-color-scheme: dark) { .stamp { box-shadow: 3px 3px 0 0 var(--ink); } }

.pos { font-family: var(--serif); font-style: italic; color: var(--cobalt); margin: 0; }

/* Header */
.top {
  max-width: 1080px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--hairline);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 22px; }
.brand img { border-radius: 8px; }
.top-nav { display: flex; gap: 22px; }
.top-nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.top-nav a:hover { text-decoration: underline; }
@media (max-width: 720px) { .top-nav { display: none; } }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 64px 0; border-bottom: 1px solid var(--hairline); }
section:last-child { border-bottom: 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2, .edition h2, .faq h2 { font-size: clamp(30px, 4.4vw, 42px); }
.section-head p { color: var(--muted); margin: 10px 0 0; font-size: 19px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 56px; }
.hero h1 { font-size: clamp(38px, 6vw, 62px); font-weight: 700; }
.lead { font-size: 20px; color: var(--ink); margin: 20px 0 28px; max-width: 34em; }
.lead-sm { font-size: 19px; margin: 12px 0 20px; }
.soon { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.soon-stamp {
  display: inline-block; font-weight: 700; font-size: 16px; padding: 12px 18px; border-radius: 10px;
  background: var(--volt); color: var(--on-volt); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 0 var(--shadow);
}
@media (prefers-color-scheme: dark) { .soon-stamp { border-color: var(--volt); box-shadow: 3px 3px 0 0 #000; } }
.soon-note { color: var(--muted); font-size: 15px; }
.badge img { height: 53px; width: auto; }
.badge.small img { height: 40px; }

.entry { position: relative; padding: 28px 28px 26px; }
.entry-head { margin: 0 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.entry-word { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1; }
.entry .pos { font-size: 20px; }
.senses { margin: 0; padding-left: 1.4em; font-family: var(--serif); font-size: 20px; line-height: 1.45; }
.senses li { padding-left: 4px; margin-bottom: 6px; }
.senses li::marker { font-weight: 700; }
.entry-ex { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 18px; }
.entry .bolt { position: absolute; top: -22px; right: 20px; width: 40px; height: 54px; }
.bolt path { fill: var(--volt); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .bolt path { stroke: #000; } }

/* How a round works */
.round-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.card { margin: 0; padding: 26px 22px 22px; }
.card-word { font-family: var(--serif); font-weight: 700; font-size: 44px; line-height: 1; margin: 0 0 4px; }
.card .pos { font-size: 19px; margin-bottom: 18px; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice {
  width: 100%; min-height: 52px; text-align: left; font: 500 17px/1.35 var(--sans); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--hairline); border-radius: 12px; padding: 12px 16px; cursor: pointer;
}
.card.live .choice { transition: background-color .18s ease, border-color .18s ease, transform .12s ease; }
.choice:hover { border-color: var(--ink); }
.card[data-state="ask"] .choice:active { transform: translate(2px, 2px); }
.card[data-state="answered"] .choice { cursor: default; }
.card[data-state="answered"] .choice.is-right { background: var(--volt); color: var(--on-volt); border-color: var(--ink); }
.card[data-state="answered"] .choice.is-wrong { background: var(--miss); color: var(--on-miss); border-color: var(--miss); }
.card[data-state="answered"] .choice:not(.is-right):not(.is-wrong) { opacity: .55; }
.card.zapped .choice.is-right { animation: zap .32s ease-out; }
@keyframes zap { 0% { transform: translateX(-4px); } 40% { transform: translateX(3px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .card.zapped .choice.is-right { animation: none; } .choice { transition: none; } }
.card figcaption { margin-top: 16px; min-height: 4.6em; }
.card-status { margin: 0; font-weight: 700; }
.card[data-state="ask"] .card-status { font-weight: 400; color: var(--muted); }
.card-ex { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 18px; }
.card[data-state="ask"] .card-ex { visibility: hidden; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; }
.step-n {
  grid-row: span 2; width: 40px; height: 40px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 10px;
  font: 700 19px/1 var(--num);
}
.steps h3 { font-size: 23px; align-self: center; }
.steps p { margin: 4px 0 0; color: var(--muted); }

/* Today's edition */
.edition { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 3px;
  background: var(--volt); border: 1.5px solid var(--ink);
}
.share { margin: 0 auto; width: 100%; max-width: 380px; padding: 22px 22px 18px; }
.share-mast {
  display: flex; justify-content: space-between; margin: 0 0 6px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.share-mast span:last-child { font-weight: 500; font-style: italic; color: var(--muted); }
.share-score { margin: 10px 0 12px; font: 800 64px/1 var(--num); letter-spacing: -0.02em; }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.stamps li { aspect-ratio: 1; border-radius: 5px; border: 1.5px solid var(--ink); }
.stamps .hit { background: var(--volt); }
.stamps .miss { background: transparent; border-color: var(--miss); position: relative; }
.stamps .miss::after { content: ""; position: absolute; inset: 22%; border-radius: 2px; background: var(--miss); }
.share-line { margin: 14px 0 0; font-weight: 600; }
.share figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Price */
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.plan { padding: 24px; }
.plan-free { border: 1.5px dashed var(--hairline); border-radius: var(--radius); }
.plan h3 { font-size: 26px; margin-bottom: 12px; }
.amount { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.amount .big { font: 800 52px/1 var(--num); letter-spacing: -0.02em; }
.amount .once { font-size: 18px; font-weight: 600; }
.or { margin: 6px 0 18px; color: var(--muted); font-size: 15px; }
.fine { color: var(--muted); font-size: 14px; margin: 18px 0 0; }

/* FAQ */
.faq h2 { margin-bottom: 18px; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative;
  font-family: var(--serif); font-weight: 600; font-size: 21px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 26px/1 var(--sans); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 20px; max-width: 46em; }

/* Closing */
.closing { text-align: center; padding: 72px 0 80px; }
.closing .bolt { width: 34px; height: 46px; margin: 0 auto 18px; }
.closing h2 { font-size: clamp(30px, 4.6vw, 44px); }
.closing p { color: var(--muted); font-size: 19px; margin: 12px auto 26px; max-width: 30em; }
.closing .soon { justify-content: center; }

/* Footer */
.foot { border-top: 1.5px solid var(--ink); margin-top: 0; }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 32px 16px 12px; display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.foot-brand p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.foot-brand .soon-line { font-weight: 600; color: var(--ink); }
.foot-links { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.foot-langs h2 { font-size: 16px; margin-bottom: 8px; }
.foot-langs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.foot-base { max-width: 1080px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: 13px; }
.foot-base p { margin: 4px 0; }

/* Legal and 404 pages */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 0 72px; }
.doc .eyebrow { font-family: var(--serif); font-style: italic; color: var(--cobalt); font-size: 18px; margin-bottom: 6px; }
.doc h1 { font-size: clamp(34px, 5vw, 46px); }
.doc .updated { color: var(--muted); margin: 8px 0 28px; font-size: 15px; }
.doc h2 { font-size: 25px; margin: 36px 0 10px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.doc .summary { padding: 18px 20px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.doc address { font-style: normal; color: var(--muted); margin-top: 8px; }

/* Phone width */
@media (max-width: 860px) {
  .hero, .round-grid, .edition, .plans { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero { padding-top: 40px; }
  section { padding: 48px 0; }
  .entry { margin-top: 12px; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .lead { font-size: 18px; }
  .entry { padding: 22px 18px 20px; }
  .entry-word { font-size: 34px; }
  .senses { font-size: 18px; }
  .card { padding: 22px 16px 18px; }
  .card-word { font-size: 38px; }
  .share-score { font-size: 54px; }
  .stamps { gap: 4px; }
}
