/* Live Linguist — release v1 page styles
   Vanilla CSS, mobile-first, WCAG AA contrast, reduced-motion aware. */

:root {
  --ink:        #15151c;
  --ink-soft:   #3d3e47;
  --muted:      #5d5e69;
  --line:       #e3e3ea;
  --line-soft:  #eeeef3;
  --bg:         #ffffff;
  --bg-soft:    #f6f6fb;
  --bg-sunk:    #f0f0f7;
  --brand:      #3538cd; /* indigo — matches the figures */
  --brand-deep: #25278f;
  --brand-tint: #ececfb;
  --good:       #1f7a4d;
  --warn:       #9a5a00;
  --radius:     14px;
  --maxw:       72rem;
  --readw:      40rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---- Layout primitives ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

section { padding-block: 3.25rem; border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: none; }
.section-head { max-width: var(--readw); }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.6rem;
}
.prose { max-width: var(--readw); }

h1, h2, h3 { line-height: 1.2; color: var(--ink); letter-spacing: -0.01em; }
h2 { font-size: 1.7rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.4rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }

/* ---- Visible focus everywhere ---- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Top nav ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  gap: 1rem;
}
.brandmark { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brandmark svg { display: block; }
.topnav { display: none; gap: 1.4rem; }
.topnav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.topnav a:hover { color: var(--brand); }
@media (min-width: 56rem) { .topnav { display: flex; } }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding-block: 3.5rem 3rem; background: var(--bg); }
/* Decorative corner glow — a real, non-overlapping element kept clear of the
   text column, so it never enters the text's background-contrast computation. */
.hero-glow {
  position: absolute; top: -30%; right: -10%;
  width: 45%; height: 130%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, var(--brand-tint), rgba(236, 236, 251, 0) 70%);
}
@media (max-width: 55.99rem) { .hero-glow { display: none; } }
.hero > .wrap { position: relative; z-index: 1; }
.hero .release-line {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.release-line .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--good); }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); margin: 0 0 0.9rem; max-width: 18ch; }
.hero .lede { font-size: clamp(1.1rem, 2.5vw, 1.35rem); color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.6rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 1rem;
  padding: 0.7rem 1.15rem; border-radius: 10px;
  text-decoration: none; border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

.whatsin {
  margin-top: 2.25rem; padding: 1.1rem 1.25rem;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); max-width: 46rem;
}
.whatsin h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 0.6rem; }
.whatsin ul { margin: 0; padding-left: 1.1rem; }
.whatsin li { margin-bottom: 0.3rem; color: var(--ink-soft); }
.whatsin li:last-child { margin-bottom: 0; }

/* ---- Plain-language preamble ---- */
.plain {
  background: var(--brand-tint);
  border: none;
}
.plain .prose { max-width: 38rem; }
.plain h2 { font-size: 1.4rem; }
.plain p { font-size: 1.15rem; color: var(--ink); }

/* ---- Callout (rationale) ---- */
.callout {
  border-left: 4px solid var(--brand);
  background: var(--bg-soft);
  padding: 1.1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  max-width: var(--readw);
}
.callout p:last-child { margin-bottom: 0; }
.callout .who { font-style: normal; color: var(--muted); font-size: 0.95rem; }

/* ---- Tables ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 34rem; }
caption { text-align: left; padding: 0.85rem 1rem; color: var(--muted); font-size: 0.9rem; border-bottom: 1px solid var(--line); }
th, td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
thead th { background: var(--bg-sunk); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { font-variant-numeric: tabular-nums; }
.win { color: var(--good); font-weight: 600; }
.lose { color: var(--muted); }

/* ---- Figures ---- */
figure { margin: 1.75rem 0; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.92rem; max-width: var(--readw); }

/* ---- Cards / grids ---- */
.grid { display: grid; gap: 1rem; margin: 1.5rem 0; }
@media (min-width: 40rem) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; background: var(--bg);
}
.card h3 { margin-top: 0; }
.card .meta { color: var(--muted); font-size: 0.9rem; }
.card .modelsize { font-variant-numeric: tabular-nums; }

/* ---- Acknowledgments / credits ---- */
.credits-list { margin: 0.75rem 0 0; padding-left: 1.1rem; }
.credits-list li { margin-bottom: 0.6rem; color: var(--ink-soft); }
.credits-list li:last-child { margin-bottom: 0; }
.credits-list strong { color: var(--ink); }

/* ---- Example transform ---- */
.transform {
  display: grid; gap: 0.75rem; margin: 1.5rem 0; max-width: 46rem;
}
@media (min-width: 38rem) { .transform { grid-template-columns: 1fr auto 1fr; align-items: center; } }
.transform .box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--bg-soft); }
.transform .box .tag { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.4rem; }
.transform .box.out { background: var(--brand-tint); border-color: transparent; }
.transform .box p { margin: 0; font-size: 1.05rem; }
.transform .arrow { text-align: center; color: var(--brand); font-size: 1.4rem; }
@media (max-width: 37.99rem) { .transform .arrow { transform: rotate(90deg); } }

/* ---- Definition list for metrics ---- */
.defs { max-width: var(--readw); }
.defs dt { font-weight: 700; margin-top: 0.9rem; }
.defs dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* ---- Steps ---- */
ol.steps { max-width: var(--readw); padding-left: 1.3rem; }
ol.steps li { margin-bottom: 0.6rem; }
code, pre { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--bg-sunk); padding: 0.1em 0.35em; border-radius: 5px; }
pre { background: var(--ink); color: #f4f4f6; padding: 1rem 1.1rem; border-radius: var(--radius); overflow-x: auto; font-size: 0.86rem; line-height: 1.5; }
pre code { background: none; padding: 0; color: inherit; }

/* ---- Limitations ---- */
.limits ul { max-width: var(--readw); padding-left: 1.15rem; }
.limits li { margin-bottom: 0.5rem; color: var(--ink-soft); }

/* ---- Footer ---- */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  font-size: 0.95rem;
}
footer .cols { display: grid; gap: 1.5rem; }
@media (min-width: 44rem) { footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
footer h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 0.7rem; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 0.35rem; }
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--brand); text-decoration: underline; }
footer .colophon { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }

.lang-tag { display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--brand); background: var(--brand-tint); border-radius: 6px; padding: 0.1rem 0.45rem; }

.metric-note { font-weight: 400; color: var(--muted); }
.footer-tagline { color: var(--ink-soft); max-width: 32ch; margin: 0; }
.footer-by { margin: 1rem 0 0; color: var(--muted); }

/* ---- Download CTA note + run-section download row ---- */
.cta-note { margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; max-width: 46rem; }
.cta-note code { background: var(--bg-sunk); }
.run-download { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; margin: 0 0 1.5rem; max-width: 46rem; }
.run-download .cta-note { margin-top: 0; }
