:root {
  --bg: #f7f5ef;
  --ink: #202126;
  --muted: #666b74;
  --panel: #ffffff;
  --line: #dedbd0;
  --dark: #050505;
  --dark-soft: #141414;
  --teal: #2f807a;
  --rose: #c93c62;
  --gold: #b5842f;
  --green-soft: #e8f2ee;
  --rose-soft: #f7e8ec;
  --gold-soft: #f6eddc;
  --shadow: 0 16px 42px rgba(18, 18, 18, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #e7e2d7;
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(14px);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.brand {
  gap: 10px;
  font-size: 1.18rem;
  font-weight: 850;
}
.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 36px;
  border: 1px solid #ded8ea;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
header {
  background: var(--dark);
  color: #fff;
}
.hero {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 48px;
  align-items: center;
  min-height: min(760px, calc(100vh - 66px));
  padding: 48px 0;
}
.hero-title-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  max-width: 900px;
}
.hero-mark {
  flex: 0 0 auto;
  width: 76px;
  height: 72px;
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  object-fit: contain;
}
header h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.65rem, 4.4vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: 0;
}
.sub {
  margin: 24px 0 0;
  max-width: 660px;
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem;
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 850;
}
.button.primary {
  background: var(--rose);
  color: #fff;
}
.button.ghost {
  border: 1px solid rgba(255,255,255,0.26);
  color: #fff;
}
.release-note {
  margin: 14px 0 0;
  max-width: 520px;
  color: rgba(255,255,255,0.52);
  font-size: 0.82rem;
  line-height: 1.45;
}
.overview-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.board-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(112px, 1fr) auto;
  min-height: 200px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,0.42);
}
.board-card.wide {
  grid-column: 1 / -1;
  min-height: 270px;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  grid-template-rows: 1fr;
}
.board-image {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.board-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  background: #fff;
}
.board-question {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(47,128,122,0.18);
  background: linear-gradient(180deg, #f4fbf7 0%, #e5f1eb 100%);
  color: #17302c;
}
.board-card.wide .board-question {
  padding: 20px 18px;
  border-top: 0;
  border-left: 1px solid rgba(47,128,122,0.18);
}
.board-question span {
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.board-question q {
  font-size: clamp(0.82rem, 1.15vw, 1rem);
  font-weight: 800;
  line-height: 1.28;
  quotes: "\201C" "\201D";
}
.board-card.wide .board-question q {
  font-size: clamp(0.96rem, 1.3vw, 1.08rem);
}
main { padding: 42px 0 58px; }
main section { scroll-margin-top: 86px; }
.intro,
.question-band,
.toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow);
}
.intro { padding: 30px; }
.intro-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 24px;
  align-items: start;
}
.section-kicker {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.intro h2,
.question-band h2,
.toolbar h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: 0;
}
.band-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}
.intro p {
  max-width: 850px;
  color: var(--muted);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.82rem;
}
.meta strong,
.meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.promise-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.promise-grid span {
  display: block;
  margin-bottom: 9px;
  color: var(--rose);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.promise-grid strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.25;
}
.promise-grid p {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.question-band {
  display: grid;
  grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 22px;
  padding: 28px;
}
.compare-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.compare-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.compare-list li:last-child {
  border-color: rgba(47,128,122,0.42);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(47,128,122,0.1);
}
.src {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}
.compare-list li:last-child .src { color: var(--teal); }
.contrast-type {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f5f4ee;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.compare-list li:last-child .contrast-type {
  background: #d8eee6;
  color: #1f665d;
}
.compare-list q {
  display: block;
  margin-top: 2px;
  line-height: 1.42;
}
q { color: var(--ink); font-size: 0.96rem; }
q:before { content: open-quote; }
q:after { content: close-quote; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 24px 28px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.filter {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}
.filter:hover,
.filter.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

#gallery {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.end-resources {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.76);
}
.end-resource-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.end-resource-head .section-kicker {
  margin: 0;
}
.end-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.end-links a,
.end-links span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}
.end-links a {
  border-color: rgba(47,128,122,0.42);
  background: #e8f2ee;
  color: var(--teal);
}
.compact-bibtex {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}
.compact-bibtex summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 850;
}
.compact-bibtex pre {
  margin: 12px 0 0;
  overflow-x: auto;
  max-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.compact-bibtex code {
  color: #27302d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}
.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(47,128,122,0.36);
  box-shadow: var(--shadow);
}
.card[open] { box-shadow: var(--shadow); }
.card[hidden] { display: none; }
.card-summary {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 22px 60px 22px 24px;
  cursor: pointer;
  list-style: none;
}
.card-summary::-webkit-details-marker { display: none; }
.card-summary:focus { outline: none; }
.card-summary:focus-visible { outline: 3px solid rgba(47,128,122,0.34); outline-offset: -3px; }
.summary-meta,
.summary-metrics,
.tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.summary-meta {
  color: var(--muted);
  font-size: 0.78rem;
}
.example-num {
  color: var(--teal);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.paper-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.paper-id a { color: var(--muted); }
.summary-title {
  margin: 0;
  max-width: 900px;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.32;
}
.summary-q {
  margin: 0;
  max-width: 900px;
  color: #87384b;
  font-size: 1rem;
  font-weight: 800;
}
.metric,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}
.metric {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.tag {
  background: #edf2f4;
  color: #31575e;
  text-transform: lowercase;
}
.pill-warn {
  background: var(--gold-soft);
  color: #856018;
}
.expand-hint {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  font-size: 1.2rem;
  transition: transform 0.18s ease;
}
.card[open] .expand-hint { transform: rotate(180deg); }

.card-body {
  display: grid;
  gap: 16px;
  padding: 0 24px 26px;
  border-top: 1px solid var(--line);
}
.panel {
  padding: 20px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.panel-trigger {
  margin-top: 22px;
  background: var(--gold-soft);
  border-color: #e8d7b9;
}
.panel-question {
  background: var(--green-soft);
  border-color: #cddfd8;
}
.panel-answer {
  background: var(--rose-soft);
  border-color: #ebcbd3;
}
.panel-title {
  margin: 0 0 2px;
  font-size: 1.02rem;
  line-height: 1.25;
}
.panel-trigger .panel-title { color: #75541c; }
.panel-question .panel-title { color: #27614b; }
.panel-answer .panel-title { color: #87384b; }
.panel-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.84rem;
}
.subsection { margin-bottom: 16px; }
.subsection:last-child { margin-bottom: 0; }
.sub-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.paper-title-full {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}
.abstract-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.93rem;
  white-space: pre-wrap;
}
.abstract-text em,
.caption em,
.passage em,
.question-box em,
.answer-box em {
  color: #4c3f8f;
  font-style: normal;
  font-weight: 750;
}
.abstract-text code,
.caption code,
.passage code,
.question-box code,
.answer-box code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}
.figure {
  padding: 14px;
  border: 1px solid #e5dbc5;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}
.figure img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 5px;
}
.caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  text-align: left;
}
.caption.empty {
  color: #8d8f94;
  font-style: italic;
}
.question-box,
.answer-box,
.passage {
  margin: 0;
  border-radius: 8px;
  background: #fff;
}
.question-box {
  padding: 16px 18px;
  border-left: 5px solid #27614b;
  color: var(--ink);
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 800;
}
.answer-box {
  padding: 14px 16px;
  border-left: 5px solid #87384b;
  color: var(--ink);
  font-size: 0.96rem;
}
.passage {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-left: 3px solid #d9aab2;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
  white-space: pre-wrap;
}
.passage:last-child { margin-bottom: 0; }
.evidence-sentence {
  padding: 1px 4px;
  border-radius: 4px;
  background: #d9f0d9;
  color: #1f3b23;
  box-shadow: inset 0 -2px 0 rgba(74, 155, 88, 0.28);
}
.hl-note {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
footer {
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 900px) {
  .hero,
  .intro-top,
  .question-band,
  .promise-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 0;
    gap: 34px;
  }
  .overview-board {
    grid-template-columns: 1fr 1fr;
  }
  .board-card.wide {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 300px;
  }
  .meta,
  .filters {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .hero {
    gap: 28px;
    padding: 32px 0 38px;
  }
  .hero-title-row {
    display: block;
  }
  .hero-mark {
    width: 56px;
    height: 54px;
    border-radius: 10px;
    margin-bottom: 18px;
  }
  header h1 {
    font-size: 2.25rem;
    line-height: 1.04;
  }
  .sub {
    margin-top: 18px;
    font-size: 1rem;
  }
  .hero-actions {
    margin-top: 22px;
  }
  .end-resource-head {
    display: block;
  }
  .end-links {
    justify-content: flex-start;
    margin-top: 12px;
  }
  .overview-board,
  .compare-list {
    grid-template-columns: 1fr;
  }
  .board-card,
  .board-card.wide {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 0.56fr);
    min-height: 220px;
  }
  .board-question {
    gap: 8px;
    padding: 14px 12px;
  }
  .board-question q {
    font-size: 0.78rem;
  }
  .board-card.wide .board-question q {
    font-size: 0.78rem;
  }
  .intro,
  .question-band,
  .toolbar,
  .end-resources {
    padding: 20px;
  }
  .toolbar {
    display: block;
  }
  .filters { margin-top: 16px; }
  .card-summary { padding: 18px 52px 18px 18px; }
  .card-body { padding: 0 18px 20px; }
  .panel { padding: 16px; }
  .expand-hint { right: 16px; }
}

@media (max-width: 420px) {
  .board-card,
  .board-card.wide {
    grid-template-columns: 1fr;
  }
  .board-question,
  .board-card.wide .board-question {
    order: -1;
    border-top: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(47,128,122,0.18);
    border-left: 0;
  }
}

@media print {
  @page {
    margin: 0.6in;
    size: letter;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    background: #fff;
    color: #1f2024;
    font-size: 10pt;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  .topbar {
    position: static;
    border-bottom: 1px solid #ddd8cc;
    background: #fff;
    backdrop-filter: none;
  }

  .nav-wrap {
    min-height: 38pt;
  }

  .brand {
    font-size: 13pt;
  }

  .brand-mark {
    width: 26pt;
    height: 25pt;
  }

  header {
    background: #fff;
    color: #1f2024;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 24pt 0 16pt;
  }

  .hero-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12pt;
    max-width: none;
  }

  .hero-mark {
    width: 38pt;
    height: 36pt;
    border: 1px solid #ded8ea;
    border-radius: 7pt;
    box-shadow: none;
  }

  header h1 {
    max-width: none;
    color: #1f2024;
    font-size: 23pt;
    line-height: 1.15;
  }

  .sub {
    max-width: 6.6in;
    color: #4d525a;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .hero-actions,
  .overview-board,
  .filters,
  .expand-hint,
  footer {
    display: none;
  }

  main {
    padding: 0;
  }

  .intro,
  .end-resources,
  .question-band,
  .toolbar,
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 12pt;
    padding: 12pt;
    border: 1px solid #ddd8cc;
    border-radius: 6pt;
    background: #fff;
    box-shadow: none;
  }

  .intro-top,
  .end-resource-head,
  .question-band,
  .promise-grid,
  .compare-list {
    display: block;
  }

  .section-kicker,
  .example-num,
  .src,
  .sub-label {
    color: #2f807a;
  }

  .intro h2,
  .question-band h2,
  .toolbar h2,
  .summary-title {
    font-size: 15pt;
    line-height: 1.2;
  }

  .meta,
  .promise-grid article,
  .compare-list li,
  .card-summary {
    margin-top: 8pt;
  }

  .promise-grid article,
  .compare-list li,
  .panel {
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 10pt;
    border: 1px solid #ddd8cc;
    background: #fff;
    box-shadow: none;
  }

  .compare-list li:last-child {
    border-color: #9bcbbf;
    background: #edf7f4;
  }

  .compact-bibtex pre {
    white-space: pre-wrap;
  }

  .card-summary {
    padding: 0;
  }

  .summary-q,
  .question-box {
    color: #87384b;
  }

  .card-body {
    padding: 10pt 0 0;
  }

  .figure img {
    max-height: 260pt;
  }

  .passage {
    font-size: 8.5pt;
    line-height: 1.45;
  }
}
