/* Lemmata website. Tokens come from docs/pitch.html in the app repo: cool paper grey, ink,
   and non-photo blue (the proofreader's pencil). Layout: one reading column per page, with
   wider "proof sheets" for downloads and screenshots. */
:root {
  --paper: #f3f4f2;
  --sheet: #ffffff;
  --ink: #18212b;
  --muted: #5b6672;
  --rule: #d8dcdf;
  --blue: #2f7fb8;
  --blue-ink: #ffffff;
  --blue-soft: #e3eff8;
  --mark: #c4472f;
  --ok: #2e7d55;
  --warn: #8a6410;
  --chrome: #e7e9eb;
  --code-bg: #18212b;
  --code-ink: #e4e8ec;
  --code-dim: #8794a1;
  --f-display: "Young Serif", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --f-tex: "STIX Two Text", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #12171c; --sheet: #1a2027; --ink: #e4e8ec; --muted: #97a3ae; --rule: #2c343d;
  --blue: #6fb3e3; --blue-ink: #0f1a24; --blue-soft: #1d2f3f; --mark: #e9765f; --ok: #5fbf8a; --warn: #e0b45a;
  --chrome: #20272f; --code-bg: #0f1418; --code-ink: #d5dde3; --code-dim: #7d8a95;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #12171c; --sheet: #1a2027; --ink: #e4e8ec; --muted: #97a3ae; --rule: #2c343d;
  --blue: #6fb3e3; --blue-ink: #0f1a24; --blue-soft: #1d2f3f; --mark: #e9765f; --ok: #5fbf8a; --warn: #e0b45a;
  --chrome: #20272f; --code-bg: #0f1418; --code-ink: #d5dde3; --code-dim: #7d8a95;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--blue-soft); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.col { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font: 500 .75rem/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
section { padding-block: 56px 0; }

/* ---------- header / footer ---------- */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: 8px 24px; min-height: 64px; flex-wrap: wrap; padding-block: 10px; }
.wordmark { font-family: var(--f-display); font-size: 1.45rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark svg { width: 28px; height: 28px; flex: none; }
.top nav { display: flex; gap: 4px 20px; flex-wrap: wrap; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .97rem; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 6px; }

footer { margin-top: 88px; border-top: 1px solid var(--rule); padding-block: 28px 40px; font-size: .92rem; color: var(--muted); }
footer .wrap { display: flex; gap: 10px 26px; flex-wrap: wrap; align-items: baseline; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
footer .made { margin-left: auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 1rem/1.2 var(--f-body); border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); padding: 11px 18px; border-radius: 6px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn small { font-weight: 400; opacity: .85; font-size: .85em; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.sm { padding: 6px 11px; font-size: .9rem; }

.badge { display: inline-block; font: 500 .72rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 3px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); vertical-align: middle; }

/* ---------- hero ---------- */
.hero { padding-block: 64px 8px; }
.hero .grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: end; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.hero .rel { font: .85rem var(--f-mono); color: var(--muted); }
.definition { justify-self: end; max-width: 340px; border: 1px dashed var(--blue); padding: 16px 18px; transform: rotate(-1.2deg); background: var(--sheet); }
.definition .w { font-family: var(--f-display); font-size: 1.5rem; }
.definition .p { font: .8rem var(--f-mono); color: var(--muted); margin-left: 6px; }
.definition .d { font-family: var(--f-tex); font-style: italic; font-size: 1.1rem; color: var(--ink); margin-top: 4px; }

/* ---------- screenshot placeholders ---------- */
.shot { margin-top: 44px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 40px -24px rgb(10 20 30 / .35); }
.shot .bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--chrome); border-bottom: 1px solid var(--rule); font: .8rem var(--f-mono); color: var(--muted); }
.shot .bar .dots { display: flex; gap: 6px; }
.shot .bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--rule); display: block; }
.shot picture, .shot img { display: block; width: 100%; height: auto; }
.shot .ph { aspect-ratio: 16 / 9; max-width: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); font: .9rem var(--f-mono);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--rule) 45%, transparent) 14px 15px); }
.shot .ph span { background: var(--sheet); border: 1px dashed var(--rule); padding: 8px 14px; border-radius: 4px; }
.shot.small .ph { aspect-ratio: 4 / 3; }

/* ---------- feature highlights ---------- */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.feat { background: var(--sheet); border: 1px solid var(--rule); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.feat .n { font: 500 .8rem var(--f-mono); color: var(--blue); }
.feat p { color: var(--muted); }
.feat .ex { margin-top: auto; font: .84rem/1.5 var(--f-mono); background: var(--paper); border: 1px solid var(--rule); padding: 10px 12px; border-radius: 4px; overflow-x: auto; white-space: pre; color: var(--ink); }
.feat .ex .dim { color: var(--muted); }
.feat .ex .err { color: var(--mark); }
.feat .ex .k { color: var(--blue); }
.offline { margin-top: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 20px 24px; border: 1px solid var(--rule); border-left: 3px solid var(--blue); background: var(--sheet); }
.offline .n { font: 500 .8rem var(--f-mono); color: var(--blue); }
.offline p { color: var(--muted); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 26px; border-top: 2px solid var(--rule); counter-reset: s; }
.steps > div { padding: 18px 20px 0 0; counter-increment: s; display: flex; flex-direction: column; gap: 6px; position: relative; }
.steps > div::before { content: "Step " counter(s); font: 500 .78rem var(--f-mono); color: var(--blue); }
.steps > div::after { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--blue); }
.steps h3 { font-family: var(--f-body); font-weight: 600; font-size: 1.05rem; }
.steps p { color: var(--muted); font-size: .96rem; }

