:root {
  color-scheme: light;
  --ink: #2b211b;
  --muted: #66574e;
  --accent: #9a391f;
  --accent-hover: #792b17;
  --paper: #fbf5ed;
  --surface: #fffcf7;
  --tint: #f4e8db;
  --line: #dacbbc;
  --field-line: #a89585;
  --gutter: clamp(20px, 5vw, 60px);
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.mast, main, footer {
  width: min(calc(100% - 2 * var(--gutter)), 1120px);
  margin-inline: auto;
}

.mast, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-block: 20px;
}

.mast { border-bottom: 1px solid var(--line); }
main { flex: 1; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.mast nav, footer nav, .actions { display: flex; align-items: baseline; gap: 12px 20px; flex-wrap: wrap; }
.mast nav a { font-weight: 650; font-size: .95rem; text-decoration: none; }
.mast nav a:hover, .mast nav a[aria-current] { text-decoration: underline; }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 clamp(1.1rem, 3vw, 1.55rem)/1.2 Georgia, serif;
  color: var(--ink);
  text-decoration: none;
}

h1, h2 {
  font-family: Georgia, serif;
  letter-spacing: -.035em;
  line-height: 1.08;
  margin: 0 0 .45em;
}

h1 { font-size: clamp(2.55rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1rem; margin: 18px 0 4px; }
p { margin: 0 0 1em; }
.lede { color: var(--muted); max-width: 49ch; font-size: clamp(1.06rem, 2.3vw, 1.25rem); }
.quiet { color: var(--muted); font-size: .9rem; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(46px, 8vw, 108px) 0;
}

.hero > *, .topic-grid > * { min-width: 0; }
.hero h1 { font-size: clamp(2.9rem, 6.5vw, 5.3rem); }
.hero .quiet { margin: 12px 0 0; }
.preview, .topic {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 32px);
}

.preview {
  position: relative;
  transform: rotate(-1deg);
  box-shadow: 0 8px 20px #62462a13;
}

.preview p:last-child { margin: 0; }
.preview-mascot { position: absolute; top: -27px; right: 22px; transform: rotate(9deg); }
.eyebrow, .topic-label { color: var(--accent); font-size: .85rem; font-weight: 700; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.delivery-note { padding-block: 30px; border-top: 1px solid var(--line); }
.about-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 32px 0; }
.about-steps section, .empty-topics { background: var(--tint); border-radius: 14px; padding: 22px; }
.about-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.about-heading img { width: clamp(55px, 10vw, 100px); height: auto; transform: rotate(9deg); }
.about dt { font-weight: 700; }
.about dd { margin: 0 0 .55em; color: var(--muted); }

.narrow, .account, .about { padding-block: clamp(36px, 6vw, 74px); }
.narrow { max-width: 560px; margin-inline: auto; }
.account-head { margin-bottom: 28px; }
.account-head p { margin-bottom: 6px; overflow-wrap: anywhere; }
.topic-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: start; }
.topic-grid:has(> :only-child) { grid-template-columns: minmax(0, 650px); }
.saved-topic { padding: 0; margin-bottom: 12px; }
.saved-topic summary { padding: 16px 20px; cursor: pointer; overflow-wrap: anywhere; }
.saved-topic summary .quiet { display: block; margin: 4px 0 0 1.15em; }
.saved-description { font: 700 1.2rem/1.35 Georgia, serif; }
.topic-edit { border-top: 1px solid var(--line); padding: 20px; }
.empty-topics p { margin-bottom: 0; }
.account-controls { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.account-controls p { margin: 0; }

form { display: grid; gap: 9px; }
label, legend { font-weight: 650; font-size: .94rem; }
input, textarea, select, button, .button {
  font: inherit;
  border: 1px solid var(--field-line);
  border-radius: 7px;
  padding: 10px 13px;
}

input, textarea, select { width: 100%; color: var(--ink); background: var(--surface); }
textarea { resize: vertical; min-height: 75px; }
.checkbox { display: flex; gap: 9px; align-items: center; }
.checkbox input { width: 1.1rem; height: 1.1rem; flex: none; margin: 0; accent-color: var(--accent); }
.field-help { margin: 0; }
.level-picker { min-width: 0; border: 0; padding: 0; margin: 8px 0; }
.level-picker legend { padding: 0; margin-bottom: 6px; }
.level-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 7px; }
.level-options label { position: relative; cursor: pointer; }
.level-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.level-options span {
  display: block;
  text-align: center;
  font-size: clamp(.72rem, 2.7vw, .94rem);
  padding: 7px 2px;
  border: 1px solid var(--field-line);
  border-radius: 6px;
}
.level-options input:checked + span { background: var(--accent); color: white; border-color: var(--accent); }
.level-options input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
button, .button {
  display: inline-block;
  width: fit-content;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}
button:hover, .button:hover { color: white; background: var(--accent-hover); }
.secondary { background: var(--surface); color: var(--accent); }
.link, .link:hover {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.add-topic button { width: 100%; margin-top: 5px; }
.signup { grid-template-columns: minmax(0, 1fr) auto; max-width: 445px; }
.signup label { grid-column: 1 / -1; }
.actions { margin-top: 12px; }
.message { border-left: 3px solid var(--accent); padding: 8px 14px; background: var(--tint); }

@media (max-width: 760px) {
  .hero, .about-steps, .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 48px; }
  .preview { transform: none; }
  .about-steps { gap: 12px; }
}

@media (max-width: 400px) {
  .signup { grid-template-columns: minmax(0, 1fr); }
  .mast { gap: 6px 16px; }
}

.admin-dashboard section { margin-block: 24px; }
.admin-dashboard dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 20px; }
.admin-dashboard dt { font-weight: 600; }
.admin-dashboard dd { margin: 0; overflow-wrap: anywhere; }
.admin-dashboard li { margin-block: 8px; overflow-wrap: anywhere; }
.signup-chart { display: block; width: 100%; max-width: 600px; fill: currentColor; }
.signup-chart-dates { display: flex; justify-content: space-between; max-width: 600px; margin-block: 4px 12px; }
