:root {
  --bg: #1c0f0a;
  --panel: #2a1710;
  --panel-2: #351d13;
  --cream: #f3e6cf;
  --muted: #cdb79a;
  --amber: #e3a04a;
  --copper: #b8742e;
  --line: rgba(227, 160, 74, 0.38);
  --serif: "Hoefler Text", "Big Caslon", Garamond, "EB Garamond", "Palatino Linotype", "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--cream); font: 400 1.15rem/1.6 var(--serif);
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(227, 160, 74, 0.16), transparent 60%),
    var(--bg);
}
[hidden] { display: none !important; }
a { color: var(--amber); text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -80px; z-index: 20; background: var(--amber); color: var(--bg); padding: 0.6rem 1rem; }
.skip:focus { top: 12px; }

.small-caps { font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.2em; color: var(--amber); font-size: 1.05rem; }

/* Header */
.site-header {
  max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter);
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--cream); text-decoration: none; font-size: 1.8rem; letter-spacing: 0.02em; }
.brand svg { width: 30px; height: 30px; }
.brand em { color: var(--amber); }
.site-header ul { display: flex; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.site-header nav a { color: var(--cream); text-decoration: none; font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.2em; font-size: 1.05rem; }
.site-header nav a:hover { color: var(--amber); }

/* Label frame */
.label-hero { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter); }
.label-frame {
  position: relative; max-width: 760px; margin: 0 auto; text-align: center;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px);
  border: 1px solid var(--amber); outline: 1px solid var(--line); outline-offset: 8px;
  background: linear-gradient(180deg, rgba(227, 160, 74, 0.07), rgba(227, 160, 74, 0.02));
}
.label-frame::before, .label-frame::after {
  content: "◆"; position: absolute; left: 50%; transform: translateX(-50%);
  color: var(--amber); background: var(--bg); padding: 0 0.6rem; font-size: 0.8rem; line-height: 1;
}
.label-frame::before { top: -0.45rem; }
.label-frame::after { bottom: -0.45rem; }
.label-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin: 0.6rem 0 1rem; letter-spacing: -0.01em; }
.label-hero h1 em { color: var(--amber); }
.lede { color: var(--muted); max-width: 44ch; margin: 0 auto 0.5rem; font-size: 1.2rem; }
.rule { display: flex; align-items: center; gap: 1rem; color: var(--amber); margin: 1.25rem auto; max-width: 260px; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.65rem 1.4rem;
  background: var(--amber); color: var(--bg); border: 1px solid var(--amber);
  font: 400 1.05rem/1 var(--serif); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.16em; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--cream); border-color: var(--cream); color: var(--bg); }
.btn-line { background: transparent; color: var(--amber); }
.btn-line:hover { color: var(--bg); }
.btn-text { background: none; border: 0; color: var(--muted); font: italic 1.05rem var(--serif); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; padding: 0.5rem; }
.btn-text:hover { color: var(--cream); }

/* Sections */
section { max-width: 1120px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter); }
.section-head { text-align: center; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-top: 0.4rem; }
.section-lede { color: var(--muted); max-width: 56ch; margin: 1rem auto 0; }
.taste, .families, .notebook { border-top: 1px solid var(--line); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.steps li { text-align: center; padding: 1.4rem 1rem 1.6rem; border: 1px solid var(--line); background: var(--panel); }
.roman { display: block; font-size: 2rem; color: var(--amber); font-style: italic; margin-bottom: 0.4rem; }
.steps h3 { font-size: 1.5rem; font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.steps p { color: var(--muted); font-size: 1.02rem; }

.family-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 5vw, 64px); }
.family-list div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.25rem 1.25rem; padding: 1.25rem 0; border-bottom: 1px dotted var(--line); }
.family-list dt { font-size: 1.45rem; font-style: italic; color: var(--amber); }
.family-list dd { margin: 0; }
.family-list .notes { color: var(--muted); font-style: italic; margin-top: 0.35rem; font-size: 1.02rem; }

/* Notebook */
.notebook-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.wheel-panel { position: sticky; top: 16px; }
.stage { border: 0; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; }
.stage legend { width: 100%; text-align: center; font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.16em; color: var(--amber); margin-bottom: 0.4rem; padding: 0; }
.stage label, .inline-radios label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
input[type="radio"] { accent-color: var(--amber); width: 1.05rem; height: 1.05rem; }

