/* Wood Elf Name Generator - Field Codex design system */
:root {
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #f5f0e3;
  --surface: #fffcf4;
  --surface-2: #ece6d3;
  --text: #1b2a1e;
  --muted: #475a4a;
  --border: #d3cab0;
  --primary: #2c5a38;
  --on-primary: #ffffff;
  --primary-hover: #214a2c;
  --accent: #7d5110;
  --accent-soft: #f0e2c3;
  --success: #1d6a38;
  --error: #a42a2a;
  --error-bg: #fbe9e5;
  --ring: #8a5a00;
  --vein: #2c5a38;
  --band-bg: #1f3a28;
  --band-text: #eef2e4;
  --band-muted: #bccfb9;
  --shadow: 0 1px 2px rgba(27, 42, 30, 0.08), 0 6px 18px rgba(27, 42, 30, 0.06);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 104px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --header-h: 68px;
  --maxw: 1180px;

  --fs-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-1: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --fs-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --fs-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --fs-4: clamp(2.375rem, 1.8rem + 2.8vw, 4rem);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1a13;
  --surface: #16241b;
  --surface-2: #1d3024;
  --text: #e8eedc;
  --muted: #a9bba7;
  --border: #2d4535;
  --primary: #8cc78b;
  --on-primary: #0d1a11;
  --primary-hover: #a6d8a4;
  --accent: #e2b366;
  --accent-soft: #2e2a1a;
  --success: #8fd39b;
  --error: #ff9f96;
  --error-bg: #3a1f1d;
  --ring: #e2b366;
  --vein: #8cc78b;
  --band-bg: #0b140e;
  --band-text: #e8eedc;
  --band-muted: #a9bba7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a13;
    --surface: #16241b;
    --surface-2: #1d3024;
    --text: #e8eedc;
    --muted: #a9bba7;
    --border: #2d4535;
    --primary: #8cc78b;
    --on-primary: #0d1a11;
    --primary-hover: #a6d8a4;
    --accent: #e2b366;
    --accent-soft: #2e2a1a;
    --success: #8fd39b;
    --error: #ff9f96;
    --error-bg: #3a1f1d;
    --ring: #e2b366;
    --vein: #8cc78b;
    --band-bg: #0b140e;
    --band-text: #e8eedc;
    --band-muted: #a9bba7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-0); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0 0 var(--s-4); letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: var(--fs-4); }
h2 { font-size: var(--fs-3); }
h3 { font-size: var(--fs-2); }
h4 { font-size: var(--fs-1); }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.25rem; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-weight: 600; }
.skip-link:focus { top: var(--s-3); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.narrow { max-width: 760px; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5); border-radius: var(--r-md);
  border: 1.5px solid var(--primary); background: var(--primary); color: var(--on-primary);
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-ghost { background: var(--surface); color: var(--primary); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 40px; padding: 0 var(--s-4); font-size: 0.95rem; }
.btn-lg { min-height: 52px; padding: 0 var(--s-6); font-size: 1.0625rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.icon-btn:hover { border-color: var(--primary); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text); text-decoration: none; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.005em; }
.brand-sub { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--s-2); }
.site-nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--surface); }
.site-nav a:not(.btn):hover { color: var(--primary); border-bottom-color: var(--border); }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--primary); border-bottom-color: var(--primary); }
.site-nav .btn[aria-current="page"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.menu-toggle { display: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }
.menu-toggle[aria-expanded="true"] .i-menu { display: none; }

@media (max-width: 859px) {
  .no-js .header-inner { flex-wrap: wrap; padding-block: var(--s-2); }
  .no-js .site-nav ul { flex-wrap: wrap; }
  .js .menu-toggle { display: inline-grid; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .js .site-nav.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.2s ease, transform 0.2s ease; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) clamp(16px, 4vw, 32px) var(--s-4); max-width: var(--maxw); margin-inline: auto; }
  .js .site-nav li { border-bottom: 1px solid var(--border); }
  .js .site-nav li:last-of-type { border-bottom: 0; padding-top: var(--s-3); }
  .js .site-nav a:not(.btn) { min-height: 52px; width: 100%; border-bottom: 0; }
  .js .site-nav .btn { width: 100%; min-height: 52px; }
}
@media (max-width: 380px) { .brand-sub { display: none; } }

