:root {
  --ink: #17211b;
  --muted: #657069;
  --paper: #f5f3ed;
  --card: #fffefa;
  --line: #d9d7cf;
  --green: #236b4b;
  --green-dark: #173d2e;
  --mint: #dfeee5;
  --amber: #a05a16;
  --amber-bg: #fff0d8;
  --red: #98413e;
  --blue: #315d7c;
  --blue-bg: #e7f0f6;
  --violet: #6c4d87;
  --shadow: 0 12px 34px rgba(30, 40, 34, 0.08);
  --content: 1320px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

button,
select,
input {
  font: inherit;
}

a {
  color: var(--blue);
}

.hero {
  position: relative;
  min-height: 300px;
  padding: 3.7rem max(1.25rem, calc((100vw - var(--content)) / 2));
  overflow: hidden;
  color: #fff;
  background: var(--green-dark);
}

.hero::after {
  position: absolute;
  top: -250px;
  right: -140px;
  width: 480px;
  height: 480px;
  content: "";
  border: 80px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
}

.eyebrow {
  position: relative;
  z-index: 1;
  color: #b9d9c7;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0.45rem 0 0.25rem;
  font: 700 clamp(3rem, 6vw, 5.4rem) / 0.95 Georgia, serif;
  letter-spacing: -0.04em;
}

.hero-section {
  position: relative;
  z-index: 1;
  margin: 0 0 1.05rem;
  color: #fff;
  font: 700 clamp(1.25rem, 2.3vw, 1.8rem) / 1.2 Georgia, serif;
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0;
  color: #dfebe4;
  font-size: 1.02rem;
}

.language-switch {
  position: absolute;
  top: 1.2rem;
  right: max(1.25rem, calc((100vw - var(--content)) / 2));
  z-index: 2;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
}

.language-button {
  min-width: 38px;
  padding: 0.32rem 0.48rem;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.language-button.is-active {
  color: var(--green-dark);
  background: #fff;
}

.guide {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(520px, 1fr);
  gap: 1.25rem;
  align-items: center;
  max-width: var(--content);
  width: calc(100% - 2.5rem);
  padding: 1.05rem 1.15rem;
  margin: 1.4rem auto 1rem;
  background: #e8eee9;
  border: 1px solid #cfdbd2;
  border-radius: 12px;
}

.guide h2 {
  margin: 0 0 0.3rem;
  font: 700 1.3rem Georgia, serif;
}

.guide p {
  margin: 0;
  color: #4f5c54;
}

.guide .switching-note {
  margin-top: 0.55rem;
}

.comparison-key {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.key-item {
  display: grid;
  gap: 0.12rem;
  padding: 0.62rem 0.55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid #a4aaa6;
  border-radius: 8px;
  font-size: 0.74rem;
}

.key-item b { font-size: 0.78rem; }
.key-item span { color: var(--muted); }
.key-baseline { border-top-color: var(--violet); }
.key-semantic { border-top-color: var(--green); }
.key-random { border-top-color: #888; }

.usage {
  width: calc(100% - 2.5rem);
  max-width: var(--content);
  margin: 0 auto 1.3rem;
}

.legend-panel {
  width: 100%;
  padding: 1rem 1.1rem;
  background: rgba(255, 254, 250, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.usage h2 {
  margin: 0 0 0.75rem;
  font: 700 1.2rem Georgia, serif;
}

.status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.status-legend > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid #e5e2da;
  border-radius: 8px;
}

.status-legend > div > span:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-legend > div {
  align-items: center;
}

.status-legend .status {
  min-width: 110px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem max(1.25rem, calc((100vw - var(--content)) / 2));
  background: rgba(245, 243, 237, 0.96);
  border-block: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) auto auto;
  gap: 0.6rem;
}

input,
select {
  padding: 0.58rem 0.7rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c8cbc5;
  border-radius: 8px;
}

#result-count {
  align-self: center;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-language {
  display: none;
  gap: 0.2rem;
  align-items: center;
  color: var(--ink);
}

.toolbar-language .language-button.is-active {
  color: #fff;
  background: #173d2e;
}

main {
  max-width: var(--content);
  padding: 0 1.25rem;
  margin: 1.4rem auto 5rem;
}

.section-intro {
  margin: 1.8rem 0 1rem;
}

.section-intro h2 {
  margin: 0 0 0.35rem;
  font: 700 2rem Georgia, serif;
}

.section-intro p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
}

.full-atlas {
  padding-top: 1.7rem;
  margin-top: 2.3rem;
  border-top: 1px solid var(--line);
}

.card {
  margin: 1rem 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.card.featured {
  border-color: #c5d4c9;
  box-shadow: 0 14px 38px rgba(35, 107, 75, 0.12);
}

.card > summary {
  list-style: none;
  cursor: pointer;
}

.card > summary::-webkit-details-marker {
  display: none;
}

.card-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
}

.card[open] > .card-head {
  border-bottom: 1px solid #e9e6dd;
}

.head-main {
  flex: 1;
  min-width: 0;
}

.card-title {
  display: block;
  margin: 0 0 0.25rem;
  font: 700 1.32rem/1.2 Georgia, serif;
}

.identity {
  color: var(--muted);
  font-size: 0.82rem;
}

.head-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

.expand-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.badge {
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  background: #ecebe5;
  border-radius: 999px;
}

.badge.featured {
  color: var(--green);
  background: var(--mint);
}

.badge.muspy {
  color: var(--blue);
  background: var(--blue-bg);
}

.badge.instrument {
  color: #654486;
  background: #eee7f5;
}

.badge.semantic {
  color: var(--green);
  background: var(--mint);
}

.status {
  padding: 0.32rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: center;
  border-radius: 999px;
}

.status.replicated,
.status.confirmed {
  color: var(--green);
  background: var(--mint);
}

.status.screen_positive {
  color: var(--amber);
  background: var(--amber-bg);
}

.status.reviewed,
.status.awaiting_review {
  color: var(--blue);
  background: var(--blue-bg);
}

.status.not_confirmed {
  color: #666;
  background: #eee;
}

.hypotheses {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
}

.evidence-panel {
  border-top: 1px solid #e2dfd6;
}

.evidence-panel > summary,
.selected-results > summary {
  padding: 0.85rem 1.25rem;
  font-weight: 720;
  cursor: pointer;
}

.evidence-panel[open] > summary,
.selected-results[open] > summary {
  border-bottom: 1px solid #e9e6dd;
}

.hypothesis {
  padding: 0.55rem 0.75rem;
  background: #faf9f5;
  border-left: 3px solid #b7bdb8;
}

.hypothesis.semantic {
  border-color: #6fa184;
}

.hypothesis.instrument {
  border-color: #8d6cab;
}

.hypothesis.muspy {
  border-color: #7197b2;
}

.hypothesis.replication {
  background: #edf7f0;
  border-color: #2c8a5c;
}

.hypothesis b {
  display: block;
}

.numbers {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.description {
  margin: 0.35rem 0 0;
}

.confound {
  margin: 0.35rem 0 0;
  color: #7a5941;
  font-size: 0.82rem;
}

.dose-wrap {
  margin-top: 0.55rem;
  overflow-x: auto;
}

.dose-table,
.outcome-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
}

.dose-table th,
.dose-table td,
.outcome-table th,
.outcome-table td {
  padding: 0.28rem 0.42rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #e4e2dc;
}

.dose-table th:first-child,
.dose-table td:first-child,
.outcome-table th:first-child,
.outcome-table td:first-child {
  text-align: left;
}

.carrier-outcomes {
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid #d9d7cf;
  border-radius: 9px;
}

.selected-results {
  margin-top: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.selected-results .carrier-outcomes {
  border: 0;
  border-radius: 0;
}

.carrier-outcomes:empty {
  display: none;
}

.listen {
  padding: 1rem 1.25rem;
  background: #f1efe8;
  border-top: 1px solid #e2dfd6;
}

.listen-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.listen-controls label {
  font-size: 0.8rem;
  font-weight: 700;
}

.prompt-text {
  color: var(--muted);
  font-style: italic;
}

.prompt-display {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-display b {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sample {
  padding: 0.7rem;
  background: #fff;
  border: 1px solid #d9d7cf;
  border-radius: 10px;
}

.sample.baseline-sample {
  border-top: 4px solid var(--violet);
}

.sample.semantic-sample {
  border-top: 4px solid var(--green);
}

.sample.random-sample {
  border-top: 4px solid #888;
}

.sample h3 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}

audio {
  width: 100%;
  height: 36px;
}

.roll-link {
  display: block;
}

.roll {
  display: block;
  width: 100%;
  height: 170px;
  margin: 0.5rem 0;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
}

.downloads {
  font-size: 0.76rem;
}

.downloads a + a {
  margin-left: 0.55rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  max-width: var(--content);
  padding: 1.1rem 1.25rem 2.5rem;
  margin: 0 auto 3rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.footer a { font-weight: 700; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(49, 93, 124, 0.35);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .guide {
    grid-template-columns: 1fr;
    margin-inline: 1.25rem;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-language {
    display: flex;
  }

  .language-switch {
    display: none;
  }
}

@media (max-width: 850px) {
  .compare {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
  }

  .head-side {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 280px;
    padding-top: 3rem;
  }

  .comparison-key { grid-template-columns: 1fr; }
  .status-legend { grid-template-columns: 1fr; }
  .status-legend > div { grid-template-columns: 1fr; }
  .status-legend .status { min-width: 0; justify-self: start; }
  .prompt-display { grid-template-columns: 1fr; gap: 0.2rem; }
}
