@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=EB+Garamond:ital,wght@1,400&family=Sora:wght@400;600;700&display=swap');

:root {
  --bg: #ede8dd;
  --bg-deep: #e4ddcf;
  --ink: #1c1510;
  --ink-muted: #7a6f62;
  --accent: #8f2418;
  --quote-highlight: #8f2418;
  --map-frame: #3f3a35;
  --card: #fff8ec;
  --line: #dccdb8;
  --shadow: 0 20px 45px rgba(32, 24, 17, 0.13);
  --peek-height: 10dvh;
  --quote-total-height: 280dvh;
}

.gate-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.gate-card {
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  box-shadow: var(--shadow);
}

.gate-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin: 0 0 0.8rem;
}

.gate-card h1 {
  margin: 0 0 1rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.gate-card p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.gate-note {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Sora', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120rem 70rem at 8% -10%, rgba(185, 52, 38, 0.13), transparent 50%),
    radial-gradient(90rem 70rem at 90% 0%, rgba(24, 90, 133, 0.11), transparent 44%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.site-shell {
  width: min(1360px, 94vw);
  margin: 0 auto;
  padding-bottom: 5rem;
}

main {
  position: relative;
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.quote-hero {
  position: relative;
  min-height: var(--quote-total-height);
  margin-bottom: calc((200dvh - var(--peek-height)) - var(--quote-total-height));
  background: #ede8dd;
}

.quote-hero-sticky {
  position: sticky;
  top: 0;
  height: calc(100dvh - var(--peek-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: end;
  padding-top: clamp(0.4rem, 1.2vh, 0.9rem);
  padding-bottom: clamp(0.4rem, 1.2vh, 0.9rem);
  column-gap: clamp(1rem, 2.2vw, 2.2rem);
  z-index: 5;
}

.quote-hero-sticky.is-handoff-active {
  position: fixed;
  top: calc(var(--quote-strip-top, 80dvh) - 80dvh);
  left: 50%;
  transform: translateX(-50%);
  width: min(1360px, 94vw);
  height: calc(100dvh - var(--peek-height));
  align-content: end;
  padding-top: clamp(0.4rem, 1.2vh, 0.9rem);
  padding-bottom: clamp(0.4rem, 1.2vh, 0.9rem);
  z-index: 35;
  pointer-events: none;
}

.quote-main {
  margin: 0.2rem 0 0;
  grid-column: 1;
  width: min(50vw, 42rem);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(1.25rem, calc(1.15vw + 2.4vh), 5.35rem);
  line-height: 1.43;
  letter-spacing: -0.017em;
  padding-bottom: clamp(0.5rem, 1.5vh, 1rem);
  text-wrap: pretty;
  color: #1c1510;
}

.quote-line {
  display: inline;
}

.quote-line-final {
  display: inline-block;
  white-space: nowrap;
}

.quote-line-final.is-scaling {
  font-size: calc(var(--quote-final-scale, 1) * 100%);
  line-height: 1.43;
  transition: font-size 120ms linear;
}

.quote-domain {
  margin-left: 0.14em;
}

.quote-word {
  margin-right: 0.16em;
  color: var(--ink);
  text-shadow: none;
  transition:
    color 220ms linear,
    text-shadow 220ms linear;
}

.quote-word.is-highlighted {
  color: var(--quote-highlight);
  text-shadow: 0 0 0.1px rgba(31, 79, 137, 0.85);
}

.quote-attribution {
  margin: 0;
  grid-column: 1;
  margin-bottom: clamp(0.25rem, 0.9vh, 0.5rem);
  color: #7a6f62;
  font-size: clamp(0.72rem, 1.2vw, 0.98rem);
  letter-spacing: 0.01em;
  font-weight: 400;
  font-family: 'EB Garamond', serif;
  font-style: italic;
}

.story-section {
  margin-top: 0;
}

.status-banner {
  margin: 2rem 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.status-banner-error {
  border-color: #bf665d;
  color: #671b14;
}

.story-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start;
  gap: 1.35rem;
}

.story-map-panel {
  position: sticky;
  top: var(--peek-height);
  height: calc(100dvh - var(--peek-height));
  transform: translateY(var(--map-offset, 0dvh));
}

.story-map-canvas {
  width: 100%;
  height: 100%;
  border: 2px solid var(--map-frame);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #dce5e8;
  pointer-events: none;
}

.story-steps {
  padding: 0 0 10vh;
  transition: opacity 220ms ease;
}

.story-section:not(.is-story-active) .story-steps {
  opacity: 0;
  pointer-events: none;
}

.story-step {
  min-height: 36vh;
  display: flex;
  align-items: center;
  scroll-margin-top: calc(var(--peek-height) + 1rem);
}

.story-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem 1.25rem;
  box-shadow: 0 14px 28px rgba(32, 24, 17, 0.08);
  transform: translateY(14px);
  opacity: 0.48;
  transition:
    transform 320ms ease,
    opacity 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease;
}

.story-step.is-active .story-card {
  transform: translateY(0);
  opacity: 1;
  border-color: #c98f4d;
  box-shadow: 0 20px 40px rgba(32, 24, 17, 0.17);
}

.story-card-kicker {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent);
}

.story-card h3 {
  margin: 0.46rem 0 0.15rem;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.25rem, 1.3vw + 0.9rem, 1.9rem);
}

.story-card-meta {
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin: 0;
}

.story-card p {
  line-height: 1.58;
}

.story-card-image {
  margin: 0.7rem 0 0.6rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #d7c8b2;
  background: #f4ebdd;
}

.story-card-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.story-card a {
  color: #9b261a;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.story-card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

.story-card-docs {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #d7c8b2;
  display: grid;
  gap: 0.35rem;
}

.story-card-docs-label {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.story-card-docs-meta {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.hate-trend-section {
  margin-top: 4rem;
  position: relative;
  min-height: 320dvh;
}

.hate-trend-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.hate-trend-track {
  position: relative;
}

.hate-trend-sticky {
  position: sticky;
  top: var(--peek-height);
  height: calc(100dvh - var(--peek-height));
  z-index: 8;
  background: #f7efdf;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0.95rem 1.1rem 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hate-trend-sticky h2 {
  margin: 0.4rem 0 0.5rem;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.85rem, 2vw + 1rem, 3.15rem);
  line-height: 1.04;
}

.hate-trend-intro {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 70ch;
}

.hate-chart-figure {
  margin: 0.62rem 0 0;
}

.hate-chart-svg {
  width: auto;
  max-width: 100%;
  height: min(46dvh, 430px);
  display: block;
  margin: 0 auto;
}

.hate-axis {
  stroke: #8d7d6c;
  stroke-width: 2;
  stroke-linecap: round;
}

.hate-grid-line {
  stroke: rgba(108, 93, 77, 0.2);
  stroke-width: 1;
}

.hate-grid-label {
  fill: #7a6756;
  font-size: 14px;
  font-weight: 600;
}

.hate-line-base {
  fill: none;
  stroke: rgba(96, 79, 62, 0.28);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hate-line-active {
  fill: none;
  stroke: #b93426;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 340ms ease;
}

.hate-point {
  fill: #d7c3ab;
  stroke: #b9a48c;
  stroke-width: 2;
  transition: all 260ms ease;
}

.hate-point.is-active {
  fill: #b93426;
  stroke: #f7efdf;
  stroke-width: 3;
}

.hate-year-label {
  fill: #5b4a3a;
  font-size: 14px;
  font-weight: 700;
}

.hate-chart-stat {
  margin-top: 0.25rem;
}

.hate-chart-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: #8a6f58;
  font-weight: 700;
}

.hate-chart-value {
  margin: 0.2rem 0 0.18rem;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.65rem, 1.5vw + 1rem, 2.45rem);
  line-height: 0.9;
  color: #9f2c1f;
}

.hate-chart-stat p {
  margin: 0;
  color: #5f5042;
  line-height: 1.5;
}

.hate-chart-source {
  margin: 0.5rem 0 0;
  color: #7e6d5c;
  font-size: 0.76rem;
}

.hate-chart-source a {
  color: #8f2418;
  text-underline-offset: 3px;
}

.hate-scroll-steps {
  height: calc(320dvh - 100dvh);
}

.petition-section {
  margin-top: 1.8rem;
  padding: 2rem 1.2rem;
  border: 1px solid #d9b98f;
  border-radius: 1.1rem;
  background:
    radial-gradient(65rem 24rem at 100% 0%, rgba(185, 52, 38, 0.13), transparent 65%),
    #fff5e5;
  box-shadow: 0 16px 34px rgba(51, 33, 20, 0.1);
}

.petition-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a63a2d;
}

.petition-section h2 {
  margin: 0.45rem 0 0.5rem;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2.6rem);
}

.petition-section p {
  margin: 0;
  color: #5f4f3f;
  line-height: 1.65;
  max-width: 70ch;
}

.petition-link {
  display: inline-flex;
  margin-top: 1rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.12rem;
  border-radius: 999px;
  border: 1px solid #ad3f30;
  background: #b93426;
  color: #fffaf2;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px rgba(139, 39, 28, 0.24);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background-color 200ms ease;
}

.petition-link:hover {
  transform: translateY(-1px);
  background-color: #a3291c;
  box-shadow: 0 14px 26px rgba(139, 39, 28, 0.3);
}

.database-nav-link {
  position: fixed;
  top: 0.9rem;
  right: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  border: 1px solid #ad3f30;
  background: rgba(255, 245, 230, 0.95);
  color: #8f2418;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(42, 26, 15, 0.16);
}

.database-page {
  min-height: 100dvh;
  padding: 2rem 0 3rem;
}

.database-shell {
  width: min(1400px, 96vw);
  margin: 0 auto;
}

.database-back-link {
  color: #8f2418;
  font-weight: 700;
  text-underline-offset: 3px;
}

.database-kicker {
  margin: 0.8rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.database-shell h1 {
  margin: 0.3rem 0 0.45rem;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.65rem, 1.8vw + 1rem, 2.75rem);
}

.database-summary {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.62;
  max-width: 95ch;
}

.database-search-label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-weight: 700;
  font-size: 0.84rem;
}

.database-search-input {
  width: min(560px, 100%);
  border: 1px solid #cfbca4;
  border-radius: 0.66rem;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fffaf1;
  color: var(--ink);
}

.database-table-wrap {
  margin-top: 0.85rem;
  border: 1px solid #d8c9b4;
  border-radius: 0.95rem;
  background: #fff9ef;
  overflow: auto;
  box-shadow: 0 12px 24px rgba(35, 23, 12, 0.08);
}

.database-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.database-table th,
.database-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.68rem 0.72rem;
  border-bottom: 1px solid #e6d9c6;
  font-size: 0.85rem;
  line-height: 1.46;
}

