:root {
  /* RoohVibe "Soulful Elegance" palette — dark theme (default) */
  --raisin-black: #201e21;
  --atomic-grey: #535353;
  --apache-gold: #d8bd71;
  --dark-pastel: #bea256;
  --golden-amber: #e8bf5a;

  --bg: var(--raisin-black);
  --surface: #2a272a;
  --surface-2: #322e32;
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(216, 189, 113, 0.35);
  --ink: #ece7e0;
  --muted: #9b9599;
  --champagne: var(--apache-gold);
  --champagne-light: var(--golden-amber);
  --champagne-deep: var(--dark-pastel);
  --header-bg: rgba(23, 20, 15, 0.75);
  --glow-tint: rgba(216, 189, 113, 0.06);
  --glow-shadow: rgba(0, 0, 0, 0.5);
  --vignette: rgba(0, 0, 0, 0.1);
  --cock-color: #4ade80;
  --hen-color: #fb7185;
  --wordmark-green: #38d16a;
  --wordmark-red: #ff6b6b;
  /* Selected-mutation dropdown fill — a fixed warm highlight (not theme-relative)
     so a chosen mutation pops clearly in both light and dark theme. */
  --select-selected-bg: #f7efd9;
  --select-selected-ink: #6b5226;

  /* Text color for gold-tinted translucent chips (badges, notes) — needs its own
     tuning since --champagne-deep alone is too dim against these tinted backdrops
     in dark theme (measured ~4.4:1, under the 4.5:1 AA floor). */
  --tint-ink: var(--golden-amber);

  /* Fixed vivid trio for self-contained brand elements (buttons, underlines) —
     stays the same across both themes, unlike --champagne* which adapts for text contrast. */
  --gradient-brand: linear-gradient(120deg, #bea256 0%, #d8bd71 50%, #e8bf5a 100%);
  /* Text-fill gradient (hero headline, wordmark) — direction flips per theme so it stays legible. */
  --gradient-text: linear-gradient(100deg, #fff 20%, var(--champagne-light) 60%, var(--champagne) 100%);

  --glow-soft: 0 0 0 1px var(--border-accent), 0 10px 30px rgba(0, 0, 0, 0.5);
  --glow-strong: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --hairline: linear-gradient(90deg, transparent 0%, var(--champagne) 50%, transparent 100%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f1ece2;
  --border: rgba(32, 26, 18, 0.09);
  --border-accent: rgba(158, 124, 58, 0.4);
  --ink: #221d18;
  --muted: #6e655c;
  --champagne: #8f6f33;
  --champagne-light: #a9843f;
  --champagne-deep: #6b5226;
  --header-bg: rgba(255, 252, 246, 0.85);
  --glow-tint: rgba(180, 140, 60, 0.08);
  --glow-shadow: rgba(120, 95, 46, 0.06);
  --vignette: rgba(120, 95, 46, 0.08);
  --cock-color: #166534;
  --hen-color: #a3282f;
  --wordmark-green: #217a3c;
  --wordmark-red: #d31f2b;
  --tint-ink: #6b5226;
  --gradient-text: linear-gradient(100deg, var(--ink) 15%, var(--champagne-deep) 55%, var(--champagne) 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    var(--noise) repeat,
    radial-gradient(ellipse 900px 500px at 15% -10%, var(--glow-tint), transparent 60%),
    radial-gradient(ellipse 900px 500px at 90% 10%, var(--glow-shadow), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: 'Cinzel', Georgia, serif;
  margin: 0;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Header ---------- */

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  position: relative;
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--gradient-brand);
  opacity: 0.6;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.logo-frame {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, rgba(216, 189, 113, 0.2), var(--vignette) 70%);
  border: 1px solid var(--border-accent);
  box-shadow: var(--glow-soft);
  display: grid;
  place-items: center;
  padding: 5px;
}

.brand .logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
}

.brand-name-text,
.brand-location {
  display: block;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-location {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.brand-name:hover .brand-name-text,
.brand-name:hover .brand-location {
  opacity: 0.8;
}

.powered-by {
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  background: var(--surface);
  color: var(--champagne-light);
  cursor: pointer;
  box-shadow: var(--glow-soft);
  transition: transform 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--champagne);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 76px 24px 32px;
  text-align: center;
}

.hero .kicker {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--champagne-deep);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-logo {
  display: flex;
  justify-content: center;
}

/* Icon placeholder + wordmark, centered as one unit. Both pieces cap their
   size as a fraction of the viewport (not just a fixed px max), so the
   lockup always fits on narrow phones instead of overflowing the screen. */
.hero-lockup {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 20px);
  line-height: 0;
  max-width: 100%;
}

/* Wraps just the wordmark image (not the taller icon beside it), so the
   badge below can anchor to the wordmark's own top/right edges — which
   sit almost exactly at the top of "N" and the end of "a" respectively,
   per pixel analysis of the cropped wordmark art (top content row = 4px
   of 108px height; "Neophema" text right edge = 396px of 401px width). */
.wordmark-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.beta-badge {
  position: absolute;
  top: 38%;
  left: 99%;
  transform: translateY(-50%);
  margin-left: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-style: italic;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

.hero-icon {
  flex: 0 0 auto;
  height: clamp(38px, 9vw, 90px);
  width: auto;
}

/* Wordmark graphic — cropped from the actual designed logo sheet (vector
   source, rasterized at high resolution) rather than approximated with a
   web font, so it matches the reference exactly. Sized as a modest brand
   mark (not a dominant hero element) — proportionate to the kicker text
   above it and the card headers below, not competing with either. */
.hero-logo-light,
.hero-logo-dark {
  width: auto;
  max-width: min(320px, 62vw);
  height: auto;
}

.hero-logo-light {
  display: none;
}

.hero-logo-dark {
  display: block;
}

[data-theme="light"] .hero-logo-light {
  display: block;
}

[data-theme="light"] .hero-logo-dark {
  display: none;
}

.hero .subtitle {
  max-width: 640px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 17px;
}

.hero .subtitle em {
  color: var(--ink);
  font-style: italic;
}

/* ---------- Layout ---------- */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.parents-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 561px) {
  .parents-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.results-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

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

  .calculate-row {
    margin: 0;
  }

  .results-column {
    position: sticky;
    top: 24px;
  }
}

.parent-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.parent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--hairline);
  opacity: 0.9;
}

.parent-card h2 {
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ece7e0;
  margin: -24px -24px 20px;
  padding: 16px 24px;
  background: var(--raisin-black);
  border-bottom: 2px solid var(--champagne);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 3px 12px rgba(232, 191, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sex-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--golden-amber);
  background: rgba(216, 189, 113, 0.14);
  border: 1px solid rgba(216, 189, 113, 0.4);
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.sex-symbol {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.parent-card .help {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 14px;
  min-height: 4.7em;
}

.locus-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.locus-row:first-child {
  border-top: none;
}

.locus-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.locus-symbol {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.locus-note {
  display: block;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

select {
  width: 100%;
  max-width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 480px) {
  select {
    font-size: 13.5px;
    padding: 8px 8px;
  }
}

select:hover {
  border-color: var(--border-accent);
}

select:focus {
  outline: none;
  border-color: var(--champagne);
  box-shadow: 0 0 0 3px rgba(216, 189, 113, 0.16), 0 0 12px rgba(216, 189, 113, 0.25);
}

select.locus-set {
  border: 2px solid var(--champagne);
  padding: 8px 9px;
  background: var(--select-selected-bg);
  color: var(--select-selected-ink);
  font-weight: 700;
}

/* ---------- Advanced mutations subsection ---------- */

.advanced-group {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.advanced-group summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--champagne);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.advanced-group summary::-webkit-details-marker {
  display: none;
}

.advanced-group summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.18s ease;
  color: var(--champagne);
}

.advanced-group[open] summary::before {
  transform: rotate(90deg);
}

.advanced-group[open] summary {
  color: var(--champagne-light);
}

.advanced-group .locus-row {
  border-top: 1px solid var(--border);
}

.advanced-group .locus-row:first-of-type {
  border-top: 1px solid var(--border);
}

/* ---------- Actions ---------- */

.calculate-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 36px 0;
}

button {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 34px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#calculate-btn {
  background: var(--gradient-brand);
  color: #17140a;
  box-shadow: var(--glow-strong);
}

#calculate-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 34px rgba(0, 0, 0, 0.55);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.ghost-btn:hover {
  color: var(--ink);
  border-color: var(--border-accent);
}

/* ---------- Results ---------- */

.results {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.results h2 {
  font-size: 22px;
  color: #ece7e0;
  margin: -24px -24px 20px;
  padding: 16px 24px;
  background: var(--raisin-black);
  border-bottom: 2px solid var(--champagne);
  box-shadow: 0 3px 12px rgba(232, 191, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: var(--radius) var(--radius) 0 0;
}

.results-empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.results-guides-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.results-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.summary-head h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.summary-actions {
  display: flex;
  gap: 8px;
}

.summary-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--champagne-deep);
  background: var(--surface-2);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  /* Never transition `color` — it latches to the outgoing theme's value
     when the theme attribute flips, leaving light-theme text on dark. */
  transition: border-color 0.15s ease;
}

.summary-btn:hover {
  color: var(--champagne);
  border-color: var(--champagne);
}

.summary-cross {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.summary-cross-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-cross-parent {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.summary-cross-parent.Cock {
  color: var(--cock-color);
}

.summary-cross-parent.Hen {
  color: var(--hen-color);
}

.summary-cross-parent .sex-symbol {
  margin-right: 2px;
}

.summary-cross-sep {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 2px 0;
}

/* Compact recap variant — used in the Summary card, since the full boxed
   "Pairing" treatment already appears once above in the main results panel;
   repeating it in full reads as a duplicate rather than a recap. */
.summary-cross--compact {
  padding: 10px 14px;
  text-align: left;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.summary-cross--compact .summary-cross-label {
  display: none;
}

.summary-cross--compact .summary-cross-parent {
  font-size: 12.5px;
  line-height: 1.4;
}

.summary-cross--compact .summary-cross-sep {
  margin: 0;
}

.summary-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-list .summary-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.summary-list .summary-pct {
  flex: 0 0 auto;
  min-width: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--champagne-deep);
}

.summary-status {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--champagne-deep);
  min-height: 1em;
}

.results-guides-card h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.results-guides-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.results-guide-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.results-guide-link:hover {
  border-color: var(--border-accent);
  color: var(--champagne);
}

.results-guide-link .arrow {
  color: var(--champagne);
  font-weight: 700;
}

.global-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.global-note {
  background: rgba(216, 189, 113, 0.08);
  border: 1px solid rgba(216, 189, 113, 0.3);
  color: var(--tint-ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.outcome-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ece7e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--raisin-black);
  border-left: 5px solid var(--golden-amber);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(232, 191, 90, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.outcome-group-title.Hen {
  border-left-color: var(--dark-pastel);
  box-shadow: 0 4px 14px rgba(190, 162, 86, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.outcome-group-title .sex-symbol {
  color: inherit;
  margin-right: 2px;
}

.outcome-group-title .group-note {
  color: rgba(236, 231, 224, 0.65);
}

/* Lighter-weight recap header for the Summary card — the main results panel
   above already carries the full dark-band treatment; repeating that heavy
   chip a second time in the same scroll reads as visual noise rather than
   a second useful anchor. */
#summary-list .outcome-group-title {
  background: transparent;
  border-left-width: 3px;
  box-shadow: none;
  color: var(--ink);
  padding: 4px 4px 4px 12px;
  margin-bottom: 8px;
}

#summary-list .outcome-group-title .group-note {
  color: var(--muted);
}

.group-note {
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.outcome-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outcome-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: box-shadow 0.15s ease;
}

.outcome-row:hover {
  border-color: var(--border-accent);
  box-shadow: var(--glow-soft);
}

.outcome-prob {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--champagne-deep);
  text-align: right;
}

.outcome-body .outcome-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.outcome-body .outcome-split {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.outcome-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.badge {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tint-ink);
  background: rgba(216, 189, 113, 0.14);
  border: 1px solid rgba(216, 189, 113, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Team ---------- */

.team-section {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  position: relative;
}

.team-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 1px;
  background: var(--champagne);
  opacity: 0.6;
}

.team-section h2 {
  font-size: 18px;
  color: var(--ink);
}

.section-lead {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.team-column .section-lead {
  max-width: 380px;
}

.team-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 861px) {
  .team-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.team-column {
  min-width: 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 380px));
  gap: 20px;
}

.team-subheading {
  font-size: 18px;
  color: var(--ink);
  margin: 36px 0 0;
}

.team-subheading-top {
  margin-top: 0;
}

.contributors-grid {
  margin-top: 8px;
}

.person-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.person-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--hairline);
  opacity: 0.8;
}

.person-photo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-accent);
  display: grid;
  place-items: center;
  color: var(--champagne);
  overflow: hidden;
}

