:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --fg: #1b1c1a;
  --muted: #5b5c55;
  --faint: #86867e;
  --line: #e3e1d9;
  --accent: #2f6b4f;
  --accent-fg: #ffffff;
  --accent-soft: #e8f1eb;
  --warn-soft: #fbf1dc;
  --code: #f1efe8;
  --ok: #2f6b4f;
  --hard: #9a4b2f;
  --ga: #2f6b4f;
  --gb: #3b5c99;
  --gc: #8a6717;
  --gd: #8f4646;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1b1c1a;
    --fg: #ebeae4;
    --muted: #a6a59d;
    --faint: #7d7c75;
    --line: #2d2e2a;
    --accent: #7cc39d;
    --accent-fg: #0f1a14;
    --accent-soft: #1d2b23;
    --warn-soft: #2e2716;
    --code: #232420;
    --ok: #7cc39d;
    --hard: #e0977b;
    --ga: #7cc39d;
    --gb: #8fb0ea;
    --gc: #d9b45f;
    --gd: #e39a9a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16.5px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--code); padding: 0.08em 0.35em; border-radius: 4px; }
pre { background: var(--code); padding: 0.9rem 1rem; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.7rem); margin: 0 0 0.8rem; }
h2 { font-size: 1.55rem; margin: 2.6rem 0 0.8rem; }
h3 { font-size: 1.12rem; margin: 1.5rem 0 0.4rem; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.8rem; z-index: 10; }

/* ---------------------------------------------------------------- frame */

.bar { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .bar { min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.mark { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 3px solid var(--accent); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 6px var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--fg); }
.site-header nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

main { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 5rem; }
main.wide { max-width: 72rem; }
.narrow { max-width: 46rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: 0.9rem; }
.site-footer .bar { padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); margin-left: 1rem; }
.site-footer a:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- type */

.lede { font-size: 1.18rem; color: var(--muted); max-width: 42rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; font-weight: 600; color: var(--accent); margin: 0 0 0.6rem; }
.note, .faint { color: var(--faint); }
.note { font-size: 0.92rem; }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.ref { border-bottom: 1px dotted var(--faint); }
.ok { color: var(--ok); }
.hard { color: var(--hard); }

/* ---------------------------------------------------------------- blocks */

.hero { padding: 2.5rem 0 1rem; max-width: 50rem; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.4rem); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
.btn { display: inline-block; padding: 0.62rem 1.15rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.96rem; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); }

.block { margin-top: 4rem; }
.block > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.25rem; }
.grid.align-start { align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.15rem 1.3rem; }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.path { display: flex; flex-direction: column; align-items: flex-start; }
.card.path .btn { margin-top: auto; }
.card.accent { border-color: var(--accent); background: var(--accent-soft); }
.card ul { padding-left: 1.1rem; }

.split { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
.split h2 { margin-top: 0; }
.columns { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.columns h3 { margin-top: 0; font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.columns ul { padding-left: 1.1rem; margin: 0; }
.columns li { margin-bottom: 0.4rem; }

.values-strip { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2rem 0; }
.values-strip h3 { margin-top: 0; }
.values-strip p { margin: 0; color: var(--muted); }
.values-strip .more { grid-column: 1 / -1; }

.specs { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.specs li { padding-left: 1rem; border-left: 3px solid var(--line); }

.notice { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 0.85rem 1rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0; }
.notice.warn { background: var(--warn-soft); border-left-color: var(--gc); }

.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.8rem; margin-bottom: 1.2rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.steps h3 { margin: 0 0 0.2rem; }
.steps p { margin: 0.2rem 0; }

/* About page content (shared with desktop-agent/site/about.html) */
.values { display: grid; gap: 0.75rem; padding: 0; list-style: none; }
.values li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1.1rem; }
.values strong { display: block; margin-bottom: 0.15rem; font-family: var(--serif); font-size: 1.05rem; }

/* ---------------------------------------------------------------- data */

.table, .prose table { overflow-x: auto; }
.prose table { display: block; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 1rem 0; }
th, td { text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom-width: 2px; }
table.num td:not(:first-child), table.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
table.log td:first-child { font-family: var(--mono); font-size: 0.86rem; white-space: nowrap; }

.grade { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 0.3rem; margin-right: 0.2rem; border-radius: 5px; font: 700 0.78rem/1 var(--mono); color: var(--surface); }
.grade.ga { background: var(--ga); }
.grade.gb { background: var(--gb); }
.grade.gc { background: var(--gc); }
.grade.gd { background: var(--gd); }
.grade.none { background: var(--line); color: var(--muted); }
.qual { font-size: 0.78rem; color: var(--faint); }

.prose h2 { font-size: 1.35rem; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.crumbs { font-size: 0.9rem; color: var(--faint); margin: 0 0 0.6rem; }
.rl-id { font-family: var(--mono); font-size: 0.6em; color: var(--accent); display: block; letter-spacing: 0; margin-bottom: 0.3rem; }
.entry-grade { color: var(--muted); font-size: 0.92rem; }
.pager { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-family: var(--mono); }
