/* Wood Elf Name Generator – shared styles. Mobile-first, no frameworks. */

:root {
  color-scheme: light;
  --bg: #F7F5EC;
  --surface: #FDFCF8;
  --surface-2: #E9EFE5;
  --text: #14281F;
  --muted: #455A4E;
  --primary: #183D32;
  --primary-hover: #315B46;
  --on-primary: #F7F5EC;
  --accent: #C6A15B;
  --accent-text: #6B4F14;
  --border: #CDD8CA;
  --border-strong: #6E8576;
  --success: #1D6A3C;
  --error: #A32E1A;
  --focus: #8A6516;
  --hero-bg: #183D32;
  --hero-text: #F7F5EC;
  --hero-muted: #C9D6CC;
  --hero-gold: #D2B06A;
  --mark-leaf: #183D32;
  --mark-vein: #C6A15B;
  --shadow: 0 1px 0 rgba(24, 61, 50, .06), 0 8px 24px -16px rgba(24, 61, 50, .35);

  --font-head: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-sm: .875rem;
  --fs-1: 1rem;
  --fs-2: clamp(1.0625rem, 1.02rem + .2vw, 1.1875rem);
  --fs-3: clamp(1.25rem, 1.12rem + .6vw, 1.5rem);
  --fs-4: clamp(1.625rem, 1.3rem + 1.4vw, 2.375rem);
  --fs-5: clamp(2.125rem, 1.5rem + 3vw, 3.75rem);

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --r1: 6px; --r2: 10px; --r3: 14px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --max: 72.5rem;
  --header-h: 4rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1F19;
    --surface: #142A22;
    --surface-2: #1A342B;
    --text: #EDEFE4;
    --muted: #AFC0B4;
    --primary: #C6A15B;
    --primary-hover: #D8B872;
    --on-primary: #10241C;
    --accent: #C6A15B;
    --accent-text: #DDBE78;
    --border: #2A4538;
    --border-strong: #6F8D7C;
    --success: #6FCB93;
    --error: #FF9C86;
    --focus: #E4C47F;
    --hero-bg: #0A1914;
    --hero-gold: #D2B06A;
    --mark-leaf: #3E7059;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px -16px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; letter-spacing: .01em; margin: 0 0 var(--s3); color: var(--text); text-wrap: balance; }
h1 { font-size: var(--fs-5); }
h2 { font-size: var(--fs-4); }
h3 { font-size: var(--fs-3); }
h4 { font-size: var(--fs-2); }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.25rem; }
a { color: var(--accent-text); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--primary-hover); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a:hover { color: #F1DDA8; } }
strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent); color: #10241C; }

.sr-only { position: absolute !important; 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(--s4); top: -4rem; z-index: 100; background: var(--primary); color: var(--on-primary); padding: .75rem 1rem; border-radius: var(--r1); font-weight: 600; text-decoration: none; transition: transform .2s var(--ease); }
.skip-link:focus { transform: translateY(4.75rem); }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
@media (min-width: 1600px) { :root { --max: 80rem; } }
.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 1.5rem + 2.5vw, 3.5rem); }
.band { background: var(--surface-2); }
.eyebrow { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 var(--s3); }
.lede { font-size: var(--fs-2); color: var(--muted); max-width: 42rem; }
.measure { max-width: 42rem; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ornament { display: block; width: 7.5rem; height: auto; color: var(--accent); margin: 0 0 var(--s4); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); min-height: 44px; }
.brand:hover { color: var(--text); }
.brand-mark { width: 2.25rem; height: 2.25rem; flex: none; }
.brand-mark .leaf { fill: var(--mark-leaf); }
.brand-mark .vein { stroke: var(--mark-vein); }
.brand-mark .star { fill: var(--mark-vein); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: .06em; text-transform: uppercase; }
.brand-sub { font-size: .6875rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--accent-text); margin-top: 3px; }