.person-photo svg {
  width: 34px;
  height: 34px;
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-name {
  font-size: 17px;
  color: var(--ink);
  margin: 0;
}

.person-role {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--champagne);
}

.person-role-secondary {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}

.person-card-placeholder {
  border-style: dashed;
  background: transparent;
}

.person-card-placeholder::before {
  opacity: 0.35;
}

.person-card-placeholder .person-photo {
  border-style: dashed;
  color: var(--muted);
}

.person-card-placeholder .person-name,
.person-card-placeholder .person-role {
  color: var(--muted);
}

.person-card-placeholder .person-bio {
  font-style: italic;
}

.person-bio {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.person-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--champagne-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 189, 113, 0.35);
}

.person-link:hover {
  color: var(--champagne);
  border-color: var(--champagne);
}

/* ---------- Credit / references ---------- */

.credit-section {
  margin-top: 40px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inspiration-box {
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--champagne);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inspiration-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.credit-section p {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 16px;
}

.credit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--champagne-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 189, 113, 0.4);
  padding-bottom: 2px;
}

.credit-link:hover {
  color: var(--champagne);
  border-color: var(--champagne);
}

.reference-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

/* Separates directly-cited published works from compiled/community material. */
.reference-group-heading {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.reference-group-heading:first-of-type {
  margin-top: 20px;
}

.reference-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-accent);
  border-radius: 10px;
  padding: 14px 18px;
}

