/* jymmy site: paper and ink from docs/design/DESIGN-SYSTEM.md §2, system fonts only.
   No scripts, no web fonts, no images from other hosts. */

:root {
  color-scheme: light dark;
  --paper: #F2F2F4;
  --surface: #FFFFFF;
  --ink: #111113;
  --ink-muted: #6E6E78;
  --line: #DADAE0;
  --accent: #FF6B4A;
  --display: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A0A0B;
    --surface: #151517;
    --ink: #F4F4F5;
    --ink-muted: #8A8A93;
    --line: #27272B;
  }
}

@media (prefers-contrast: more) {
  :root { --paper: #FFFFFF; --surface: #FFFFFF; --ink: #000000; --ink-muted: #4A4A52; --line: #A8A8B0; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --paper: #000000; --surface: #1C1C1F; --ink: #FFFFFF; --ink-muted: #B4B4BC; --line: #4A4A52; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-wrap: break-word;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

/* Top bar: wordmark and the two pages. */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font: 800 1.5rem/1 var(--display);
  font-stretch: 125%;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark::after { content: "."; color: var(--accent); }
.top nav { display: flex; gap: 1.25rem; }
.top nav a, .label, .meta, footer, .lang {
  font: 600 0.8125rem/1.5 var(--mono);
}
.top nav a { color: var(--ink-muted); text-decoration: none; padding: 0.75rem 0; }
.top nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }

h1, h2, h3 { font-family: var(--display); font-stretch: 125%; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 2.125rem; line-height: 1.1; font-weight: 800; margin: 2.5rem 0 0.5rem; }
h2 { font-size: 1.375rem; line-height: 1.2; font-weight: 700; margin: 2.75rem 0 0.5rem; }
h3 { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; margin: 1.75rem 0 0.25rem; }

p, ul, ol, dl { margin: 0.75rem 0; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.4rem 0; }
li::marker { color: var(--ink-muted); }
strong { font-weight: 650; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.meta { color: var(--ink-muted); font-weight: 500; margin: 0 0 1.5rem; }
.label { color: var(--ink-muted); text-transform: lowercase; margin: 2rem 0 0.25rem; }
.lead { font-size: 1.1875rem; line-height: 1.5; }

/* A card: surface fill, hairline, no shadow (DESIGN-SYSTEM §4). */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2, .card h3 { margin-top: 0; }

/* The home page's two links, and the table of contents. */
.links { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; }
.links a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  text-decoration: none;
}
.links a:hover { border-color: var(--ink-muted); }
.links b { display: block; font: 700 1.0625rem/1.3 var(--display); font-stretch: 125%; }
.links span { display: block; color: var(--ink-muted); font: 500 0.8125rem/1.5 var(--mono); margin-top: 0.15rem; }

.toc { columns: 2; column-gap: 2rem; padding-left: 1.25rem; font-size: 0.9375rem; }
.toc li { break-inside: avoid; margin: 0.15rem 0; }
.toc a { display: inline-block; padding: 0.3rem 0; }
@media (max-width: 30rem) { .toc { columns: 1; } h1 { font-size: 1.875rem; } }

/* Support page questions: plain disclosure elements, no script. */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  min-height: 44px;
  font: 650 1.0625rem/1.35 var(--text);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 500 1.125rem/1 var(--mono); color: var(--ink-muted); }
details[open] > summary::after { content: "−"; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
details > :not(summary) { margin-top: 0; }
details > :last-child { margin-bottom: 1.1rem; }

.path { font: 500 0.875em/1.4 var(--mono); white-space: nowrap; }
@media (max-width: 30rem) { .path { white-space: normal; } }

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
footer a { color: var(--ink-muted); padding: 0.5rem 0; }

@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --ink-muted: #444; --line: #bbb; }
  .top nav, footer { display: none; }
  details > * { display: block !important; }
}
