:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #151515;
  --muted: #67615a;
  --line: #d8d0c5;
  --accent: #1f4fd8;
  --accent-2: #9b2f24;
  --green: #166b4f;
  --shadow: 0 18px 60px rgba(26, 20, 12, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid var(--ink);
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand {
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 20px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.lang-toggle {
  min-height: 34px;
  min-width: 48px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

main {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.hero {
  min-height: 820px;
  display: block;
  padding: 44px 0 76px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 1180px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(42px, 5.2vw, 74px);
  line-height: 0.94;
  letter-spacing: 0;
  max-width: 1160px;
  margin: 16px 0 24px;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  box-shadow: 6px 6px 0 var(--ink);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 107, 79, 0.14);
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero-eyebrow {
  margin-top: 20px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 2px solid var(--ink);
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
}

.button.primary {
  background: var(--ink);
  color: var(--bg);
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.button.small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.hero-panel {
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  padding: 28px;
}

.open-book {
  position: relative;
  margin-top: 56px;
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 0;
  perspective: 1400px;
  filter: drop-shadow(18px 18px 0 var(--ink));
}

.atlas-book {
  margin-top: 44px;
  max-width: min(1500px, calc(100vw - 48px));
  margin-left: auto;
  margin-right: auto;
}

.atlas-cover {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 28px;
  box-shadow: 14px 14px 0 var(--ink);
}

.atlas-cover::before {
  display: none;
}

.atlas-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), transparent 35%, rgba(21,21,21,0.035));
}

.atlas-cover h2 {
  margin: 0 0 22px;
  max-width: 1120px;
  font-size: clamp(30px, 4.8vw, 62px);
  line-height: 1;
  text-transform: uppercase;
}

.atlas-cover .map-shell {
  height: 520px;
}

.atlas-notes,
.country-evidence-strip {
  margin-top: 20px;
}

.country-evidence-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.country-evidence-item {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.country-evidence-item:hover,
.country-evidence-item:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.country-evidence-item strong {
  display: block;
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.country-evidence-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.country-evidence-item em,
.country-evidence-item small {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.35;
}

.country-evidence-item em {
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--ink);
  padding: 3px 6px;
  color: var(--ink);
  background: var(--paper);
}

.country-evidence-item small {
  color: var(--muted);
}

.atlas-note-main {
  display: grid;
  gap: 16px;
}

.open-book::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 4px;
  background: var(--ink);
  transform: translateX(-50%);
  z-index: 4;
}

.book-page {
  background: var(--surface);
  border: 2px solid var(--ink);
  min-height: 440px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.book-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(21, 21, 21, 0.06), transparent 18%, transparent 82%, rgba(21, 21, 21, 0.05));
}

.map-page {
  transform: rotateY(4deg);
  transform-origin: right center;
  border-right: 0;
}

.notes-page {
  transform: rotateY(-6deg);
  transform-origin: left center;
  border-left: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-label {
  display: inline-flex;
  border: 2px solid var(--ink);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-topline .panel-label {
  margin-bottom: 0;
}

.map-status {
  border: 2px solid var(--line);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  text-transform: uppercase;
}

.research-map-card h2 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
}

.book-page h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.02;
  text-transform: uppercase;
  max-width: 760px;
}

.map-shell {
  position: relative;
  width: 100%;
  height: 320px;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
  background: var(--bg);
}

.map-grid,
.research-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-grid {
  z-index: 0;
}

.research-map {
  z-index: 1;
}

.map-caption {
  margin-top: 0;
  border: 2px solid var(--ink);
  background: rgba(0, 0, 0, 0.02);
  padding: 9px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.map-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.book-note {
  margin-top: auto;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.authors-section {
  padding-top: 64px;
}

.authors-hint {
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 5px 5px 0 var(--ink);
}

.contribution-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.author-tile {
  min-height: 178px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.author-tile:hover,
.author-tile.active {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
}

.author-tile.active {
  background: #f1efe8;
}

.author-button {
  width: 100%;
  min-height: 174px;
  border: 0;
  background: transparent;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.author-name {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.author-role {
  display: block;
  margin-top: 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.author-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.author-keywords span {
  border: 1px solid var(--line);
  padding: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.contribution-detail {
  margin-top: 18px;
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 20px;
  box-shadow: 8px 8px 0 var(--ink);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.contribution-detail h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.contribution-detail .contrib-taxonomy {
  color: var(--accent);
  font-weight: 900;
  margin-top: 10px;
  line-height: 1.25;
}

.contribution-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.author-mobile-detail {
  display: none;
}

.method-grid .codebook-card {
  min-height: 140px;
}

.compact-notice {
  margin-top: 18px;
}

.map-metrics div {
  border: 2px solid var(--line);
  padding: 10px;
}

.map-metrics strong {
  display: block;
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.map-metrics span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metric {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.metric:last-child {
  border-bottom: 0;
}

.metric-value {
  display: block;
  font-size: 44px;
  font-weight: 850;
  line-height: 1;
  color: var(--accent);
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 76px 0;
  border-bottom: 1px solid var(--line);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
}

.section h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  margin: 10px 0 0;
  letter-spacing: 0;
}

.section-copy,
.section p {
  color: var(--muted);
}

.section-copy p {
  margin-top: 0;
  font-size: 17px;
}

.section-heading {
  margin-bottom: 28px;
}

.row-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.line-grid,
.country-grid,
.download-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.line-card,
.country-card,
.doc-card,
.codebook-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.line-card:hover,
.country-card:hover,
.doc-card:hover,
.codebook-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.line-card strong,
.country-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.line-card p,
.country-card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.country-strength-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-strength-card {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.country-strength-card .tag-row {
  margin-top: 0;
}

.country-capacity-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  border: 2px solid var(--line);
  padding: 4px 7px;
  font-size: 12px;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 220px 280px minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

label span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.result-count {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 14px;
}

.document-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card h3 {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
}

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

.doc-card .doc-abstract,
.doc-card .doc-commentary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card .doc-abstract {
  -webkit-line-clamp: 3;
}

.doc-card .doc-commentary {
  -webkit-line-clamp: 2;
}

.actor-line {
  color: var(--accent-2) !important;
  font-weight: 750;
}

.meta-line {
  color: var(--accent);
  font-weight: 750;
  font-size: 12px;
  text-transform: uppercase;
}

.doc-link {
  margin-top: auto;
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
  font-size: 14px;
}

.pagination-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-weight: 750;
}

.pagination-row .button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.codebook-list {
  display: grid;
  gap: 12px;
}

.codebook-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.codebook-card p {
  margin: 0;
  color: var(--muted);
}

.notice {
  margin-top: 20px;
  border-left: 4px solid var(--accent-2);
  background: rgba(155, 47, 36, 0.07);
  padding: 16px;
  color: var(--muted);
}

.download-grid a {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 18px;
  text-decoration: none;
  font-weight: 750;
}

.download-grid a:hover {
  box-shadow: 7px 7px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .row-heading,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    overflow-x: hidden;
  }

  .nav {
    padding: 12px 14px 10px;
    align-items: center;
    gap: 12px;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
  }

  .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 4px 8px;
    scrollbar-width: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    font-size: 12px;
  }

  .lang-toggle {
    flex: 0 0 auto;
    min-width: 42px;
    min-height: 32px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  main {
    padding: 0 14px 56px;
  }

  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 42px 0 56px;
  }

  .hero h1 {
    font-size: 38px;
    line-height: 0.98;
  }

  .lead {
    font-size: 16px;
  }

  .open-book {
    grid-template-columns: 1fr;
    filter: none;
  }

  .atlas-cover {
    transform: none;
    box-shadow: 8px 8px 0 var(--ink);
  }

  .atlas-cover::before {
    display: none;
  }

  .atlas-cover .map-shell {
    height: 430px;
  }

  .atlas-notes {
    grid-template-columns: 1fr;
  }

  .country-evidence-strip,
  .method-grid,
  .contribution-strip {
    grid-template-columns: 1fr;
  }

  .contribution-detail {
    display: none;
  }

  .author-tile {
    min-height: 0;
  }

  .author-button {
    min-height: 0;
  }

  .author-tile.active .author-mobile-detail {
    display: grid;
    gap: 14px;
    border-top: 2px solid var(--ink);
    padding: 16px;
    background: var(--surface);
  }

  .author-mobile-detail h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
  }

  .author-mobile-detail .contrib-taxonomy {
    color: var(--accent);
    font-weight: 900;
    margin-top: 8px;
    line-height: 1.25;
  }

  .author-mobile-detail p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
  }

  .open-book::before {
    display: none;
  }

  .map-page,
  .notes-page {
    transform: none;
    border: 2px solid var(--ink);
  }

  .notes-page {
    border-top: 0;
  }

  .line-grid,
  .country-grid,
  .document-list,
  .download-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .pagination-row {
    justify-content: flex-start;
  }
}