.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r2); cursor: pointer; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: var(--s1); margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); color: var(--text); text-decoration: none; font-weight: 500; border-radius: var(--r2); }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.site-nav a.nav-cta { background: var(--primary); color: var(--on-primary); font-weight: 600; margin-left: var(--s2); box-shadow: none; border-radius: var(--r2); }
.site-nav a.nav-cta:hover { background: var(--primary-hover); color: var(--on-primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-nav a.nav-cta:hover { color: #10241C; } }

@media (max-width: 979.98px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: var(--s3) var(--gutter) var(--s5); }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: var(--s1); }
  .site-nav a { width: 100%; min-height: 48px; font-size: 1.0625rem; }
  .site-nav a[aria-current="page"] { background: var(--surface-2); box-shadow: none; border-radius: var(--r2); }
  .site-nav a.nav-cta { margin: var(--s2) 0 0; justify-content: center; }
  .js .site-nav { opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s; }
  .js .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: .65rem 1.25rem; font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; border: 1px solid rgba(0, 0, 0, 0); border-radius: var(--r2); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .12s var(--ease); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: none; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-gold { background: var(--hero-gold); color: #10241C; }
.btn-gold:hover { background: #E2C583; color: #10241C; }
.btn-outline-light { background: none; color: var(--hero-text); border-color: rgba(247, 245, 236, .55); }
.btn-outline-light:hover { background: rgba(247, 245, 236, .1); color: var(--hero-text); border-color: var(--hero-text); }
.btn-lg { min-height: 52px; padding: .85rem 1.6rem; font-size: 1.0625rem; }
.btn-sm { min-height: 44px; padding: .45rem .85rem; font-size: .9375rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { color: #10241C; } }

/* ---------- Forms ---------- */
.field { margin: 0 0 var(--s5); border: 0; padding: 0; min-width: 0; }
.field > legend, .field > label, .label { display: block; font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.help { display: block; font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s2); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: .65rem .9rem; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r2); }
.textarea { min-height: 9rem; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23788f80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 4px 0 0 var(--error); }
.field-error { display: none; margin: var(--s2) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--error); }
.field-error.is-visible { display: flex; gap: var(--s2); align-items: flex-start; }
.field-error::before { content: "!"; flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid currentColor; font-size: .75rem; line-height: 1rem; text-align: center; }
.counter { display: flex; align-items: stretch; gap: var(--s2); }
.counter .input { text-align: center; max-width: 6rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.counter .input::-webkit-outer-spin-button, .counter .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter .btn { width: 48px; padding: 0; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; font-weight: 500; }
.check input { width: 1.375rem; height: 1.375rem; accent-color: var(--primary); flex: none; margin: 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* segmented radios and chips (native radios, visually restyled) */
.seg { display: flex; flex-wrap: wrap; gap: var(--s2); }
.seg label { position: relative; display: inline-flex; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .45rem .95rem; border: 1.5px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-weight: 500; font-size: .9375rem; line-height: 1.2; transition: background-color .15s, border-color .15s, color .15s; }
.seg input:hover + span { background: var(--surface-2); }
.seg input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.seg input:checked + span::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.style-note { margin: var(--s3) 0 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--r2) var(--r2) 0; font-size: var(--fs-sm); color: var(--muted); min-height: 3.5rem; }

/* ---------- Alerts ---------- */
.alert { padding: var(--s4); border: 1.5px solid var(--border-strong); border-left-width: 5px; border-radius: var(--r2); background: var(--surface); }
.alert-success { border-color: var(--success); }
.alert-error { border-color: var(--error); }
.alert strong { display: block; margin-bottom: var(--s1); }
.alert p:last-of-type { margin-bottom: 0; }

/* ---------- Breadcrumbs / page head ---------- */
.page-head { background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; padding-block: clamp(2rem, 1.2rem + 3vw, 3.75rem); }
.page-head h1 { color: var(--hero-text); font-size: clamp(2rem, 1.5rem + 2.4vw, 3.25rem); margin-bottom: var(--s3); }
.page-head .lede { color: var(--hero-muted); margin: 0; }
.page-head .container { position: relative; z-index: 1; }
.breadcrumb { margin: 0 0 var(--s4); font-size: var(--fs-sm); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s2); opacity: .6; }
.breadcrumb a { color: var(--hero-muted); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb [aria-current] { color: var(--hero-text); font-weight: 600; }
.branch { position: absolute; pointer-events: none; color: var(--hero-gold); opacity: .5; }
.branch-hero { right: -4rem; bottom: -3rem; width: min(34rem, 80vw); height: auto; }
.branch-head { right: -2rem; top: -1rem; width: min(22rem, 60vw); height: auto; opacity: .4; }

/* ---------- Home sample columns ---------- */
.name-cols { display: grid; gap: var(--s6); margin-top: var(--s6); }
@media (min-width: 760px) { .name-cols { grid-template-columns: repeat(3, 1fr); gap: var(--s5); } }
.name-col { border-top: 2px solid var(--accent); padding-top: var(--s4); }
.name-col h3 { font-size: 1.1875rem; }
.name-col p { margin: 0; }

/* ---------- Byline and author ---------- */
.byline { margin: var(--s4) 0 0; font-size: var(--fs-sm); color: var(--hero-muted); }
.byline a { color: var(--hero-text); }
.author-card { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r3); background: var(--surface); margin: 0 0 var(--s6); }
.author-card .brand-mark { width: 3.5rem; height: 3.5rem; }
.author-card p { margin: 0; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.hero h1 { color: var(--hero-text); }
.hero .eyebrow { color: var(--hero-gold); }
.hero .lede { color: var(--hero-muted); }
.hero-grid { position: relative; z-index: 1; display: grid; gap: var(--s7); align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero-points { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s2); color: var(--hero-muted); font-size: .9375rem; }
.hero-points li { display: flex; align-items: center; gap: var(--s2); }
.hero-points .icon { color: var(--hero-gold); }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: var(--s8); } }

/* ---------- Panels, veins (signature result display) ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3); padding: clamp(1.1rem, .8rem + 1.2vw, 1.75rem); box-shadow: var(--shadow); }
.quick { color: var(--text); }
.quick h2 { font-size: var(--fs-3); }
.quick-row { display: grid; gap: var(--s3); grid-template-columns: 1fr; margin-bottom: var(--s4); }
@media (min-width: 520px) { .quick-row { grid-template-columns: 1fr 1fr; } }
.veins { list-style: none; margin: 0; padding: 0; position: relative; }
.veins::before { content: ""; position: absolute; left: 1.0625rem; top: 1.25rem; bottom: 1.25rem; width: 2px; background: linear-gradient(var(--accent), var(--accent)); opacity: .55; }
.vein-item { position: relative; display: grid; grid-template-columns: 2.25rem 1fr; column-gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px dashed var(--border); }
.vein-item:last-of-type { border-bottom: 0; }
.vein-node { position: relative; z-index: 1; width: 2.125rem; height: 2.125rem; margin-top: .15rem; display: grid; place-items: center; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--primary); color: var(--on-primary); }
.vein-node .icon { width: 1.05rem; height: 1.05rem; transform: rotate(45deg); }
.vein-body { min-width: 0; }
.vein-name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.25rem, 1.1rem + .8vw, 1.625rem); line-height: 1.2; margin: 0; overflow-wrap: anywhere; letter-spacing: .01em; }
.vein-meaning { margin: .2rem 0 0; color: var(--muted); font-size: .9375rem; }
.vein-meaning b { color: var(--text); font-weight: 600; }
.badge { display: inline-block; margin-top: .4rem; padding: .1rem .6rem; font-size: .8125rem; font-weight: 600; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); background: var(--bg); }
.vein-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
@media (min-width: 640px) {
  .vein-item { grid-template-columns: 2.25rem 1fr auto; align-items: start; }
  .vein-actions { grid-column: auto; margin-top: 0; flex-wrap: nowrap; }
}
.fav-btn[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent); color: var(--accent-text); }
.fav-btn[aria-pressed="true"] .icon { fill: currentColor; }
.is-new .vein-item { animation: leaf-in .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes leaf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tool layout ---------- */
.tool-layout { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 980px) { .tool-layout { grid-template-columns: minmax(0, 22.5rem) minmax(0, 1fr); gap: var(--s6); } }
.tool-controls h2, .tool-results h2 { font-size: var(--fs-3); }
.tool-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.tool-actions .btn-primary { grid-column: 1 / -1; min-height: 52px; font-size: 1.0625rem; }
.results-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-start; justify-content: space-between; margin-bottom: var(--s3); }
.results-head h2 { margin: 0; }
.results-tools { display: flex; flex-wrap: wrap; gap: var(--s2); }
.result-status { min-height: 3rem; margin: 0 0 var(--s3); color: var(--muted); font-size: .9375rem; }
.result-status strong { color: var(--text); }
.results-body { min-height: 30rem; }
.results-empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); border: 1.5px dashed var(--border-strong); border-radius: var(--r3); }
.results-empty .icon { width: 2rem; height: 2rem; color: var(--accent-text); margin-bottom: var(--s2); }
.results-more { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }
.how-made { margin-top: var(--s4); padding: var(--s4); background: var(--surface-2); border-radius: var(--r2); font-size: .9375rem; color: var(--muted); }
.how-made h3 { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0; margin-bottom: var(--s2); color: var(--text); }
.how-made p:last-of-type { margin: 0; }
.saved { margin-top: var(--s5); }
.saved-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.saved-head h2 { margin: 0; }
.saved-list { list-style: none; margin: 0; padding: 0; }
.saved-list li { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; justify-content: space-between; padding: var(--s3) 0; border-bottom: 1px dashed var(--border); }
.saved-list li:last-of-type { border-bottom: 0; }
.saved-name { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin: 0; overflow-wrap: anywhere; }
.saved-name small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .875rem; color: var(--muted); }
.saved-empty { margin: 0; color: var(--muted); }
.noscript-note { padding: var(--s4); border: 1.5px solid var(--border-strong); border-radius: var(--r2); background: var(--surface); }

