/* ==========================================================================
   Medovo — landing tokens.
   Palette, spacing and type scale live here and only here. When the React app
   (#6) arrives, these map one-to-one onto a Tailwind config.
   ========================================================================== */

:root {
  /* colour: cool institutional paper, honey accent, brick reserved for role-play */
  --ground:        #e8ebee;
  --surface:       #ffffff;
  --surface-sunk:  #f2f4f6;
  --ink:           #131a21;
  --ink-soft:      #46525e;
  --muted:         #6a7684;
  --rule:          #c7d0d7;
  --rule-soft:     #dbe1e6;
  --accent:        #9a6a05;
  --accent-solid:  #d99a1c;
  --on-accent:     #1a1206;
  --hot:           #a32e1c;

  /* type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-label: 0.75rem;
  --fs-sm:    0.9375rem;
  --fs-base:  1.125rem;
  --fs-lead:  1.25rem;
  --fs-h3:    1.375rem;
  --fs-h2:    1.875rem;
  --fs-h1:    2.375rem;
  --fs-pitch: 1.4375rem;

  /* space */
  --s1: 0.375rem;
  --s2: 0.625rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2.25rem;
  --s6: 3.25rem;
  --s7: 4.5rem;

  --measure: 34rem;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:        #0e1317;
    --surface:       #161d23;
    --surface-sunk:  #1b232a;
    --ink:           #e6eaee;
    --ink-soft:      #b3bfc9;
    --muted:         #8b98a5;
    --rule:          #2e3841;
    --rule-soft:     #232c34;
    --accent:        #e0a63a;
    --accent-solid:  #e0a63a;
    --on-accent:     #16100a;
    --hot:           #e2806c;
  }
}

:root[data-theme="dark"] {
  --ground:        #0e1317;
  --surface:       #161d23;
  --surface-sunk:  #1b232a;
  --ink:           #e6eaee;
  --ink-soft:      #b3bfc9;
  --muted:         #8b98a5;
  --rule:          #2e3841;
  --rule-soft:     #232c34;
  --accent:        #e0a63a;
  --accent-solid:  #e0a63a;
  --on-accent:     #16100a;
  --hot:           #e2806c;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.011em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.021em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; }

p { margin: 0; max-width: var(--measure); }

a { color: inherit; }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.wrap {
  width: min(100% - 2.25rem, 64rem);
  margin-inline: auto;
}

.band { border-top: 1px solid var(--rule-soft); }

.band > .wrap {
  padding-block: var(--s6);
  display: grid;
  gap: var(--s4);
}

/* Wide screens move the section label into a left margin column — the corridor
   of numbered doors the circuit is actually made of. */
@media (min-width: 62rem) {
  .band > .wrap {
    grid-template-columns: 10rem minmax(0, 1fr);
    column-gap: var(--s5);
    padding-block: var(--s7);
  }
  .band > .wrap > .eyebrow { grid-column: 1; margin-top: 0.45rem; }
  .band > .wrap > :not(.eyebrow) { grid-column: 2; }
}

.stack   { display: grid; gap: var(--s3); }
.stack-l { display: grid; gap: var(--s4); }

/* ==========================================================================
   Type utilities
   ========================================================================== */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  line-height: 1.55;
}

.note {
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: var(--measure);
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s3);
  padding-block: var(--s4) 0;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark .dot { color: var(--accent); }

.tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero > .wrap {
  padding-block: var(--s5) var(--s6);
  display: grid;
  gap: var(--s5);
}

.hero h1 { max-width: 16ch; }
.hero .lead { max-width: 32rem; }

.hero-copy { display: grid; gap: var(--s4); }

/* The scene, sitting directly under the headline: the concrete thing the
   service is for, set in the display face so it still carries weight. */
.scene {
  font-family: var(--font-display);
  font-size: var(--fs-pitch);
  line-height: 1.35;
  max-width: 26ch;
  text-wrap: balance;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent-solid);
  border-radius: 50%;
  flex: none;
}

