:root {
  --paper: #f6efe2;
  --ink: #211a14;
  --muted: #6b5d4c;
  --red: #b3182c;
  --red-dark: #7c0f1f;
  --brass: #9c7a3c;
  --brass-text: #6b5122;
  --line: #ddccae;
  --white: #fffaf1;
  --serif: "Iowan Old Style", "Georgia", "Source Serif Pro", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.58;
}

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

button {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 12px;
  padding: 9px 12px;
  background: var(--red);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.topbar a {
  text-decoration: none;
}

.lang-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  text-transform: uppercase;
}

.lang-switch .current {
  color: var(--muted);
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 28px);
}

.hero {
  padding: 46px 0 20px;
}

.kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-text);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.deck {
  max-width: 660px;
  margin: 0 0 8px;
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--ink);
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.2;
}

.num {
  display: inline-block;
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--brass-text);
  vertical-align: middle;
}

p {
  margin: 0 0 18px;
}

.dim {
  color: var(--muted);
}

.limits {
  padding: 16px 20px;
  border-left: 4px solid var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, var(--white));
}

.limits p {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

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

/* --- timeline panel --- */

.panel {
  margin: 30px 0;
  padding: clamp(18px, 4vw, 30px);
  background: var(--white);
  border: 1px solid var(--line);
}

.tent-stage {
  position: relative;
  height: 200px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.tent-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--ink);
  opacity: 0.35;
}

.tent-shape {
  width: 200px;
  height: 160px;
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  clip-path: polygon(50% 0%, 70% 25%, 78% 100%, 60% 100%, 50% 90%, 40% 100%, 22% 100%, 30% 25%);
  transition: clip-path 520ms cubic-bezier(.4, 0, .2, 1), height 520ms ease;
}

.tent-stage.is-down .tent-shape {
  clip-path: polygon(50% 82%, 70% 86%, 78% 100%, 60% 100%, 50% 96%, 40% 100%, 22% 100%, 30% 86%);
}

.tent-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 300ms ease;
}

.tent-stage.is-raided .tent-badge {
  opacity: 1;
}

.tent-caption {
  min-height: 3.6em;
}

.tent-caption strong {
  display: block;
  margin-bottom: 4px;
  font-size: 19px;
}

.tent-caption span {
  font-size: 15px;
  color: var(--muted);
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.year-btn {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
}

.year-btn:hover,
.year-btn:focus-visible {
  border-color: var(--red);
}

.year-btn.is-active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.step-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.step-buttons button {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
}

.step-buttons button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* --- capacity comparison --- */

.capacity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 4vw, 40px);
}

.capacity-col h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.capacity-count {
  display: block;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
}

.dot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 6px);
  gap: 2px;
  align-content: start;
  height: 168px;
  overflow: hidden;
}

.dot-grid span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-grid.dots-tent span {
  background: var(--red);
}

.dot-grid.dots-kabukiza span {
  background: var(--brass);
}

.capacity-note {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* --- stat pairs --- */

.stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 4vw, 32px);
  margin: 24px 0;
}

.stat-box {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brass);
}

.stat-box.stat-box--tent {
  border-top-color: var(--red);
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1;
}

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

.source-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
}

.source-list a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 50px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

footer a {
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .capacity-grid,
  .stat-pair {
    grid-template-columns: 1fr;
  }

  .dot-grid {
    height: 120px;
  }

  .step-buttons {
    margin-left: 0;
    width: 100%;
  }

  .step-buttons button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
