/* latin-ext */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-variable-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --canvas: #f3f0e9;
  --surface: #fbf9f4;
  --raised: #eae5da;
  --rule: #ded7c9;
  --ink: #221e16;
  --mute: #635c4e;
  --faint: #91887a;
  --attested: #036849;
  --failing: #bf1d1d;
  --queued: #855405;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.bar .inner {
  max-width: 60rem; margin: 0 auto; padding: 0.85rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 800; text-decoration: none;
}
.brand svg { width: 1.4rem; height: 1.4rem; display: block; }
.bar nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.bar nav a { color: var(--mute); text-decoration: none; }
.bar nav a:hover { color: var(--ink); }
.bar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { max-width: 60rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 {
  font-size: 1.45rem; letter-spacing: -0.01em;
  margin: 3.25rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }
p { margin: 0.9rem 0; }
.lede { font-size: 1.2rem; color: var(--mute); margin-top: 1.25rem; max-width: 46rem; }
.crumb { font-size: 0.85rem; color: var(--faint); margin-bottom: 1rem; }
.crumb a { color: var(--faint); }

ul, ol { margin: 0.9rem 0; padding-left: 1.25rem; }
li { margin: 0.35rem 0; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 0.6rem; padding: 1.15rem 1.25rem; margin: 0.85rem 0;
}
.grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid .card { margin: 0; }
.card h3 { margin-top: 0; }
.card p { margin: 0.4rem 0 0; color: var(--mute); font-size: 0.95rem; }

.rule { border-top: 1px solid var(--rule); padding: 1.35rem 0; }
.rule:last-child { border-bottom: 1px solid var(--rule); }
.rule .id { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--faint); }
.rule .id a { text-decoration: none; }
.rule .name { font-weight: 700; margin: 0.15rem 0 0.35rem; }
.rule .statement { margin: 0; }
.rule .note {
  margin: 0.7rem 0 0; padding-left: 0.9rem;
  border-left: 2px solid var(--rule); color: var(--mute); font-size: 0.95rem;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem;
  margin-top: 0.75rem; font-size: 0.78rem;
}
.tag {
  border: 1px solid var(--rule); background: var(--raised);
  border-radius: 0.35rem; padding: 0.1rem 0.45rem; color: var(--mute);
}
.tag.force { font-weight: 700; color: var(--ink); }
.tag.auto { border-color: var(--attested); color: var(--attested); background: transparent; }
.tag.manual { border-color: var(--rule); color: var(--faint); background: transparent; }