.database-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7efdf;
  color: #4f4134;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.database-table tr:last-child td {
  border-bottom: 0;
}

.database-table a {
  color: #8f2418;
  text-underline-offset: 3px;
}

.database-expand-hint {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.database-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.database-row:hover {
  background: rgba(250, 241, 225, 0.6);
}

.database-row:focus-visible {
  outline: 2px solid #b34f3d;
  outline-offset: -2px;
}

.database-row.is-expanded {
  background: rgba(250, 241, 225, 0.85);
}

.database-detail-row {
  display: none;
  background: #fff5e6;
}

.database-detail-row.is-expanded {
  display: table-row;
}

.database-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0.4rem 0.9rem;
}

.database-detail-image {
  margin: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e2d3be;
  background: #f4ecdf;
}

.database-detail-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.database-detail-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.database-detail-notes {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.database-detail-fields {
  margin: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.database-detail-fields dt {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: #6b5d4c;
}

.database-detail-fields dd {
  margin: 0.2rem 0 0;
}

.database-detail-source {
  display: block;
  color: var(--ink-muted);
  font-size: 0.76rem;
  margin-top: 0.2rem;
}

.database-detail-archive {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8f2418;
}

@media (min-width: 900px) {
  .database-detail-card {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .site-shell {
    width: min(1320px, 96vw);
  }

  .quote-main {
    width: min(72vw, 32rem);
    font-size: clamp(1.1rem, calc(1vw + 2vh), 2.8rem);
    line-height: 1.47;
  }

  .quote-hero-sticky.is-handoff-active {
    width: min(1320px, 96vw);
  }

  .quote-attribution {
    grid-column: 1;
    font-size: clamp(0.62rem, 1.7vw, 0.8rem);
  }

  .story-shell {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hate-trend-sticky {
    padding: 0.8rem 0.75rem 0.8rem;
    top: var(--peek-height);
    height: calc(100dvh - var(--peek-height));
  }

  .hate-trend-section {
    min-height: 280dvh;
  }

  .hate-scroll-steps {
    height: calc(280dvh - 100dvh);
  }

  .story-step {
    min-height: 34vh;
  }

  .story-card {
    padding: 1rem;
  }

  .petition-section {
    padding: 1.35rem 1rem;
  }

  .database-nav-link {
    top: 0.65rem;
    right: 0.65rem;
    padding: 0.44rem 0.7rem;
    font-size: 0.8rem;
  }

  .database-page {
    padding-top: 1.2rem;
  }
}

.case-overview,
.key-parties,
.sources,
.related {
  margin-top: 2rem;
}

.case-overview h2,
.key-parties h2,
.sources h2,
.related h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.key-parties ul,
.sources ul,
.related ul {
  margin: 0;
  padding-left: 1.2rem;
}

.source-archive {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}