/* ---------- commands with copy ---------- */
.cmd { position: relative; margin-top: 8px; }
.cmd pre { margin: 0; padding: 12px 70px 12px 14px; background: var(--code-bg); color: var(--code-ink); border-radius: 6px; font: .88rem/1.6 var(--f-mono); overflow-x: auto; white-space: pre; }
.cmd pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.cmd pre .c { color: var(--code-dim); }
.cmd .copy { position: absolute; top: 7px; right: 7px; font: 500 .78rem var(--f-mono); padding: 4px 9px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--code-ink) 25%, transparent); background: transparent; color: var(--code-ink); cursor: pointer; }
.cmd .copy:hover { border-color: var(--blue); }

/* ---------- download page ---------- */
.relhead { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; margin-top: 8px; font: .9rem var(--f-mono); color: var(--muted); }
.relhead b { color: var(--ink); font-weight: 500; }
.plat { margin-top: 34px; background: var(--sheet); border: 1px solid var(--rule); }
.plat.mine { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.plat-h { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 18px 22px 14px; border-bottom: 1px solid var(--rule); }
.plat-h h2 { font-size: 1.55rem; }
.plat-h .yours { font: 500 .72rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.plat-h .sub { color: var(--muted); font-size: .95rem; }
.files { width: 100%; border-collapse: collapse; font-size: .93rem; }
.files th { text-align: left; font: 500 .7rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 22px 8px; border-bottom: 1px solid var(--rule); }
.files td { padding: 12px 22px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.files tr:last-child td { border-bottom: 0; }
.files .fn { font-family: var(--f-mono); font-size: .86rem; overflow-wrap: anywhere; }
.files .what { color: var(--muted); font-size: .88rem; display: block; margin-top: 2px; font-family: var(--f-body); }
.files .rec { font: 500 .66rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin-left: 6px; }
.files .size { white-space: nowrap; font-family: var(--f-mono); font-size: .86rem; color: var(--muted); }
.files .sha { font: .74rem/1.45 var(--f-mono); color: var(--muted); overflow-wrap: anywhere; max-width: 34ch; }
.files .get { text-align: right; white-space: nowrap; }
.files-wrap { overflow-x: auto; }
.howto { padding: 16px 22px 20px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.howto h3 { font-family: var(--f-body); font-weight: 600; font-size: 1rem; }
.howto p { color: var(--muted); font-size: .95rem; }
.unsigned { margin: 0 22px 18px; padding: 10px 14px; border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); font-size: .93rem; }
.unsigned b { color: var(--warn); }
.notice { padding: 14px 18px; border: 1px solid var(--rule); border-left: 3px solid var(--warn); background: var(--sheet); margin-top: 20px; }

/* ---------- TeX page ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-top: 26px; }
.tabs button { border: 0; background: none; font: 500 .97rem var(--f-body); color: var(--muted); padding: 10px 14px 12px; position: relative; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--blue); }
.tabpanel { background: var(--sheet); border: 1px solid var(--rule); border-top: 0; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.variant h3 { font-family: var(--f-body); font-weight: 600; font-size: 1rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.variant h3 span { font: .82rem var(--f-mono); color: var(--muted); font-weight: 400; }
.variant p { color: var(--muted); font-size: .95rem; }
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.checklist li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; font-size: .95rem; }
.checklist code { justify-self: start; }

/* ---------- changelog ---------- */
.release { padding-block: 34px; border-bottom: 1px solid var(--rule); }
.release-h { display: flex; gap: 6px 14px; align-items: baseline; flex-wrap: wrap; }
.release-h h2 { font-size: 1.7rem; }
.release-h time { font: .88rem var(--f-mono); color: var(--muted); }
.release-h a { font-size: .9rem; margin-left: auto; }
.notes { margin-top: 14px; max-width: 72ch; }
.notes h3 { font-family: var(--f-body); font-weight: 600; font-size: 1rem; margin: 18px 0 6px; }
.notes ul { margin: 0; padding-left: 20px; color: var(--ink); }
.notes li { margin-block: 3px; }
.notes p { margin-block: 8px; color: var(--muted); }

/* ---------- prose blocks ---------- */
.prose { display: flex; flex-direction: column; gap: 12px; max-width: 68ch; }
.prose p { color: var(--muted); }
ol.plain { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); }
ol.plain b { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .hero .grid { grid-template-columns: minmax(0, 1fr); }
  .definition { justify-self: start; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 2px solid var(--rule); }
  .steps > div { padding: 0 0 22px 22px; }
  .steps > div::after { top: 4px; left: -7px; }
}
@media (max-width: 620px) {
  .files thead { display: none; }
  .files tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; border-bottom: 1px solid var(--rule); gap: 4px 12px; }
  .files tr:last-child { border-bottom: 0; }
  .files td { padding: 0; border: 0; }
  .files .fn { grid-column: 1 / -1; }
  .files .sha { grid-column: 1 / -1; max-width: none; }
  .files .get { grid-row: 2; grid-column: 2; }
  .plat-h, .howto { padding-inline: 16px; }
  .unsigned { margin-inline: 16px; }
  .tabpanel { padding: 16px; }
  .checklist li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .offline { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  footer .made { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
