/* Lands of Freedom — static site
   Inspired by ArcGIS StoryMaps aesthetic, custom implementation. */

:root {
  --bg: #1a1f2e;
  --bg-elev: #232938;
  --bg-card: #2a3142;
  --text: #f0ebe1;
  --text-muted: #b8b2a3;
  --text-dim: #8a8676;
  --accent: #cb6131;
  --accent-soft: rgba(203, 97, 49, 0.18);
  --rule: rgba(240, 235, 225, 0.12);
  --serif-display: "Cormorant Garamond", "Garamond", "Georgia", serif;
  --serif-body: "Lora", "Georgia", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --max-text: 680px;
  --max-wide: 1120px;
  --max-full: 1400px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #e07a48; }

/* ====================== TOP NAV ====================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 31, 46, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  font-family: var(--sans);
  font-size: 14px;
}
.top-nav .overview-link { color: var(--text); font-weight: 500; }
.top-nav .overview-link:hover { color: var(--accent); }
.top-nav .overview-link .arrow { margin-right: 6px; }
.top-nav .brand { color: var(--text-muted); font-family: var(--serif-display); font-size: 17px; font-weight: 500; letter-spacing: 0.5px; }
.top-nav .nav-pager { display: flex; align-items: center; gap: 14px; color: var(--text-muted); }
.top-nav .nav-pager a { color: var(--text); }
.top-nav .nav-pager .pager-pos { font-variant-numeric: tabular-nums; min-width: 36px; text-align: center; }
.top-nav .nav-pager .disabled { opacity: 0.3; pointer-events: none; }

/* ====================== HERO (CHAPTER) ====================== */
.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  place-items: center;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  background-color: #0a0e18;
  color: white;
  overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.45) 0%, rgba(10, 14, 24, 0.55) 50%, rgba(26, 31, 46, 0.92) 100%);
}
.hero-content {
  position: relative;
  max-width: 900px;
  padding: 60px 28px 80px;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
}
.hero-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  color: var(--text);
}
.hero-sub {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 18px;
  line-height: 1.5;
}
.hero-byline {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 18px;
}

/* ====================== SECTION NAV ====================== */
.sec-nav {
  position: sticky;
  top: 55px;
  z-index: 40;
  background: rgba(35, 41, 56, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: thin;
}
.sec-nav-inner {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  max-width: var(--max-full);
  margin: 0 auto;
  white-space: nowrap;
}
.sec-pill {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 16px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.sec-pill:hover { color: var(--text); }
.sec-pill.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ====================== CHAPTER BODY ====================== */
.chapter-body {
  max-width: var(--max-text);
  margin: 0 auto;
  padding: 60px 28px 80px;
}
.chapter-body p {
  margin: 0 0 22px;
}
.chapter-body h2 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 38px);
  margin: 64px 0 8px;
  letter-spacing: -0.3px;
  line-height: 1.15;
  color: var(--text);
}
.chapter-body h3 {
  font-family: var(--serif-body);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 32px;
}
.chapter-body h4 {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--accent);
  margin: 48px 0 16px;
  font-weight: 600;
}
.chapter-body blockquote {
  margin: 32px 0;
  padding: 8px 0 8px 26px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 20px;
  line-height: 1.6;
  color: var(--text);
}
.chapter-body blockquote p { margin: 0 0 12px; }
.chapter-body blockquote p:last-child { margin-bottom: 0; }

/* ====================== IMAGES ====================== */
.image {
  margin: 40px 0;
  display: block;
}
.image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}
.image.contained { /* stays within text column */ }
.image.wide {
  /* extends slightly wider than text column */
  margin-left: calc((var(--max-text) - min(96vw, 980px)) / 2);
  margin-right: calc((var(--max-text) - min(96vw, 980px)) / 2);
  max-width: min(96vw, 980px);
}
.image.full {
  /* full-bleed */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: none;
  border-radius: 0;
}
.image figcaption {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.image figcaption .caption { display: block; font-style: italic; }
.image figcaption .credits { display: block; color: var(--text-dim); margin-top: 4px; }

/* ====================== EMBED ====================== */
.embed {
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}
.embed-label {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 6px;
}
.embed-caption {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
}

/* ====================== SEPARATOR ====================== */
.separator {
  text-align: center;
  font-size: 28px;
  color: var(--text-dim);
  margin: 56px 0;
  letter-spacing: 12px;
}

/* ====================== HOMEPAGE ====================== */
.home-hero {
  position: relative;
  min-height: 92vh;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  background-color: #0a0e18;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.home-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 80px 28px;
  text-align: center;
}
.home-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 112px);
  line-height: 1.0;
  margin: 0 0 24px;
  letter-spacing: -1px;
}
.home-sub {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.4;
}
.home-hero-content .byline {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.home-hero-content .eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 18px;
}
.cta {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 28px;
  letter-spacing: 0.5px;
  transition: transform 0.15s, background 0.15s;
}
.cta:hover { background: #e07a48; color: white; transform: translateY(-1px); }

.home-intro {
  padding: 80px 28px 40px;
  background: var(--bg);
}
.container {
  max-width: var(--max-text);
  margin: 0 auto;
}
.home-intro p {
  font-size: 20px;
  margin: 0 0 22px;
  text-align: center;
}
.home-intro .lead {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
  margin-top: 32px;
}

.chapter-grid {
  padding: 40px 28px 100px;
}
.section-heading {
  font-family: var(--serif-display);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 40px;
  color: var(--text);
}
.section-heading::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 16px auto 0;
}
.chapter-grid .container {
  max-width: var(--max-wide);
}
.chapter-grid .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.chapter-card {
  display: block;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.chapter-card .thumb {
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
  background-color: #0a0e18;
  position: relative;
}
.chapter-card .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10,14,24,0.85) 100%);
}
.chapter-card .meta {
  padding: 20px 22px 24px;
}
.chapter-card .chapter-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}
.chapter-card .chapter-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  margin: 6px 0 6px;
  color: var(--text);
}
.chapter-card .chapter-sub {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 14px;
  color: var(--text-muted);
}

/* ====================== FOOTER ====================== */
.site-footer {
  background: #0e1320;
  padding: 48px 28px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  border-top: 1px solid var(--rule);
}
.site-footer .footer-inner {
  max-width: 760px;
  margin: 0 auto;
}
.site-footer p { margin: 0 0 12px; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); }
.footer-meta { margin-top: 20px; color: var(--text-dim); font-size: 12px; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .top-nav { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .top-nav .brand { display: none; }
  .top-nav .nav-pager { gap: 10px; font-size: 13px; }
  .chapter-body { padding: 40px 22px 60px; }
  .image.wide, .image.full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
  }
  .home-intro { padding: 60px 22px 28px; }
  .home-intro p { font-size: 18px; }
  .home-intro .lead { font-size: 22px; }
  .sec-nav { top: 110px; }
  .chapter-body blockquote { font-size: 18px; padding-left: 18px; }
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-in { opacity: 1; transform: translateY(0); }
