/* Wood Elf Name Generator - one small stylesheet, no external fonts. */
:root {
  --bg: #f4f1e8;
  --surface: #fffdf6;
  --ink: #1b2a23;
  --muted: #55645b;
  --line: #d9d4c1;
  --forest: #1d4836;
  --forest-deep: #10281f;
  --moss: #5d8a3a;
  --gold: #a87315;
  --btn: #1d4836;
  --btn-ink: #ffffff;
  --btn-hover: #14362a;
  --focus: #0b6b4c;
  --tint: #ebe8d9;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1914;
    --surface: #15241d;
    --ink: #e6ede8;
    --muted: #a2b2a8;
    --line: #27392f;
    --forest: #8fcfa9;
    --moss: #8fbf6a;
    --gold: #d9a63f;
    --btn: #62b184;
    --btn-ink: #08150e;
    --btn-hover: #7cc79b;
    --focus: #9be0b8;
    --tint: #1b2d24;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--moss); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--btn); color: var(--btn-ink); padding: 10px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 780px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); margin-top: 0; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.eyebrow { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: block; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.12rem/1 var(--serif); }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .short { display: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 500; position: relative; }
.nav a:hover { background: var(--tint); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--forest); font-weight: 650; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--moss); border-radius: 2px; }
.nav a.cta { background: var(--btn); color: var(--btn-ink); margin-left: 6px; }
.nav a.cta:hover { background: var(--btn-hover); color: var(--btn-ink); }
.nav a.cta[aria-current="page"]::after { display: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; padding: 0; cursor: pointer; color: var(--ink); }
.menu-btn svg { width: 22px; height: 22px; display: block; margin: auto; }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded="true"] .x { display: block; }
.menu-btn[aria-expanded="true"] .burger { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .js .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; gap: 2px; }
  .js .nav.open { display: flex; }
  .nav a { padding: 13px 12px; font-size: 1.05rem; }
  .nav a[aria-current="page"]::after { left: 12px; right: auto; width: 28px; bottom: 6px; }
  .nav a.cta { margin: 8px 0 0; text-align: center; }
  html:not(.js) .nav { flex-wrap: wrap; justify-content: flex-end; }
  html:not(.js) .bar { flex-wrap: wrap; padding-block: 8px; }
}
@media (max-width: 400px) { .brand .full { display: none; } .brand .short { display: inline; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem/1 var(--sans); text-decoration: none; background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: 9px; padding: 14px 22px; cursor: pointer; transition: background .15s, transform .15s, border-color .15s; min-height: 46px; }
.btn:hover { background: var(--btn-hover); color: var(--btn-ink); border-color: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--forest); border-color: var(--line); }
.btn.ghost:hover { background: var(--tint); color: var(--forest); border-color: var(--forest); }
.btn.small { padding: 8px 14px; font-size: .9rem; min-height: 38px; }
.btn.light { background: #f3f1e4; color: #10281f; border-color: #f3f1e4; }
.btn.light:hover { background: #fff; color: #10281f; }
.btn.outline-light { background: transparent; color: #f3f1e4; border-color: rgba(243,241,228,.45); }
.btn.outline-light:hover { background: rgba(243,241,228,.1); color: #fff; border-color: #f3f1e4; }
.btn.primary { width: 100%; font-size: 1.05rem; padding: 16px 22px; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1100px 420px at 85% -10%, #2c6a4f 0%, transparent 60%), linear-gradient(180deg, #123226 0%, #0d241b 100%); color: #eef0e3; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 90px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath fill='%2308170f' fill-opacity='.55' d='M0 90V58l30-30 24 26 26-40 28 44 22-22 30 36 26-48 28 52 24-26 30 34 26-46 28 48 24-20 30 30 26-42 28 46 24-24 30 32 26-44 28 50 24-28 30 38 26-50 28 52 24-26 30 34 26-44 28 48 24-22 30 34 26-46 28 50 24-26 30 32 26-44 28 46 24-24 30 36 26-48 28 52 24-26 30 34 26-44 28 48 24-22 30 30 26-42 28 46 24-24 30 36 26-48 28 50 24-26 30 32 26-44 28 48 24-22 30 34 26-46 28 50 24-26 30 32 26-44 28 46 24-24 30 36 26-48 28 52 24-26V90z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat; pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-block: clamp(48px, 8vw, 96px) clamp(64px, 9vw, 112px); }
.hero h1 { color: #fbfaf1; }
.hero .lead { color: #c5d3c8; }
.hero .eyebrow { color: #dfb85c; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.sample { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 22px; backdrop-filter: blur(2px); }
.sample h2 { font-size: .8rem; font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #dfb85c; margin: 0 0 14px; }
.sample ul { list-style: none; margin: 0; padding: 0; }
.sample li { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sample li:first-child { border-top: 0; padding-top: 0; }
.sample b { display: block; font: 600 1.25rem/1.2 var(--serif); color: #fbfaf1; }
.sample span { font-size: .92rem; color: #b7c7bb; }
.sample p { font-size: .85rem; color: #98ab9e; margin: 14px 0 0; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- sections ---------- */
.section { padding-block: clamp(44px, 7vw, 80px); }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (min-width: 801px) { .split.contact { grid-template-columns: 1.3fr 1fr; } }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.style-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.style-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.style-list .num { font: 700 1.4rem/1 var(--serif); color: var(--gold); }
.style-list h3 { margin: 0 0 4px; }
.style-list p { margin: 0; color: var(--muted); font-size: .98rem; }
.style-list .eg { font-family: var(--serif); font-style: italic; color: var(--forest); }
.style-list a.go { font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .style-list li { grid-template-columns: 36px 1fr; } .style-list .go-cell { grid-column: 2; } }

.steps { list-style: none; counter-reset: s; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps li { counter-increment: s; border-top: 3px solid var(--moss); padding-top: 16px; }
.steps li::before { content: counter(s); display: block; font: 700 2.2rem/1 var(--serif); color: var(--gold); margin-bottom: 8px; }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 22px; } }

.uses { columns: 2; column-gap: 40px; margin: 22px 0 0; padding: 0; list-style: none; }
.uses li { break-inside: avoid; padding: 0 0 18px 22px; position: relative; }
.uses li::before { content: ""; position: absolute; left: 0; top: .62em; width: 9px; height: 9px; background: var(--moss); border-radius: 50% 0 50% 0; transform: rotate(45deg); }
.uses b { display: block; }
@media (max-width: 700px) { .uses { columns: 1; } }

.callout { border-left: 4px solid var(--moss); background: var(--tint); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 22px 0; }
.callout p:last-child { margin: 0; }

.cta-band { background: var(--forest-deep); color: #eef0e3; text-align: center; padding-block: clamp(44px, 7vw, 76px); }
.cta-band h2 { color: #fbfaf1; }
.cta-band p { color: #c5d3c8; max-width: 52ch; margin-inline: auto; }
.cta-band .hero-actions { justify-content: center; }

/* ---------- inner pages ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(28px, 5vw, 48px); }
.page-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); margin-bottom: .3em; }
.page-head .lead { margin: 0; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
.prose { padding-block: clamp(32px, 5vw, 56px); }
.prose h2 { margin-top: 1.8em; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.meta { color: var(--muted); font-size: .92rem; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 32px; }
.toc b { display: block; margin-bottom: 6px; font-family: var(--serif); }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.toc li { margin: 0 0 4px; font-size: .95rem; }
@media (max-width: 600px) { .toc ul { columns: 1; } }

.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .97rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--serif); background: var(--tint); }
tr:last-child td { border-bottom: 0; }

.formula { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin: 18px 0; font-family: var(--serif); }
.formula > span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.formula b { display: block; font-size: 1.3rem; color: var(--forest); }
.formula small { color: var(--muted); font-family: var(--sans); }
.formula .op { border: 0; background: none; align-self: center; padding: 0 2px; font-size: 1.4rem; color: var(--gold); }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font: 600 1.08rem/1.4 var(--serif); padding: 16px 32px 16px 0; position: relative; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; color: var(--gold); }
details[open] summary::after { content: "\2212"; }
details p { color: var(--muted); padding-right: 24px; }

/* ---------- generator ---------- */
.tool-shell { padding-block: clamp(28px, 5vw, 48px); }
.tool-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
@media (max-width: 920px) { .tool-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.panel h2 { font-size: 1.25rem; margin-bottom: 14px; }
.controls { display: grid; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > label { font-weight: 600; font-size: .92rem; margin-bottom: 6px; display: block; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg label { position: relative; text-align: center; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 11px 6px; font-size: .95rem; cursor: pointer; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--btn); color: var(--btn-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; min-height: 46px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: .98rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--btn); flex: none; }

.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.results-head h2 { margin: 0; }
.bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.name-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 640px) { .name-grid { grid-template-columns: 1fr; } }
.card, .fav { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card { animation: rise .35s ease both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card-info { min-width: 0; }
.card-name { display: block; font: 600 1.18rem/1.25 var(--serif); overflow-wrap: anywhere; }
.card-meaning { display: block; font-size: .86rem; color: var(--muted); margin-top: 2px; }
.card-acts { display: flex; gap: 6px; flex: none; }
.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; margin: 0; }
.side { display: grid; gap: 22px; }
.status { min-height: 1.4em; font-size: .92rem; color: var(--forest); margin: 12px 0 0; }
.hint { font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
[hidden] { display: none !important; }

/* ---------- contact form ---------- */
.form { display: grid; gap: 16px; max-width: 620px; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; min-height: 46px; }
.field textarea { min-height: 150px; resize: vertical; }
.field [aria-invalid="true"] { border-color: #b3261e; }
.err { color: #b3261e; font-size: .9rem; margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .err { color: #ff9a92; } .field [aria-invalid="true"] { border-color: #ff9a92; } }
.note-ok { border-left: 4px solid var(--moss); background: var(--tint); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--forest-deep); color: #c5d3c8; padding-block: 48px 28px; font-size: .96rem; }
.site-footer a { color: #e6ecdd; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px; }
.site-footer h2 { font: 600 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #dfb85c; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .brand { color: #fbfaf1; margin-bottom: 12px; }
.fine { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 20px; font-size: .86rem; color: #93a79a; }
.fine p { margin: 0 0 6px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .site-header, .site-footer, .menu-btn, .cta-band { display: none; } body { background: #fff; color: #000; } }