@media (min-width: 62rem) {
  :root { --fs-h1: 3.375rem; --fs-pitch: 1.625rem; }
  .hero > .wrap {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    column-gap: var(--s6);
    align-items: start;
    padding-block: var(--s6) var(--s7);
  }
  .hero .hero-copy { grid-column: 1; grid-row: 1; }
  .hero .prompt-card { grid-column: 2; grid-row: 1; margin-top: 0.5rem; }
}

/* the printed prompt card taped to the station door */

.prompt-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s4);
  display: grid;
  gap: var(--s3);
  max-width: 30rem;
}

.prompt-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt-card__head .clock {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.prompt-card__body {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: none;
}

.prompt-card__foot {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--s2);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
}

.btn {
  display: inline-block;
  background: var(--accent-solid);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  text-decoration: none;
  padding: 0.8125rem 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: filter 140ms ease;
}

.btn:hover { filter: brightness(1.06); }

.btn-quiet {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 140ms ease, border-color 140ms ease;
}

.btn-quiet:hover { color: var(--ink); border-color: var(--accent); }

/* ==========================================================================
   Figures
   ========================================================================== */

figure {
  margin: 0;
  display: grid;
  gap: var(--s3);
  justify-items: start;
}

/* Both diagrams are drawn at ~344 user units so they render close to 1:1 on a
   phone — scaling them down would push the labels under 10px. */
figure svg {
  width: 100%;
  max-width: 22.5rem;
  height: auto;
  color: var(--ink);
}

figcaption {
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: var(--measure);
}

.fig-hot { color: var(--hot); font-weight: 600; }

/* ==========================================================================
   Report anatomy
   ========================================================================== */

.parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s4);
  max-width: 44rem;
}

@media (min-width: 40rem) {
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }
}

.parts h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.parts p { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 0.3rem; }

.parts .num {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.35rem;
}

.specimen {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--s4);
  display: grid;
  gap: var(--s2);
  max-width: var(--measure);
}

.specimen .stamp {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.specimen blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.45;
}

