:root {
  --ink: #18211f;
  --muted: #65716d;
  --paper: #f3ead8;
  --paper-2: #e7d8bd;
  --card: rgba(255, 252, 243, 0.82);
  --line: rgba(24, 33, 31, 0.16);
  --forest: #315b4f;
  --rust: #a54831;
  --ochre: #ce8b21;
  --blue: #315f7d;
  --plum: #74446f;
  --shadow: 0 22px 70px rgba(38, 31, 22, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(206, 139, 33, 0.24), transparent 24rem),
    radial-gradient(circle at 88% 0%, rgba(49, 91, 79, 0.22), transparent 22rem),
    linear-gradient(135deg, var(--paper), var(--paper-2));
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  line-height: 1.48;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(24, 33, 31, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.hero, main, footer { position: relative; z-index: 1; }
.hero {
  min-height: 68vh;
  padding: 22px clamp(18px, 4vw, 58px) 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.topbar {
  align-self: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.58);
  backdrop-filter: blur(14px);
}
.topbar a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
}
.topbar a:hover,
.topbar a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: clamp(24px, 5vw, 78px);
  align-items: end;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  max-width: 980px;
  margin: 0;
  font-family: "Baskerville", "Georgia", serif;
  font-size: clamp(3.1rem, 9vw, 8.2rem);
  line-height: 0.87;
  letter-spacing: -0.075em;
}
.lede {
  max-width: 760px;
  margin: 28px 0 0;
  color: #313a35;
  font-size: clamp(1.04rem, 1.5vw, 1.26rem);
}
.summary-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 252, 243, 0.76);
  box-shadow: var(--shadow);
}
.summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary-card div:last-child { border-bottom: 0; }
.summary-card strong {
  color: var(--rust);
  font-family: "Baskerville", "Georgia", serif;
  font-size: 2.35rem;
  line-height: 1;
}
.summary-card span {
  color: var(--muted);
  text-align: right;
}

main {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto 72px;
}
.protocol,
.case-section {
  margin: 18px 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 16px 50px rgba(38, 31, 22, 0.10);
}
.protocol h2,
.case-section h2 {
  margin: 0 0 14px;
  font-family: "Baskerville", "Georgia", serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.protocol-grid article,
.meta-tile {
  padding: 16px;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.50);
}
.protocol-grid h3,
.group h3 {
  margin: 0 0 8px;
  font-family: "Baskerville", "Georgia", serif;
  font-size: 1.35rem;
}
.protocol-grid p { margin: 0; color: #303a35; }

.case-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: start;
}
.case-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.case-title h2 { margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(49, 91, 79, 0.13);
  color: #263a34;
  font-size: 0.74rem;
  font-weight: 900;
}
.tag.official { background: rgba(206, 139, 33, 0.20); }
.transcript {
  max-width: 980px;
  margin: 8px 0 0;
  font-size: 1.06rem;
  color: #26302c;
}
.meta-grid {
  display: grid;
  gap: 10px;
}
.meta-tile dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.meta-tile dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.group {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.group-note {
  margin: -2px 0 14px;
  color: var(--muted);
  max-width: 880px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}
.cards.reference-duo {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  max-width: 980px;
}
.cards.retrieval-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  max-width: 980px;
}
.cards.retrieval-grid .audio-card:nth-child(5) {
  grid-column: 1 / 2;
}
.generation-section {
  display: grid;
  gap: 18px;
}
.generation-section > h3,
.generation-section > .group-note {
  margin-bottom: 0;
}
.subgroup {
  padding: 14px;
  border: 1px solid rgba(24, 33, 31, 0.10);
  border-radius: 24px;
  background: rgba(255, 252, 243, 0.40);
}
.subgroup-title {
  margin: 0 0 4px;
  font-family: "Baskerville", "Georgia", serif;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}
.subgroup-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}
.cards.generation-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}
.audio-card {
  position: relative;
  min-height: 100%;
  padding: 16px;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}
.audio-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--forest);
  opacity: 0.78;
}
.audio-card.reference::before { background: var(--ochre); }
.audio-card.speaker::before { background: var(--blue); }
.audio-card.lower::before { background: #616a70; }
.audio-card.direct::before { background: var(--plum); }
.audio-card.baseline::before { background: var(--blue); }
.audio-card.oracle::before { background: var(--rust); }
.audio-card h4 {
  margin: 0 0 8px 6px;
  font-size: 1rem;
}
.audio-card p {
  margin: 0 0 10px 6px;
  color: var(--muted);
  font-size: 0.88rem;
}
.file-path {
  display: block;
  margin: 8px 0 10px 6px;
  color: rgba(24, 33, 31, 0.58);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
audio {
  width: 100%;
  height: 38px;
  margin-top: 4px;
}
footer {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto 32px;
  color: var(--muted);
}
footer a { color: var(--forest); font-weight: 900; }

@media (max-width: 920px) {
  .hero-grid,
  .case-head,
  .protocol-grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .cards.reference-duo,
  .cards.retrieval-grid,
  .cards.generation-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .cards.retrieval-grid .audio-card:nth-child(5) {
    grid-column: auto;
  }
  .topbar { align-self: stretch; border-radius: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .case-section {
    animation: rise 0.55s ease both;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