/* ---------- Layout bits ---------- */
main { display: block; }
.section { padding-block: clamp(48px, 7vw, 96px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-3); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.lead { font-size: var(--fs-1); color: var(--muted); max-width: 62ch; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--s-7); }
.prose h3 { margin-top: var(--s-6); }
.prose li { margin-bottom: var(--s-2); }
.crumbs { padding-top: var(--s-4); font-size: 0.9rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--border); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.page-head { padding-block: var(--s-6) var(--s-5); border-bottom: 1px solid var(--border); background: var(--surface); }
.page-head h1 { font-size: var(--fs-3); margin-bottom: var(--s-3); }
.page-head .meta { color: var(--muted); font-size: 0.95rem; margin: 0; }
.page-body { padding-block: clamp(32px, 5vw, 64px); }
.vein-rule { display: block; width: 100%; height: 18px; color: var(--vein); opacity: 0.55; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 6vw, 88px) clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; right: -4%; top: -10%; width: min(70vw, 760px); aspect-ratio: 1; background: var(--vein); opacity: 0.09; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M300 600C300 400 300 200 300 10'/%3E%3Cpath d='M300 540C250 500 190 480 100 430'/%3E%3Cpath d='M300 540C350 500 410 480 500 430'/%3E%3Cpath d='M300 450C250 410 200 390 130 340'/%3E%3Cpath d='M300 450C350 410 400 390 470 340'/%3E%3Cpath d='M300 350C260 320 220 300 170 255'/%3E%3Cpath d='M300 350C340 320 380 300 430 255'/%3E%3Cpath d='M300 255C270 230 245 215 210 180'/%3E%3Cpath d='M300 255C330 230 355 215 390 180'/%3E%3Cpath d='M300 160C280 140 270 125 255 100'/%3E%3Cpath d='M300 160C320 140 330 125 345 100'/%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 600 600' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M300 600C300 400 300 200 300 10'/%3E%3Cpath d='M300 540C250 500 190 480 100 430'/%3E%3Cpath d='M300 540C350 500 410 480 500 430'/%3E%3Cpath d='M300 450C250 410 200 390 130 340'/%3E%3Cpath d='M300 450C350 410 400 390 470 340'/%3E%3Cpath d='M300 350C260 320 220 300 170 255'/%3E%3Cpath d='M300 350C340 320 380 300 430 255'/%3E%3Cpath d='M300 255C270 230 245 215 210 180'/%3E%3Cpath d='M300 255C330 230 355 215 390 180'/%3E%3Cpath d='M300 160C280 140 270 125 255 100'/%3E%3Cpath d='M300 160C320 140 330 125 345 100'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero-grid { position: relative; display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--s-8); } }
.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-block: var(--s-5); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: 0; padding: 0; }
.chips li { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.chips .icon { color: var(--primary); width: 1.1em; height: 1.1em; }

/* ---------- Codex (tool results) ---------- */
.codex { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.codex-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.codex-title { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; margin: 0; }
.codex-sub { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.codex-body { padding: var(--s-4) var(--s-5) var(--s-5); min-height: 420px; }
.codex-body.is-mini { min-height: 0; padding-bottom: var(--s-3); }
.is-mini .entry-tag { display: none; }
.is-mini .entry { padding: var(--s-2) 0; }
.is-mini .entry-name { font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); }
.entries { list-style: none; margin: 0; padding: 0 0 0 var(--s-6); position: relative; }
.entries::before { content: ""; position: absolute; left: 9px; top: 14px; bottom: 14px; width: 2px; background: linear-gradient(var(--vein), var(--border)); opacity: 0.45; border-radius: 2px; }
.entry { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-bottom: 1px dashed var(--border); }
.entry:last-of-type { border-bottom: 0; }
.entry::before { content: ""; position: absolute; left: calc(-1 * var(--s-6) + 3px); top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--surface); border: 2px solid var(--primary); border-radius: 0 100% 0 100%; transform: rotate(0deg); }
.entry-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.entry-title { display: block; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.entry-meaning { display: block; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.1875rem; color: var(--muted); margin-top: 2px; }
.entry-tag { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.entry-actions { display: flex; gap: var(--s-1); }
.entry-actions .icon-btn { width: 44px; height: 44px; }
.entry.is-new { animation: leaf-in 0.35s ease both; }
@keyframes leaf-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty-state { display: grid; place-items: center; text-align: center; min-height: 340px; color: var(--muted); padding: var(--s-5); }
.empty-state svg { width: 56px; height: 56px; color: var(--vein); opacity: 0.6; margin-bottom: var(--s-3); }
.empty-state p { max-width: 36ch; margin-inline: auto; }

/* ---------- Mini generator (home) ---------- */
.mini-controls { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.mini-foot { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); }
@media (max-width: 480px) { .mini-controls { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s-4); }
.field > label, .fieldset > legend, .label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: var(--s-2); padding: 0; }
.fieldset { border: 0; margin: 0 0 var(--s-4); padding: 0; min-width: 0; }
.hint { display: block; font-size: 0.875rem; color: var(--muted); margin-top: var(--s-1); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: var(--s-3) var(--s-4); font: 500 1rem/1.4 var(--font-body); color: var(--text);
  background: var(--surface); border: 1.5px solid var(--muted); border-radius: var(--r-md); appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23778' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.textarea { min-height: 150px; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; border-color: var(--ring); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); }
.field-error { display: none; margin-top: var(--s-2); color: var(--error); font-size: 0.9rem; font-weight: 600; }
.field-error.is-visible { display: flex; gap: var(--s-2); align-items: flex-start; }
.field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--error); color: var(--surface); font-size: 0.75rem; line-height: 1; margin-top: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s-4);
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.seg label:hover { border-color: var(--primary); }
.seg label:active { transform: scale(0.98); }
.seg input:checked + label { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.seg input:focus-visible + label { outline: 3px solid var(--ring); outline-offset: 3px; }
.check { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; cursor: pointer; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { display: none; padding: var(--s-4); border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface-2); font-size: 0.975rem; margin-bottom: var(--s-4); }
.alert.is-visible { display: block; }
.alert-error { border-color: var(--error); background: var(--error-bg); }
.alert-success { border-color: var(--success); }
.alert strong { display: block; margin-bottom: 2px; }
.alert a { font-weight: 700; }

/* ---------- Tool page ---------- */
.tool-wrap { display: grid; gap: var(--s-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .tool-wrap { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: var(--s-6); } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow); }
.panel h2 { font-size: 1.5rem; margin-bottom: var(--s-4); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn-row .btn-lg { flex: 1 1 100%; }
.codex-tools { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0 var(--s-5) var(--s-4); }
.saved { border-top: 1px solid var(--border); padding: var(--s-4) var(--s-5) var(--s-5); }
.saved[hidden] { display: none; }
.saved h3 { font-size: 1.25rem; margin-bottom: var(--s-3); }
.saved ul { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.saved li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px dashed var(--border); }
.saved li span { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; overflow-wrap: anywhere; }

/* ---------- Content blocks ---------- */
.split { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-8); } }
.def-list { list-style: none; margin: 0; padding: 0; counter-reset: def; }
.def-list li { position: relative; padding: var(--s-4) 0 var(--s-4) 52px; border-top: 1px solid var(--border); counter-increment: def; }
.def-list li:last-of-type { border-bottom: 1px solid var(--border); }
.def-list li::before { content: counter(def, decimal-leading-zero); position: absolute; left: 0; top: var(--s-4); font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.def-list h3 { font-size: 1.375rem; margin-bottom: var(--s-1); }
.def-list p { margin: 0; color: var(--muted); }
.steps { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-5); grid-template-columns: 1fr; position: relative; counter-reset: step; }
@media (min-width: 800px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
  .steps::before { content: ""; position: absolute; top: 22px; left: 22px; right: 22px; height: 2px; background: repeating-linear-gradient(90deg, var(--vein) 0 8px, var(--surface-2) 8px 16px); opacity: 0.55; }
}
.steps li { position: relative; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--s-3); background: var(--bg); border: 2px solid var(--primary); border-radius: 0 100% 0 100%; font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; color: var(--primary); position: relative; z-index: 1; }
.steps h3 { font-size: 1.5rem; margin-bottom: var(--s-2); }
.steps p { color: var(--muted); margin: 0; }
.roles { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: 0 var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 700px) { .roles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1060px) { .roles { grid-template-columns: 1fr 1fr 1fr; } }
.roles li { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
.roles .icon { width: 28px; height: 28px; color: var(--accent); margin-top: 2px; }
.roles h3 { font-size: 1.3125rem; margin-bottom: 2px; }
.roles p { margin: 0; color: var(--muted); font-size: 0.975rem; }
.band { background: var(--band-bg); color: var(--band-text); }
.band h2, .band h3 { color: var(--band-text); }
.band p, .band li { color: var(--band-muted); }
.band .eyebrow { color: #e2b366; }
.band a { color: #cfe6c8; }
.band-grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; margin-top: var(--s-6); }
@media (min-width: 800px) { .band-grid { grid-template-columns: repeat(3, 1fr); } }
.band-grid > div { border-top: 2px solid #e2b366; padding-top: var(--s-4); }
.band-grid .icon { width: 28px; height: 28px; color: #e2b366; margin-bottom: var(--s-2); }
.band-grid h3 { font-size: 1.5rem; }
.cta { text-align: center; }
.cta .lead { margin-inline: auto; }
.cta .hero-cta { justify-content: center; }
.faq { margin-top: var(--s-5); border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; padding: var(--s-3) 0; font-weight: 700; font-size: 1.0625rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-right: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary); transform: rotate(45deg); transition: transform 0.2s ease; margin-right: 4px; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details > div { padding: 0 0 var(--s-4); color: var(--muted); max-width: 72ch; }
.faq details > div p:last-of-type { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: var(--s-4) 0 var(--s-5); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.975rem; }
th, td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; }
tr:last-of-type td { border-bottom: 0; }
.example { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-4); }
.example h3 { font-size: 1.375rem; margin-bottom: var(--s-2); }
.example p { margin: 0 0 var(--s-2); }
.example .eq { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; color: var(--primary); }
.notice { border: 1px solid var(--border); background: var(--accent-soft); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); }
.contact-grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--s-8); } }
.error-page { text-align: center; padding-block: clamp(56px, 9vw, 120px); }
.error-page .big { font-family: var(--font-display); font-weight: 700; font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--accent); margin: 0; }

/* ---------- Author card ---------- */
.author-card { display: grid; gap: var(--s-2); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--r-md); padding: var(--s-5); margin: var(--s-4) 0 var(--s-5); }
.author-card .author-name { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.1; margin: 0; }
.author-card .author-role { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.author-card p { margin: 0; }
.policy-list { padding-left: 1.25rem; }
.policy-list li { margin-bottom: var(--s-3); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding-block: var(--s-7) var(--s-5); }
.footer-grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-8); } }
.site-footer h2 { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text); text-decoration: none; font-weight: 500; }
.site-footer li a:hover { color: var(--primary); text-decoration: underline; }
.footer-brand p { color: var(--muted); max-width: 38ch; margin: var(--s-3) 0 0; }
.footer-bottom { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer-bottom p { margin: 0; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .crumbs, .no-print, form, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .codex, .panel { border: 0; box-shadow: none; }
  .codex-body { min-height: 0; }
  .entry-actions, .codex-tools { display: none !important; }
  .entry-meaning, .entry-tag, .entry-title { color: #000; }
  .tool-wrap { display: block; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