.specimen .tc {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.specimen .verdict { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ==========================================================================
   Audience
   ========================================================================== */

.who { display: grid; gap: var(--s5); max-width: 44rem; }

@media (min-width: 44rem) {
  .who { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }
}

.who h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.who p { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 0.4rem; }

.who .tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}

.who a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.who a:hover { color: var(--ink); }

/* ==========================================================================
   Waitlist
   ========================================================================== */

.waitlist { background: var(--surface); border-top: 1px solid var(--rule); }

.waitlist h2 { max-width: 20ch; }

.ask {
  border-left: 2px solid var(--accent-solid);
  padding-left: var(--s3);
  font-family: var(--font-display);
  font-size: 1.3125rem;
  line-height: 1.45;
  max-width: var(--measure);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-foot { border-top: 1px solid var(--rule); background: var(--ground); }

.site-foot > .wrap {
  padding-block: var(--s5) var(--s6);
  display: grid;
  gap: var(--s3);
}

.slogan { font-family: var(--font-display); font-size: 1.375rem; font-weight: 500; }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  font-size: var(--fs-sm);
}

.foot-links a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.foot-links a:hover { color: var(--ink); border-color: var(--accent); }

.colophon { font-size: var(--fs-sm); color: var(--muted); }

/* ==========================================================================
   Diagrams
   ========================================================================== */

/* Every text class carries its own fill. SVG <text> defaults to black rather
   than currentColor, so leaving it off looks correct in the light palette by
   coincidence and goes black-on-charcoal the moment the dark palette loads. */
.dg-box   { fill: var(--surface); stroke: currentColor; stroke-width: 1.25; }
.dg-line  { stroke: currentColor; stroke-width: 1.25; fill: none; }
.dg-ring  { stroke: currentColor; stroke-width: 1.25; fill: none; opacity: 0.32; }
.dg-key   { fill: currentColor; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; opacity: 0.62; }
.dg-num   { fill: currentColor; font-family: var(--font-mono); font-size: 12.5px; }
.dg-val   { fill: currentColor; font-family: var(--font-body); font-size: 13.5px; }
.dg-said  { fill: currentColor; font-family: var(--font-display); font-size: 14.5px; font-style: italic; }
.dg-lbl   { fill: currentColor; font-family: var(--font-body); font-size: 13px; }
.dg-node  { fill: var(--surface); stroke: currentColor; stroke-width: 1.25; }
.dg-role  { fill: var(--hot); stroke: none; }
.dg-role-num { fill: var(--surface); font-family: var(--font-mono); font-size: 13px; }
.dg-role-lbl { fill: var(--hot); font-family: var(--font-body); font-size: 13px; font-weight: 600; }

/* ==========================================================================
   Waitlist form — Tally embed, mounted on our own page
   ========================================================================== */

.form-mount {
  max-width: 38rem;
  min-height: 260px;
}

.form-mount iframe {
  width: 100%;
  border: 0;
  display: block;
  color-scheme: light dark;
}

/* Stand-in shown only in the Artifact preview, where the sandbox refuses
   third-party frames. Never ships to medovo.app. */
.form-stub {
  max-width: 38rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  background: var(--surface-sunk);
  padding: var(--s4);
  display: grid;
  gap: var(--s2);
}

.form-stub .stamp {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-stub p { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ==========================================================================
   Legal pages — /privacy and /terms
   Same tokens as the landing page, narrower measure: these are read top to
   bottom rather than scanned, so the column is set for reading, not for scale.
   ========================================================================== */

/* The whole legal page narrows, masthead and footer included — otherwise the
   wordmark sits out at 64rem while the text column starts inset, and the page
   reads as a landing page with a document dropped into the middle of it. */
.page-legal .wrap { width: min(100% - 2.25rem, 46rem); }

/* minmax(0, 1fr) rather than an implicit auto track, same as .band > .wrap:
   it pins the column to the container so the subprocessor table, which is
   wider than a phone, scrolls inside its own box instead of widening the
   column under everything else. */
.legal > .wrap {
  padding-block: var(--s5) var(--s7);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3);
  justify-items: start;
}

.legal h1 { max-width: 20ch; margin-top: var(--s2); }

.legal h2 {
  font-size: 1.5rem;
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule-soft);
  width: 100%;
}

.legal h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: var(--s3);
}

.legal p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 40rem;
}

.legal .lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink);
  max-width: 38rem;
}

.legal a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule);
}

.legal a:hover { text-decoration-color: var(--accent); }

.legal-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-list {
  margin: 0;
  padding-left: 1.15rem;
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  display: grid;
  gap: var(--s2);
}

.legal-list::marker, .legal-list li::marker { color: var(--accent); }
.legal-list strong { color: var(--ink); font-weight: 600; }

/* The subprocessor table is the one thing here that can outgrow a phone, so it
   scrolls inside itself rather than pushing the page sideways. */
.legal-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-table table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: var(--fs-sm);
}

.legal-table th, .legal-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--rule-soft);
}

.legal-table th {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-table td { color: var(--ink-soft); }
.legal-table td:first-child { color: var(--ink); font-weight: 500; }
.legal-table tr:last-child td { border-bottom: 0; }

.nowrap { white-space: nowrap; }

/* Unfilled placeholder. Loud on purpose: if one of these ever reaches
   medovo.app it has to be visible from across the room. build.sh lists them. */
.fill {
  background: var(--hot);
  /* --ground rather than a literal white: --hot flips to a light salmon in the
     dark palette, and white on it is unreadable. --ground flips the other way,
     so the pair stays legible in both. */
  color: var(--ground);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.1em 0.4em;
  border-radius: 2px;
}

/* ==========================================================================
   Footer disclaimer — required, see docs/domain-setup.md §4
   ========================================================================== */

.disclaimer {
  font-size: var(--fs-label);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46rem;
  padding-top: var(--s2);
  border-top: 1px solid var(--rule-soft);
}