/* ---------- Content blocks ---------- */
.split { display: grid; gap: var(--s6); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s8); } }
.ledger { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border-strong); }
.ledger li { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s4); padding: var(--s5) 0; border-bottom: 1px solid var(--border); }
.ledger .icon { width: 1.75rem; height: 1.75rem; color: var(--accent-text); margin-top: .15rem; }
.ledger h3 { font-size: 1.1875rem; margin-bottom: var(--s1); }
.ledger p { margin: 0; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; gap: var(--s5); counter-reset: step; }
.steps li { position: relative; padding-left: 4rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--on-primary); background: var(--primary); border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); }
.steps li::after { content: ""; position: absolute; left: 1.375rem; top: 3.4rem; bottom: -1.9rem; width: 2px; background: var(--accent); opacity: .5; }
.steps li:last-of-type::after { display: none; }
.steps h3 { font-size: 1.25rem; margin-bottom: var(--s1); }
.steps p { margin: 0; color: var(--muted); }
@media (min-width: 980px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
  .steps li { padding: 4rem 0 0; }
  .steps li::before { transform: rotate(-45deg); }
  .steps li::after { left: 3.4rem; right: -1.6rem; top: 1.3rem; bottom: auto; width: auto; height: 2px; }
}
.audience { display: grid; gap: var(--s5); margin-top: var(--s6); }
@media (min-width: 700px) { .audience { grid-template-columns: 1fr 1fr; column-gap: var(--s7); } }
.audience-item { display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--s3); }
.audience-item .icon { width: 1.75rem; height: 1.75rem; color: var(--primary); margin-top: .1rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .audience-item .icon { color: var(--accent); } }
.audience-item h3 { font-size: 1.125rem; margin-bottom: var(--s1); }
.audience-item p { margin: 0; color: var(--muted); }
.style-links { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; gap: 0 var(--s7); }
@media (min-width: 760px) { .style-links { grid-template-columns: 1fr 1fr; } }
.style-links li { border-bottom: 1px solid var(--border); }
.style-links a { display: block; padding: var(--s3) 0; text-decoration: none; color: var(--text); min-height: 44px; }
.style-links a strong { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font-family: var(--font-head); font-size: 1.0625rem; letter-spacing: .01em; }
.style-links a .icon { color: var(--accent-text); transition: transform .15s var(--ease); }
.style-links a:hover .icon { transform: translateX(4px); }
.style-links a span { display: block; color: var(--muted); font-size: .9375rem; }
.promise { background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; }
.promise h2 { color: var(--hero-text); }
.promise .eyebrow { color: var(--hero-gold); }
.promise-grid { display: grid; gap: var(--s6); margin-top: var(--s6); position: relative; z-index: 1; }
@media (min-width: 800px) { .promise-grid { grid-template-columns: repeat(3, 1fr); } }
.promise-grid > div { border-top: 2px solid var(--hero-gold); padding-top: var(--s4); }
.promise-grid h3 { color: var(--hero-text); font-size: 1.125rem; display: flex; align-items: center; gap: var(--s2); }
.promise-grid .icon { color: var(--hero-gold); }
.promise-grid p { color: var(--hero-muted); margin: 0; }
.cta-band { text-align: center; }
.cta-band .lede { margin-inline: auto; }
.cta-band .ornament { margin-inline: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r2); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 36rem; }
caption { text-align: left; padding: var(--s3) var(--s4); font-weight: 600; color: var(--muted); caption-side: bottom; font-size: var(--fs-sm); }
th, td { text-align: left; padding: .75rem var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tbody tr:last-of-type td, tbody tr:last-of-type th { border-bottom: 0; }
tbody th { font-weight: 600; }

.faq { margin-top: var(--s5); border-top: 1px solid var(--border-strong); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 56px; padding: var(--s3) 0; font-weight: 600; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: .7rem; height: .7rem; border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(45deg); transition: transform .2s var(--ease); margin-right: .25rem; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details > div { padding: 0 0 var(--s4); color: var(--muted); max-width: 46rem; }
.faq details > div p:last-of-type { margin: 0; }

.example-card { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.example-card:first-of-type { border-top: 1px solid var(--border-strong); }
.example-card h3 { font-size: 1.1875rem; }
.example-list { list-style: none; margin: var(--s3) 0; padding: 0; display: grid; gap: var(--s2); }
.example-list li { display: flex; flex-wrap: wrap; gap: .25rem var(--s3); align-items: baseline; }
.example-list strong { font-family: var(--font-head); font-size: 1.125rem; letter-spacing: .01em; }
.example-list span { color: var(--muted); font-size: .9375rem; }
.pill-list { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: 0 0 var(--s4); }
.pill-list li { padding: .2rem .75rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: .9375rem; background: var(--surface); }

/* ---------- Prose (about/legal) ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.9rem); margin-top: var(--s7); }
.prose h3 { font-size: 1.2rem; margin-top: var(--s5); }
.prose li { margin-bottom: var(--s2); }
.updated { display: inline-block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: .15rem .8rem; margin-bottom: var(--s5); }
.prose .table-wrap { margin: var(--s4) 0; }

.contact-grid { display: grid; gap: var(--s6); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s7); } }
.form-status { margin-top: var(--s4); }
.form-status:empty { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--hero-bg); color: var(--hero-muted); padding-block: var(--s7) var(--s5); margin-top: 0; }
.footer-grid { display: grid; gap: var(--s6); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); } }
.site-footer .brand { color: var(--hero-text); }
.site-footer .brand-sub { color: var(--hero-gold); }
.site-footer .brand-mark .leaf { fill: #E9EFE5; }
.site-footer .brand-mark .vein { stroke: #183D32; }
.site-footer .brand-mark .star { fill: var(--hero-gold); }
.site-footer h2 { font-family: var(--font-body); font-size: .8125rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--hero-gold); margin-bottom: var(--s3); }
.site-footer p { margin: var(--s3) 0 0; max-width: 24rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; color: var(--hero-text); text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; color: #fff; }
.copyright { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid rgba(247, 245, 236, .2); font-size: var(--fs-sm); }
.copyright p { max-width: none; margin: 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: clamp(3rem, 8vw, 7rem); }
.notfound .ornament { margin-inline: auto; }
.notfound .hero-actions { justify-content: center; }
.notfound .big { font-family: var(--font-head); font-size: clamp(4rem, 3rem + 8vw, 8rem); line-height: 1; color: var(--accent-text); margin: 0; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .is-new .vein-item { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  .site-header, .site-footer, .skip-link, .page-head, .tool-controls, .results-tools, .results-more, .vein-actions, .how-made, .saved, .breadcrumb, .no-print, .section:not(.print-keep), .hero { display: none !important; }
  .print-keep { display: block !important; padding: 0 !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  .print-only { display: block; margin-bottom: 12pt; }
  .print-only h1 { font-size: 20pt; color: #000; }
  .veins::before { background: #999; }
  .vein-node { background: #fff; color: #000; border: 1px solid #000; }
  .vein-item { break-inside: avoid; }
  .vein-name, .vein-meaning, .badge { color: #000; }
  .results-body { min-height: 0; }
  .tool-layout { display: block; }
}
