/* page-legal.css: privacy.html (and any later legal page) + 404.html. Layout only; components in kd.css.
   Prefix lg- (legal) and nf- (not found). Colour: semantic tokens only (light + dark from the same rules; no dark selector). */

/* ── legal page ─────────────────────────────────────────────────────────── */
.lg-head { padding-top: clamp(40px, 6vw, 96px); padding-bottom: clamp(32px, 4vw, 56px); }
.lg-h { font-size: clamp(4rem, 11vw, 10rem); border-bottom: 1px solid var(--rule-strong); padding-bottom: clamp(12px, 1.6vw, 24px); }
.lg-date { margin-top: var(--s-3); font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.lg-layout { padding-bottom: clamp(88px, 10vw, 152px); }

/* contents: numbered by CSS (the numbers already live in the headings), sticky beside the text on desktop */
.lg-toc { counter-reset: lgt; max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; }
.lg-toc a { counter-increment: lgt; gap: 12px; line-height: 1.3; padding-block: 6px; }
.lg-toc a::before { content: counter(lgt); content: counter(lgt) / ""; flex: none; width: 1.6rem; font-family: var(--font-display); font-size: 1.375rem; line-height: 1; color: var(--accent); }
/* the current section (aria-current, set by the page's small inline script): bold ink, the numeral on a marker chip */
.lg-toc a[aria-current] { color: var(--ink); font-weight: 800; }
.lg-toc a[aria-current]::before { background: var(--marker); color: var(--on-marker); text-align: center; border-radius: 2px; }
.lg-toc a:focus-visible { outline-offset: -2px; }

/* the document: a 64ch reading measure, League Gothic heads */
.lg-doc { max-width: 64ch; }
.lg-doc > :first-child { margin-top: 0 !important; }
.lg-doc h2 {
  margin-top: var(--s-8); padding-top: var(--s-4); border-top: 1px solid var(--rule-strong);
  font-family: var(--font-display); font-weight: 400; font-size: clamp(2.25rem, 3.4vw, 3rem); line-height: 0.95; letter-spacing: -0.003em;
}
.lg-doc h2:first-child { border-top-width: 3px; }
.lg-doc h2 + * { margin-top: var(--s-4); }
.lg-doc p + p { margin-top: 0.85em; }
.lg-doc ul { margin-block: 0.85em; }
.lg-doc a { overflow-wrap: anywhere; padding-block: 13px; } /* inline padding: 44px tap boxes, line unchanged */
@media (max-width: 959px) {
  .lg-toc { max-height: none; overflow: visible; }
}
@media (max-width: 719px) {
  .lg-h { font-size: clamp(3.75rem, 19vw, 5rem); }
  .lg-doc h2 { margin-top: var(--s-7); font-size: 2.25rem; }
  .lg-doc { font-size: 1rem; }
}

/* ── 404 ────────────────────────────────────────────────────────────────── */
.nf { min-height: calc(100vh - var(--nav-h) - 45px); min-height: calc(100svh - var(--nav-h) - 45px); display: grid; align-content: center; padding-block: clamp(48px, 7vw, 112px); }
.nf__code { display: flex; align-items: center; gap: 10px; padding-bottom: var(--s-3); border-bottom: 1px solid var(--rule-strong); }
.nf__h { margin-top: clamp(20px, 2.6vw, 40px); max-width: 6.4em; font-size: clamp(3.75rem, 11.5vw, 12rem); line-height: 0.88; }
/* light stroke: the old geometry (was --mk-bot 0.2em on a 0.12em-padded box). The dark chip covers descenders in kd.css. */
.nf__h .kd-mark { --mk-top: 0.5em; --mk-bot: 0.08em; }
.nf__p { margin-top: clamp(20px, 2.4vw, 32px); font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 34ch; text-wrap: pretty; }
.nf__links { margin-top: clamp(32px, 4vw, 56px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 3px solid var(--ink); max-width: 64rem; }
.nf__links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 0 18px 0 0;
  border-bottom: 1px solid var(--rule-strong); font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.01em; text-decoration: none;
  position: relative; isolation: isolate;
}
.nf__links a + a { padding-left: 18px; border-left: 1px solid var(--rule); }
.nf__links a::after {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12h16M13 5.5l6.5 6.5-6.5 6.5' fill='none' stroke='currentColor' stroke-width='2.6' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12h16M13 5.5l6.5 6.5-6.5 6.5' fill='none' stroke='currentColor' stroke-width='2.6' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--d-state) var(--ease-out);
}
.nf__links a:hover { color: var(--accent); }
.nf__links a:hover::after { transform: translateX(4px); }
.nf__links a.nf__book { background: var(--accent-fill); color: var(--on-accent); padding-inline: 18px; border-left: 0; }
.nf__links a.nf__book:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.nf__links a:focus-visible { outline-offset: -2px; }
.nf__links a.nf__book:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 859px) {
  .nf__links { grid-template-columns: minmax(0, 1fr); }
  .nf__links a + a { padding-left: 0; border-left: 0; }
  .nf__links a { min-height: 60px; }
  .nf__links a.nf__book { margin-top: 16px; min-height: 64px; padding-inline: 20px; }
}
@media (max-width: 719px) {
  .nf { align-content: start; padding-top: var(--s-6); }
  .nf__h { font-size: clamp(3.5rem, 17vw, 5rem); }
  .nf__p { font-size: 1.0625rem; }
}