.reference-item h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}

.reference-item-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border-accent);
}

.reference-item-link:hover {
  color: var(--champagne-deep);
}

.reference-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.reference-item p.reference-item-source {
  font-size: 12.5px;
  color: var(--muted);
  margin: 6px 0 0;
  font-style: italic;
}

.reference-item-source a {
  color: var(--champagne-deep);
  text-decoration: underline;
}

.reference-item-source a:hover {
  color: var(--champagne);
}

.reference-note {
  font-size: 14px;
  font-style: italic;
}

.back-link {
  margin-top: 28px;
}

.back-link a {
  color: var(--champagne);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.back-link a:hover {
  color: var(--champagne-light);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  padding: 32px 24px 40px;
}

.footer-brand {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.footer-brand img {
  width: 30px;
  height: 30px;
}

.footer-brand strong {
  color: var(--ink);
}

.footer-brand-link {
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.footer-brand-link:hover {
  color: var(--champagne-deep);
  text-decoration: underline;
}

.footer-legal-link {
  margin-left: auto;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 13px;
}

.footer-legal-link:hover {
  color: var(--champagne-deep);
}

.disclaimer {
  max-width: 1120px;
  margin: 14px auto 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

/* ---------- Locus guide link ---------- */

.locus-guide-link {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
  text-underline-offset: 2px;
  margin-top: 2px;
  white-space: nowrap;
}

.locus-guide-link:hover {
  color: var(--champagne-deep);
  text-decoration-color: var(--champagne-deep);
}

.locus-guide-link:hover {
  text-decoration: underline;
}

/* ---------- Mutation guide articles ---------- */

.guide-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.guide-back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.guide-back:hover {
  color: var(--champagne);
}

.guide-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 14px;
  color: var(--ink);
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.guide-meta-item {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tint-ink);
  background: rgba(216, 189, 113, 0.14);
  border: 1px solid rgba(216, 189, 113, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
}

.guide-names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 13.5px;
  color: var(--muted);
}

.guide-name-pill {
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.guide-tldr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--champagne);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.guide-tldr strong {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 8px;
}

.guide-tldr p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

.guide-body h2 {
  font-size: 22px;
  margin: 40px 0 14px;
  color: var(--ink);
}

.guide-body h3 {
  font-size: 17px;
  margin: 24px 0 10px;
  color: var(--ink);
}

.guide-body p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 14px;
}

.guide-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

.guide-body li {
  margin-bottom: 6px;
}

.guide-callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--muted);
}

