:root {
  --bg: #f4efe6;
  --bg-elev: #fffdf8;
  --ink: #1c1915;
  --muted: #5e574d;
  --faint: #8a8276;
  --rule: #d8cfc0;
  --accent: #9a3412;
  --accent-ink: #fff7ed;
  --match: #ecfccb;
  --match-ink: #365314;
  --warn: #ffedd5;
  --max: 68rem;
  --measure: 62ch;
  --sans: "Söhne", "IBM Plex Sans", "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  background:
    radial-gradient(1200px 400px at 10% -10%, #fde7c866, transparent 50%),
    var(--bg);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: #7c2d12;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
.site-footer {
  font-family: var(--sans);
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.25rem;
}

.wordmark {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.05rem;
}

.wordmark span {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
  font-size: 0.92rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer {
  margin-top: 4rem;
  padding: 1.4rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.lede {
  max-width: var(--measure);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1,
h2,
h3 {
  font-family: var(--sans);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 650;
  margin: 0 0 0.85rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.2rem 0 0.7rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.45rem;
}

.lede p,
.prose p,
.prose li {
  color: var(--ink);
}

.lede > p,
.prose {
  max-width: var(--measure);
}

.prose p,
.lede p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.subhead {
  font-size: 1.2rem;
  color: var(--muted);
}

.meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--faint);
}

.answers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  /* Containing block for the open panel. Anchoring to the strip rather than to
     each chip is what keeps the panel on screen: these chips wrap, so a chip's
     position in source order tells you nothing about where it lands visually. */
  position: relative;
}

.chip-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.chip-menu summary::-webkit-details-marker {
  display: none;
}

.chip-menu summary::after {
  content: "";
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.1rem;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: translateY(-0.08em) rotate(45deg);
}

.chip-menu[open] summary {
  border-color: var(--ink);
}

.chip-menu[open] summary::after {
  transform: translateY(0.08em) rotate(225deg);
}

.chip-menu summary:hover,
.chip-menu summary:focus-visible {
  border-color: var(--ink);
}

.answers span {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-panel {
  position: absolute;
  z-index: 4;
  top: calc(100% + 0.35rem);
  left: 0;
  width: max-content;
  max-width: 100%;
  padding: 0.3rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 0.7rem;
  box-shadow: 0 8px 24px #1c19151a;
}

.chip-panel .menu-question {
  margin: 0.2rem 0.65rem 0.35rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 650;
}

.chip-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-panel a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  color: var(--ink);
  text-decoration: none;
}

.chip-panel a:hover {
  background: #0000000d;
}

.chip-panel a[aria-current="true"] {
  background: var(--match);
  color: var(--match-ink);
}

#match-banner {
  margin: 0 0 0.85rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.8rem;
  margin: 1.5rem 0 0;
}

.btn {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--ink);
  color: var(--bg-elev);
  background: var(--ink);
}

.btn:hover {
  color: var(--bg-elev);
  background: #000;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
}

.btn-quiet:hover {
  color: var(--ink);
  background: #0000000d;
}

.progress {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--faint);
  margin: 0 0 0.85rem;
}

.options {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: grid;
  gap: 0.7rem;
  max-width: 40rem;
}

.options a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 0.7rem;
  padding: 0.9rem 1rem 0.95rem;
}

.options a:hover {
  border-color: var(--ink);
}

.options strong {
  display: block;
  font-family: var(--sans);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.options span {
  color: var(--muted);
  font-size: 0.98rem;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 0.8rem;
  padding: 1rem 1.1rem 1.15rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.tiers {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0 1.5rem;
  font-family: var(--sans);
}

.tiers th,
.tiers td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.tiers th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-weight: 650;
}

.recipe {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  padding: 1.2rem 1.2rem 1.3rem;
  margin: 0 0 1rem;
}

.recipe[data-match="true"] {
  border-color: #65a30d;
  box-shadow: 0 0 0 3px #ecfccb;
}

/* Green is reserved for "this one matched you". An unmatched card's tier pill
   is neutral, so the one green card on the page is the one that means something. */
.recipe .tier {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin: 0 0 0.6rem;
}

.recipe[data-match="true"] .tier {
  color: var(--match-ink);
  background: var(--match);
  border-color: transparent;
}

.recipe h2 {
  margin: 0 0 0.6rem;
}

.callout {
  background: var(--warn);
  border-radius: 0.7rem;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
}

.callout p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.catalog-note {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.places {
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 800px) {
  .places {
    grid-template-columns: 1fr 1fr;
  }
}

dl.compact dt {
  font-family: var(--sans);
  font-weight: 650;
  margin-top: 0.9rem;
}

dl.compact dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.self {
  margin-top: 2.5rem;
  padding-top: 0.2rem;
}

a.term {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
  cursor: help;
}

a.term:hover,
a.term:focus-visible {
  color: var(--accent);
}

@media (hover: hover) {
  a.term {
    position: relative;
  }

  a.term:hover::after,
  a.term:focus-visible::after {
    content: attr(data-def);
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.45rem);
    z-index: 6;
    width: max(18rem, 100%);
    max-width: min(26rem, 80vw);
    padding: 0.55rem 0.7rem;
    background: var(--ink);
    color: var(--bg-elev);
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    border-radius: 0.45rem;
    white-space: normal;
    box-shadow: 0 8px 24px #1c191533;
    pointer-events: none;
  }
}

.glossary-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0 0 2rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.glossary-entry {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  padding: 1.1rem 1.2rem 1.15rem;
  margin: 0 0 0.85rem;
  scroll-margin-top: 1.25rem;
}

.glossary-entry h3 {
  font-size: 1.2rem;
  margin: 0.15rem 0 0.5rem;
}

.glossary-entry p:last-child {
  margin-bottom: 0;
}

.glossary-entry:target {
  border-color: #65a30d;
  box-shadow: 0 0 0 3px #ecfccb;
}