.wheel { display: block; width: 100%; max-width: 420px; margin: 0 auto; height: auto; }
.wheel .seg path { stroke: var(--bg); stroke-width: 2; transition: transform 0.25s ease; transform-origin: 150px 150px; }
.wheel .seg { cursor: pointer; outline: none; }
.wheel .seg:hover path, .wheel .seg:focus-visible path { transform: scale(1.03); }
.wheel .seg[aria-pressed="true"] path { stroke: var(--cream); stroke-width: 3; }
.wheel .seg:focus-visible path { stroke: var(--cream); stroke-width: 3; stroke-dasharray: 6 4; }
.wheel text { font: 400 14px var(--serif); pointer-events: none; letter-spacing: 0.04em; }
.wheel .hub-title { font-size: 13px; fill: var(--muted); font-style: italic; }
.wheel .hub-name { font-size: 20px; fill: var(--cream); }

.chips-wrap { margin-top: 1.25rem; text-align: center; }
.chips-wrap h3 { font-size: 1.25rem; font-style: italic; color: var(--muted); margin-bottom: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.chip {
  font: 400 1.02rem/1 var(--serif); color: var(--cream); background: var(--panel); border: 1px solid var(--line);
  padding: 0.55rem 0.9rem; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--amber); }
.chip[aria-pressed="true"] { background: var(--amber); color: var(--bg); border-color: var(--amber); }

.card {
  background: var(--cream); color: #2a1710; padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--amber); outline: 1px solid var(--line); outline-offset: 6px;
}
.card .small-caps { color: #7a4a1a; }
.card-head { text-align: center; border-bottom: 1px solid #c9a97c; padding-bottom: 0.6rem; margin-bottom: 1.1rem; }
.card :focus-visible { outline-color: #7a4a1a; }
.field { margin-bottom: 1rem; }
.field label, .inline-radios legend, .stage-list h3 { display: block; font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.14em; font-size: 1rem; color: #6b3f18; margin-bottom: 0.25rem; padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; font: 400 1.1rem/1.4 var(--serif); color: #2a1710; background: transparent;
  border: 0; border-bottom: 1px solid #8a5a2b; padding: 0.35rem 0.1rem; border-radius: 0;
}
.field textarea { border: 1px solid #b89060; padding: 0.5rem 0.6rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid #7a4a1a; outline-offset: 2px; }
.field input::placeholder, .field textarea::placeholder { color: #7f6450; font-style: italic; }
.field-row { display: grid; grid-template-columns: 1.2fr 0.8fr 1.1fr; gap: 1rem; }
.card input[type="radio"] { accent-color: #8a4f23; }

.stage-list { margin-bottom: 0.9rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 2.1rem; border-bottom: 1px dotted #b89060; padding-bottom: 0.5rem; }
.tags:empty::before { content: "Nothing yet — pick words on the wheel"; font-style: italic; color: #7f6450; font-size: 1rem; }
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem; font: 400 1rem/1 var(--serif); color: var(--cream); background: #5e3418;
  border: 0; border-radius: 999px; padding: 0.4rem 0.7rem; cursor: pointer;
}
.tag:hover { background: #8a4f23; }
.tag span[aria-hidden] { font-size: 1.1rem; line-height: 0.8; }

.inline-radios { border: 0; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.inline-radios legend { width: 100%; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.card .btn { background: #5e3418; border-color: #5e3418; color: var(--cream); }
.card .btn:hover { background: #2a1710; border-color: #2a1710; }
.card .btn-line { background: transparent; color: #5e3418; }
.card .btn-line:hover { background: #5e3418; color: var(--cream); }
.card .btn-text { color: #6b3f18; }
.status { min-height: 1.5em; margin-top: 0.6rem; font-style: italic; color: #5e3418; }

.responsible { border-top: 1px solid var(--line); }
.label-frame-small { max-width: 640px; padding: clamp(24px, 5vw, 44px); }
.label-frame-small h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-style: italic; color: var(--amber); margin-bottom: 0.8rem; }
.label-frame-small p { color: var(--muted); }
.placeholder-note { margin-top: 0.6rem; font-size: 0.95rem; }

.site-footer {
  max-width: 1120px; margin: 0 auto; padding: 1.75rem var(--gutter) 3rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; color: var(--muted); font-size: 1.02rem;
}
.site-footer em { color: var(--amber); }

@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .notebook-grid { grid-template-columns: 1fr; }
  .wheel-panel { position: static; }
  .family-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .family-list div { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:first-child { grid-column: 1 / -1; }
  .site-header ul { gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wheel .seg:hover path, .wheel .seg:focus-visible path { transform: none; }
}