.guide-callout strong {
  color: var(--ink);
}

/* Used where the calculator's model is a known simplification of the source. */
.guide-callout-warn {
  border-left: 3px solid var(--champagne);
  background: var(--surface);
}

.guide-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.guide-table th,
.guide-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.guide-table th {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.guide-table td {
  color: var(--ink);
}

.guide-sources {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.guide-sources h2 {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 10px;
}

.guide-sources ul {
  padding-left: 18px;
  margin: 0;
}

.guide-sources li {
  margin-bottom: 6px;
}

/* ---------- Informational sections (Supported mutations, FAQ) ---------- */

.info-section {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  position: relative;
}

.info-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 1px;
  background: var(--champagne);
  opacity: 0.6;
}

.info-section h2 {
  font-size: 24px;
  color: var(--ink);
}

/* ---------- Supported mutations table ---------- */

.mutation-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.mutation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mutation-table th,
.mutation-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.mutation-table thead th {
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ece7e0;
  background: var(--raisin-black);
  border-bottom: 2px solid var(--champagne);
}

.mutation-table tbody tr:last-child th,
.mutation-table tbody tr:last-child td {
  border-bottom: none;
}

.mutation-table tbody tr:hover {
  background: var(--surface-2);
}

.mutation-table tbody th {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.mutation-table td {
  color: var(--muted);
}

.mutation-table code {
  font-size: 13px;
  color: var(--champagne-deep);
}

.mutation-alias {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin-top: 2px;
}

.mutation-guide-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--champagne-deep);
  text-decoration: none;
  white-space: nowrap;
}