table { border-collapse: collapse; width: 100%; margin: 1.1rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.scroll { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.past { color: var(--failing); font-weight: 600; }
.soon { color: var(--queued); font-weight: 600; }
.later { color: var(--mute); }

.controls { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.controls label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.8rem; color: var(--faint);
}
.controls select, .controls input {
  font: inherit; font-size: 0.95rem; padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule); border-radius: 0.4rem;
  background: var(--surface); color: var(--ink);
}
.count { color: var(--mute); font-size: 0.95rem; }

dl.terms { margin: 1.25rem 0; }
dl.terms > div { border-top: 1px solid var(--rule); padding: 1rem 0; }
dl.terms dt { font-weight: 700; }
dl.terms dd { margin: 0.3rem 0 0; color: var(--mute); }
dl.terms .alts { font-size: 0.85rem; color: var(--faint); margin-top: 0.35rem; }

.cta {
  margin-top: 3.5rem; padding: 1.6rem; border-radius: 0.6rem;
  background: var(--raised); border: 1px solid var(--rule);
}
.cta h2 { margin: 0 0 0.4rem; border: 0; padding: 0; font-size: 1.2rem; }
.cta p { margin: 0; color: var(--mute); }
.cta a { font-weight: 700; }

footer.site {
  border-top: 1px solid var(--rule); margin-top: 4rem;
  padding: 2rem 1.5rem 3rem; font-size: 0.88rem; color: var(--faint);
}
footer.site .inner { max-width: 60rem; margin: 0 auto; }
footer.site p { margin: 0.35rem 0; }

/* --- chat launcher (kept in step with index.html's inline copy) ----------- */
.chat-state { position: absolute; opacity: 0; pointer-events: none; }
.chat-fab {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 20;
  width: 3.25rem; height: 3.25rem; border-radius: 999px;
  background: var(--ink); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(34, 30, 22, 0.45);
  transition: transform 150ms ease;
}
.chat-fab:hover { transform: scale(1.06); }
.chatbox {
  position: fixed; right: 1.5rem; bottom: 5.25rem; z-index: 20;
  width: min(21rem, calc(100vw - 3rem));
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 0.75rem; overflow: hidden;
  box-shadow: 0 24px 56px -20px rgba(34, 30, 22, 0.4);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.chat-state:checked ~ .chatbox { opacity: 1; transform: none; pointer-events: auto; }
.chat-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.9rem 1.1rem; background: var(--ink); color: var(--canvas);
}
.chat-brand { font-weight: 800; font-size: 0.95rem; }
.chat-note { font-size: 0.7rem; color: #a69e90; margin-right: auto; }
.chat-close { cursor: pointer; font-size: 0.8rem; color: #a69e90; }
.chat-close:hover { color: var(--canvas); }
.chat-body { padding: 1rem 1.1rem; }
.chat-msg {
  background: var(--raised); border-radius: 0.6rem 0.6rem 0.6rem 0.15rem;
  padding: 0.7rem 0.9rem; font-size: 0.85rem; margin-bottom: 0.9rem;
}
.chat-chips { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.chat-chips a { text-decoration: none; }
.chat-chips label {
  display: inline-block; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 0.3rem 0.8rem; font-size: 0.78rem; font-weight: 600;
}
.chat-chips label:hover { background: var(--raised); }
.chat-compose {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem; border-top: 1px solid var(--rule);
  font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.chat-compose:hover { background: var(--raised); }
.chat-arrow { transition: transform 150ms ease; }
.chat-compose:hover .chat-arrow { transform: translateX(3px); }
.chat-log { max-height: 16rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.9rem; }
.chat-log .chat-msg { margin-bottom: 0; }
/* The model answers in Markdown; the script below turns it into these. */
.chat-log .chat-msg > * + * { margin-top: 0.5rem; }
.chat-log .chat-msg ul, .chat-log .chat-msg ol { padding-left: 1.15rem; }
.chat-log .chat-msg li + li { margin-top: 0.2rem; }
.chat-log .chat-msg li::marker { color: var(--faint); }
.chat-log .chat-msg strong { font-weight: 700; }
.chat-log .chat-msg em { font-style: italic; }
.chat-log .chat-msg a { text-decoration: underline; }
.chat-log .chat-msg code {
  font-size: 0.92em; background: var(--canvas);
  border-radius: 0.25rem; padding: 0.05rem 0.3rem;
}
.chat-log .chat-msg pre {
  background: var(--canvas); border-radius: 0.4rem;
  padding: 0.55rem 0.7rem; overflow-x: auto;
}
.chat-log .chat-msg pre code { background: none; padding: 0; }
.chat-log .chat-user {
  align-self: flex-end;
  background: var(--ink); color: var(--surface);
  border-radius: 0.6rem 0.6rem 0.15rem 0.6rem;
  padding: 0.7rem 0.9rem; font-size: 0.85rem; max-width: 85%;
}
.chat-log .chat-wait { color: var(--faint); font-size: 0.85rem; padding-left: 0.2rem; }
.chat-input {
  display: flex; gap: 0.5rem; padding: 0 1.1rem 0.9rem;
}
.chat-input[hidden] { display: none; }
.chat-input input {
  flex: 1; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.85rem; padding: 0.45rem 0.9rem;
}
.chat-input input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.chat-input button {
  border: 0; border-radius: 999px; width: 2.3rem;
  background: var(--ink); color: var(--surface);
  font-size: 1rem; cursor: pointer;
}
.ts-slot { position: absolute; width: 0; height: 0; overflow: hidden; }
