:root{
  --bg:#ffffff;
  --surface:#f4f7fb;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#2f7680;
  --primary-600:#2a6770;
  --ring:0 0 0 6px rgba(47,118,128,.08);
  --radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
.container{max-width:1100px;margin:0 auto;padding:24px}

/* ================= STICKY NAVBAR ================= */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}
nav.site-nav{
  position: static; /* let wrapper handle sticky */
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.site-nav .nav-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:10px 0;
}
.site-nav .nav-left{
  display:flex;align-items:center;gap:14px;flex-wrap:nowrap;overflow-x:auto;
}
.site-nav a{color:#0f172a;text-decoration:none;white-space:nowrap}
.site-nav a:hover{text-decoration:underline}
.site-nav .brand{font-weight:700}
.site-nav .btn-quiz{
  display:inline-block;padding:10px 14px;border-radius:14px;
  background:#2f6f78;color:#ecfeff;font-weight:700;
  box-shadow:0 8px 20px rgba(47,111,120,.25);
}
.site-nav .btn-quiz:hover{filter:brightness(1.05);text-decoration:none}

/* ================= HERO ================= */
.hero{padding:56px 0 14px}
.kicker{display:inline-block;background:#eaf6f8;color:#245d64;padding:6px 10px;border-radius:999px;font-size:12px;border:1px solid #d8eaed}
h1{font-size:44px;line-height:1.1;margin:10px 0 6px}
p.lead{font-size:18px;color:var(--muted);max-width:760px}

/* Hero split layout */
.hero.hero-split{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap:40px;
  align-items:center;
}
.hero-split .hero-text{display:flex;flex-direction:column;gap:16px}
.hero-split .hero-img{
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 12px 28px rgba(0,0,0,.12);
  background:linear-gradient(180deg,#f6fafb,#eef4f7);
}
.hero-split .hero-img img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
@media (max-width: 900px){
  .hero.hero-split{grid-template-columns:1fr;text-align:center}
  .hero-split .hero-img{margin-top:16px}
}

/* ================= BUTTONS ================= */
.btn-row{display:flex;gap:12px;margin-top:18px}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 14px;border-radius:12px;border:1px solid #e2e8f0;
  text-decoration:none;color:var(--text);background:#fff;
  transition:box-shadow .2s, transform .15s;
}
.btn:hover{box-shadow:var(--ring);transform:translateY(-1px)}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.secondary{background:#f1fbfc;border-color:#bde2e7;color:#245d64}

/* ================= LAYOUT / CARDS ================= */
.section{padding:40px 0}
.grid{display:grid;gap:18px}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
@media (max-width:900px){.grid.cols-4{grid-template-columns:repeat(2,1fr)}}
@media (max-width:700px){
  .grid.cols-3{grid-template-columns:repeat(2,1fr)}
  .grid.cols-2{grid-template-columns:1fr}
}
.card{
  background:#fff;border:1px solid #e6eef2;border-radius:var(--radius);
  padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.04)
}
.card h3{margin:0 0 6px}
.meta{color:var(--muted);font-size:14px}

/* ================= KEY PEOPLE FLIP ================= */
.flip-card{perspective:1000px}
.flip-card-inner{
  position:relative;width:100%;height:260px;
  transition:transform .6s;transform-style:preserve-3d
}
.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner{transform:rotateY(180deg)}
.flip-card .face{
  position:absolute;inset:0;background:#fff;border:1px solid #e6eef2;
  border-radius:var(--radius);padding:14px;
  backface-visibility:hidden;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px
}
.flip-card .back{transform:rotateY(180deg)}
.badge{display:inline-block;border-radius:999px;background:#eaf6f8;
  border:1px solid #d7eaed;padding:4px 8px;color:#275f66;font-size:12px}


/* ================= DRAG/DROP ================= */
.dd-row{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}
.drag{padding:10px 12px;border:1px dashed #9bd0d6;border-radius:12px;cursor:grab;background:#f8fdfe}
.drop{min-height:48px;min-width:220px;padding:8px 10px;border:2px dashed #d2e8ec;border-radius:12px;background:#fcffff}
.drop.correct{border-color:#7cc6cd;background:#f0fbfc}
.drop.wrong{border-color:#ef4444;background:#fff5f5}

/* ================= QUIZ ================= */
.quiz{display:grid;gap:18px}
.q{background:#fff;border:1px solid #e6eef2;border-radius:16px;padding:16px}
.q h4{margin:0 0 10px}
.q .choices{display:grid;gap:8px}
.choice{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid #e6eef2;border-radius:12px;cursor:pointer}
.choice input{accent-color:var(--primary)}

/* ================= FOOTER ================= */
.footer{margin-top:40px;border-top:1px solid #e6eef2;background:linear-gradient(180deg,#ffffff,#f6fafb)}
.footer .inner{display:grid;gap:10px;padding:22px 20px;color:var(--muted);font-size:14px}
.footer .donate{display:flex;align-items:center;gap:8px}
.footer .donate .heart{font-size:18px}

/* ================= REVEAL ================= */
.reveal{opacity:0;transform:translateY(16px);transition:opacity .6s, transform .6s}
.reveal.in{opacity:1;transform:none}

/* ================= UTILITIES ================= */
.figure{border:1px solid #e6eef2;background:#fff;border-radius:14px;padding:8px}
.small{font-size:13px;color:var(--muted)}
kbd{background:#f1f5f9;border-radius:6px;border:1px solid #e2e8f0;padding:2px 6px;font-size:12px}

/* ================= TABLES ================= */
table{border-collapse:separate;border-spacing:0;width:100%;background:#fff;border:1px solid #e6eef2;border-radius:14px;overflow:hidden}
th,td{padding:10px 12px;border-bottom:1px solid #edf2f7;text-align:left}
th{background:#f8fcfd;color:#275f66}
tr:last-child td{border-bottom:none}

/* ================= KEY PEOPLE IMAGE CARDS ================= */
.flip-card-inner{height:360px}                 /* taller to fit images */
@media (max-width:900px){.flip-card-inner{height:340px}}
@media (max-width:600px){.flip-card-inner{height:320px}}

.flip-card .face{gap:12px;padding:16px;text-align:center}
.flip-card .face .avatar{
  width:128px;height:128px;object-fit:cover;
  border-radius:14px;border:1px solid #e6eef2;
  box-shadow:0 10px 22px rgba(15,23,42 ,.08);
}

/* ================= TIMELINE ================= */

/* Timeline rows with much larger thumbnails */
.timeline {
  display: grid;
  gap: 32px; /* bigger space between events */
}

.timeline .ev {
  display: grid;
  grid-template-columns: 360px 1fr; /* much wider image column */
  gap: 24px;
  align-items: center;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid #e6eef2;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.timeline .ev-img {
  width: 360px;
  height: 240px;  /* 3x bigger than before */
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e6eef2;
}

.timeline .ev-body {
  line-height: 1.6;
  font-size: 18px;    /* bump font size */
}

.timeline .ev-body strong {
  font-size: 20px;   /* make year pop */
  color: #2f7680;
}

@media (max-width: 900px) {
  .timeline .ev {
    grid-template-columns: 1fr;
  }
  .timeline .ev-img {
    width: 100%;
    height: 280px;  /* big but still fits mobile */
  }
}
/* ===== Vertical timeline (super tight stack + clean pointers) ===== */
.v-timeline{
  position:relative;
  margin:20px 0;
  padding:10px 0;
}
.v-timeline::before{
  content:"";
  position:absolute; top:0; bottom:0; left:50%;
  width:3px; transform:translateX(-50%);
  background:#dfe8ee;
  border-radius:2px;
}

/* each row: VERY tight vertical spacing */
.vt-item{
  position:relative;
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
  margin:0 0 6px 0;            /* was 12px → tighter */
}
.vt-item:last-child{ margin-bottom:0; }

/* dot centered on the line */
.vt-dot{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%);
  width:14px; height:14px; border-radius:50%;
  background:#2f7680; border:3px solid #fff;
  box-shadow:0 0 0 4px rgba(47,118,128,.15);
  z-index:2;
}

/* cards */
.vt-card{
  position:relative;
  width:min(460px, 90%);
  background:#fff;
  border:1px solid #e6eef2;
  border-radius:14px;
  padding:12px 14px;           /* slightly tighter padding */
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.vt-card img{
  width:100%; height:220px; object-fit:cover;
  border-radius:10px; border:1px solid #e6eef2; display:block;
}
.vt-card header{ margin:8px 0 4px; font-weight:700; }
.vt-year{
  display:inline-block;
  color:#2f7680; background:#eaf6f8; border:1px solid #d7eaed;
  padding:3px 8px; border-radius:999px; margin-right:6px; font-size:13px;
}
.vt-card p{ margin:0 }

/* placement: keep nice gap from line, but stack tightly */
.vt-item:nth-child(odd)  .vt-card{ grid-column:1 / 2; justify-self:end;  margin-right:36px; }
.vt-item:nth-child(even) .vt-card{ grid-column:2 / 3; justify-self:start; margin-left:36px;  }

/* --- pointer with short connector line (aligned to the dot) --- */
/* LEFT (odd) */
.vt-item:nth-child(odd) .vt-card::before{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  right:-32px; width:22px; height:2px; background:#e6eef2; border-radius:2px;
}
.vt-item:nth-child(odd) .vt-card::after{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  right:-10px; border-width:7px 0 7px 10px; border-style:solid;
  border-color:transparent transparent transparent #fff;
  box-shadow:-1px 0 0 #e6eef2;
}
/* RIGHT (even) */
.vt-item:nth-child(even) .vt-card::before{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  left:-32px; width:22px; height:2px; background:#e6eef2; border-radius:2px;
}
.vt-item:nth-child(even) .vt-card::after{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  left:-10px; border-width:7px 10px 7px 0; border-style:solid;
  border-color:transparent #fff transparent transparent;
  box-shadow:1px 0 0 #e6eef2;
}

/* responsive: stack into one column, still tight */
@media (max-width: 900px){
  .v-timeline::before{ left:22px; transform:none; }
  .vt-item{ grid-template-columns:22px 1fr; margin-bottom:6px; }
  .vt-item .vt-card{ grid-column:2 / 3; justify-self:start; margin:0 0 0 14px; width:100%; }
  .vt-dot{ left:22px; }
  .vt-item .vt-card::before{ left:-22px; right:auto; width:12px; }
  .vt-item .vt-card::after{
    left:-10px; right:auto; border-width:7px 10px 7px 0;
    border-color:transparent #fff transparent transparent;
    box-shadow:1px 0 0 #e6eef2;
  }
}

/* ============ QUIZ (Aztecs page) ============ */
.quiz .choices{display:grid;gap:8px;margin-top:8px}
.quiz .choices button{
  text-align:left; padding:10px 12px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; cursor:pointer;
}
.quiz .choices button.selected{outline:3px solid rgba(47,118,128,.18)}
.quiz .feedback{margin:6px 0 0; font-size:14px}
.quiz .feedback.ok{color:#166534}
.quiz .feedback.bad{color:#b91c1c}

/* ============ GLOSSARY ============ */
.glossary{margin-top:12px}
.glossary summary{cursor:pointer}
.glossary dl{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:10px 0 0}
.glossary dt{font-weight:700}
.glossary dd{margin:0}
.gloss{border-bottom:2px dotted #c7e3e6;}

/* ============ GALLERY ============ */
.gallery-3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.gallery-3 figure{margin:0}
.gallery-3 img{width:100%;height:160px;object-fit:cover;border-radius:10px;border:1px solid #e6eef2;display:block}
@media (max-width:800px){.gallery-3{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.gallery-3{grid-template-columns:1fr}}

/* ===== Treaty page visuals ===== */
.mapbox{
  position:relative;
  border:1px solid #e6eef2;
  border-radius:14px;
  overflow:hidden;
  background:#f8fcfd;
}
.mapbox .world{width:100%;display:block}
.mapbox .line{
  position:absolute; top:0; bottom:0; width:3px;
  background:#2f7680;
  box-shadow:0 0 0 4px rgba(47,118,128,.15);
}

.controls{margin-top:12px}
.controls input[type=range]{width:100%; max-width:380px}
.feedback.ok{color:#166534}
.feedback.bad{color:#b91c1c}

/* Simple gallery (reuses your gallery-3 rules if already present) */
.gallery-3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.gallery-3 figure{margin:0}
.gallery-3 img{width:100%;height:160px;object-fit:cover;border-radius:10px;border:1px solid #e6eef2;display:block}
@media (max-width:800px){.gallery-3{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.gallery-3{grid-template-columns:1fr}}