.mutation-guide-link:hover {
  color: var(--champagne);
  text-decoration: underline;
}

/* ---------- FAQ ---------- */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0 18px;
}

.faq-item[open] {
  border-left-color: var(--champagne);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '▸';
  flex: 0 0 auto;
  color: var(--champagne);
  transition: transform 0.18s ease;
}

.faq-item[open] summary::before {
  transform: rotate(90deg);
}

.faq-item summary:hover {
  color: var(--champagne-deep);
}

.faq-item p {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.faq-item p code {
  font-size: 13px;
  color: var(--champagne-deep);
}

/* ---------- Guides index page ---------- */

.guide-index-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.guide-group {
  margin-bottom: 52px;
}

.guide-group-head h2 {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 8px;
}

.guide-group-head p {
  max-width: 640px;
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.guide-index-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .guide-index-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 940px) {
  .guide-index-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.guide-index-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.guide-index-card:hover {
  border-color: var(--champagne);
  transform: translateY(-2px);
}

.guide-card-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.guide-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.guide-card-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tint-ink);
  background: rgba(216, 189, 113, 0.14);
  border: 1px solid rgba(216, 189, 113, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

.guide-card-tag.tag-note {
  color: var(--champagne-deep);
  background: transparent;
  border-style: dashed;
}

.guide-card-read {
  font-size: 11.5px;
  color: var(--muted);
}

.guide-card-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Top navigation ---------- */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topnav a {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  /* See .summary-btn — transitioning `color` breaks the theme swap. */
  transition: border-color 0.15s ease;
}

.topnav a:hover {
  color: var(--champagne-deep);
  border-bottom-color: var(--champagne);
}

@media (max-width: 720px) {
  .topnav {
    display: none;
  }
}

/* ---------- Standalone reference pages (mutations, faq) ---------- */

.page-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---------- Explore cards (homepage entry points) ---------- */

.explore-section {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  position: relative;
}

.explore-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 1px;
  background: var(--champagne);
  opacity: 0.6;
}

.explore-section h2 {
  font-size: 24px;
  color: var(--ink);
}

.explore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 620px) {
  .explore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .explore-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.explore-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.explore-card:hover {
  border-color: var(--champagne);
  transform: translateY(-2px);
}

.explore-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.explore-desc {
  flex: 1 1 auto;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.explore-go {
  font-size: 13px;
  font-weight: 600;
  color: var(--champagne-deep);
}
