/* dnd name generator — single stylesheet, no external assets */

:root {
  --ink: #0e0f12;
  --ink-2: #14161a;
  --ink-3: #1b1e23;
  --paper: #f2ece0;
  --paper-dim: #b9b2a4;
  --muted: #8b8578;
  --accent: #c9603f;
  --accent-soft: rgba(201, 96, 63, 0.14);
  --gold: #c8a469;
  --line: #26292f;
  --line-strong: #34383f;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(201, 96, 63, 0.10), transparent 62%),
    radial-gradient(900px 500px at 6% 4%, rgba(200, 164, 105, 0.07), transparent 60%),
    var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

a { color: var(--gold); }

/* ---------- header ---------- */
.site-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 6px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand .mark { width: 22px; height: 22px; display: block; color: var(--accent); }
.brand .mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.brand .mark polygon:last-child { fill: currentColor; stroke: none; opacity: 0.18; }

.brand-text {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--paper-dim);
}

.site-head::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--line-strong) 78%, transparent);
}

.roll-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* ---------- shell ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------- tool ---------- */
.tool { padding-top: 26px; }

h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.lede {
  margin: 0 0 22px;
  max-width: 62ch;
  color: var(--paper-dim);
  font-size: 15px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > span {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

select, input[type="number"] {
  appearance: none;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--paper);
  background: #0f1114;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

select:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  background: #0f1114;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.segmented button {
  min-height: 40px;
  padding: 0 6px;
  font: inherit;
  font-size: 13px;
  color: var(--paper-dim);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.segmented button.is-active {
  background: var(--accent-soft);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(201, 96, 63, 0.45);
}

button { font: inherit; cursor: pointer; }

.primary {
  min-height: 42px;
  padding: 0 20px;
  color: #17120f;
  background: linear-gradient(180deg, #d97752, var(--accent));
  border: 1px solid #e08a68;
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 120ms ease, filter 120ms ease;
}

.primary:hover { filter: brightness(1.05); }
.primary:active { transform: translateY(1px); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 6px;
}

.status {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ghost, .solid {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper-dim);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.ghost:hover { color: var(--paper); border-color: #4a4f58; }

.solid {
  color: var(--paper);
  background: #22262c;
  border-color: #3a3f47;
}

.solid:hover { background: #2a2f36; }

.ghost.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost.copied, .icon.copied { color: var(--gold); border-color: var(--gold); }

/* ---------- results ---------- */
.results { margin-top: 14px; }

.group {
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.group:first-child { border-top: 0; padding-top: 4px; }

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.group-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.group-title h3 {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.01em;
}

.group-title h3 span { color: var(--accent); padding: 0 2px; }

.group-count {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.names { list-style: none; margin: 0; padding: 0; }

.name-row {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}

.name-row:nth-child(5n + 1) { background: rgba(255, 255, 255, 0.012); }
.name-row:hover { background: rgba(255, 255, 255, 0.035); }

.name-row.is-locked {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
}

.meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.row-actions { display: flex; gap: 2px; }

.icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  opacity: 0.65;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease;
}

.icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.name-row:hover .icon, .icon:focus-visible { opacity: 1; }
.icon:hover { color: var(--paper); border-color: var(--line-strong); }

.is-locked .icon.lock { color: var(--accent); opacity: 1; }

/* ---------- prose ---------- */
.prose { max-width: 74ch; margin-top: 54px; }

.prose h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin-bottom: 10px;
}

.prose p { color: var(--paper-dim); margin: 0 0 12px; }

.prose ul { margin: 0 0 14px; padding-left: 18px; color: var(--paper-dim); }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--paper); font-weight: 600; }

.prose .note {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}

.facts { list-style: none; padding-left: 0; }
.facts li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- faq ---------- */
.faq { max-width: 74ch; margin-top: 54px; }

.faq h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 14px; }

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--paper);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq p { color: var(--paper-dim); margin: 10px 0 2px; }

/* ---------- footer + toast ---------- */
.site-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: #22262c;
  color: var(--paper);
  border: 1px solid #3a3f47;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- motion ---------- */
@keyframes tilt {
  0% { transform: rotate(0deg); }
  60% { transform: rotate(120deg); }
  100% { transform: rotate(120deg); }
}

.tool.is-fresh .brand .mark { animation: tilt 480ms ease-out; }
.tool.is-fresh .name { animation: fade 320ms ease-out; }

@keyframes fade {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls .primary { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .site-head { padding: 14px 16px 4px; }
  main { padding: 0 16px 64px; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 10px; }
  .field-count { grid-column: 1 / -1; }
  .toolbar { margin-top: 14px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1 1 auto; }
  .name-row { grid-template-columns: 2.6ch minmax(0, 1fr) auto; row-gap: 2px; padding: 9px 6px; }
  .name { font-size: 17px; }
  .meta { grid-column: 2; font-size: 10px; }
  .row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .icon { width: 42px; height: 42px; opacity: 0.9; }
  .segmented button { min-height: 44px; }
  .controls select, .controls input[type="number"] { min-height: 44px; }
  .toolbar-actions button { min-height: 42px; }
  .group-title h3 { font-size: 17px; }
}

@media (max-width: 360px) {
  main { padding: 0 12px 56px; }
  .controls { padding: 12px; gap: 8px; }
  .name { font-size: 15px; }
}

@media (max-width: 420px) {
  .brand-text { display: none; }
  .segmented button { font-size: 12px; }
  .name { font-size: 16px; }
}

/* ---------- static pages (about / privacy / contact) ---------- */
.brand-text { text-decoration: none; }
.brand-text:hover { color: var(--paper); }

.doc { margin-top: 34px; }
.doc h1 { margin-bottom: 18px; }
.doc h2 { margin-top: 30px; }
.doc .note { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.doc a { color: var(--gold); }

.notice {
  margin: 18px 0 6px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}
.notice p { margin: 0 0 8px; color: var(--paper); }
.notice p:last-child { margin-bottom: 0; }

.foot-links { margin: 8px 0 0; font-size: 13px; }
.foot-links a { color: var(--paper-dim); text-decoration: none; }
.foot-links a:hover { color: var(--gold); }

/* contact page: single address, set as a piece of evidence rather than a form */
.doc .mail-line {
  margin: 26px 0 22px;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(0, 0, 0, 0.28);
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: clamp(16px, 2.4vw, 20px);
  letter-spacing: 0.01em;
  word-break: break-word;
}
.doc .mail-line a { text-decoration: none; border-bottom: 1px solid rgba(212, 175, 55, 0.45); }
.doc .mail-line a:hover { border-bottom-color: var(--gold); }
