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

:root {
  --bg:          #f2e9dd;
  --bg-alt:      #e9dece;
  --bg-dark:     #1e1408;
  --bg-dark2:    #271c0e;
  --text:        #2c1e10;
  --text-muted:  #7c6a52;
  --accent:      #9c4a2b;
  --accent-lt:   #f5e2d8;
  --olive:       #58693f;
  --olive-lt:    #e8ede2;
  --border:      #cfc0a8;
  --content-w:   700px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.82;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }

/* ── SCROLL MARGIN ─────────────────────────────────────── */
section[id] { scroll-margin-top: 52px; }

/* ── NAVBAR ────────────────────────────────────────────── */
.navbar {
  background: var(--bg-dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}
.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #edddc8 !important;
  text-decoration: none !important;
  padding: 0.85rem 1.25rem 0.85rem 0;
  border-right: 1px solid rgba(255,255,255,0.1);
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand:hover { color: #fff !important; }

#nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.75rem;
  margin-left: auto;
  align-items: center;
}
.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.nav-links li a {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.55);
  text-decoration: none !important;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0 0.7rem;
  height: 100%;
  min-height: 46px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  border-bottom: 3px solid transparent;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: #edddc8;
  background: rgba(255,255,255,0.05);
  border-bottom-color: var(--accent);
}

/* ── HERO ──────────────────────────────────────────────── */
.hero-section {
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 75% 45%, rgba(156,74,43,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 18% 75%, rgba(88,105,63,0.16) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 10%, rgba(39,28,14,0.8) 0%, transparent 70%);
  color: #edddc8;
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}
.kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero-section h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: #f0e2cc;
  line-height: 1.1;
  margin-bottom: 1.6rem;
  letter-spacing: -0.01em;
}
.hero-desc {
  font-size: 1.05rem;
  color: rgba(237, 221, 200, 0.68);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.78;
}
.hero-team {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
  color: rgba(237,221,200,0.4);
}
.hero-team strong {
  color: rgba(237,221,200,0.72);
  font-weight: 500;
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: rgba(237,221,200,0.25);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.scroll-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(237,221,200,0.3), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* ── SECTION LAYOUT ────────────────────────────────────── */
.content-section {
  border-top: 1px solid var(--border);
}
.content-section.alt { background: var(--bg-alt); }

/* Mobile-first: stacked */
.section-grid {
  display: flex;
  flex-direction: column;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.section-body { order: 1; }
.stat-side.left  { order: 2; }
.stat-side.right { order: 3; }

.stat-side {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2rem;
}

.section-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-body h2 {
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  color: var(--text);
  margin-bottom: 1.5rem;
}
.section-body h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 2px;
  background: var(--accent);
  margin-top: 0.75rem;
}
.section-body p {
  color: var(--text);
  margin-bottom: 1.3rem;
}
.section-body p:last-of-type { margin-bottom: 0; }

/* ── STAT BLOCKS (mobile) ──────────────────────────────── */
.stat-block {
  flex: 1;
  min-width: 120px;
  padding: 1rem 1rem 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-lt);
  border-radius: 2px;
}
.alt .stat-block { background: var(--bg); }
.stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── WIDE LAYOUT: stats in margins ─────────────────────── */
@media (min-width: 1200px) {
  .section-grid {
    display: grid;
    grid-template-columns: 165px 2.5rem minmax(0, var(--content-w)) 2.5rem 165px;
    justify-content: center;
    max-width: none;
    padding: 5.5rem 2rem;
    align-items: center;
    column-gap: 0;
    row-gap: 0;
  }
  .section-body  { grid-column: 3; order: unset; }
  .stat-side.left  { grid-column: 1; order: unset; }
  .stat-side.right { grid-column: 5; order: unset; }

  .stat-side {
    flex-direction: column;
    margin-top: 0;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2rem;
  }
  .stat-side.left  { align-items: flex-end; }
  .stat-side.right { align-items: flex-start; }

  .stat-block {
    flex: unset;
    width: 100%;
    max-width: 155px;
    background: transparent !important;
    padding: 0;
    border: none;
  }
  .stat-side.left .stat-block {
    text-align: right;
    border-right: 3px solid var(--accent);
    border-left: none;
    padding-right: 1rem;
  }
  .stat-side.right .stat-block {
    text-align: left;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
  }
  .stat-num { font-size: 3rem; }
}

/* ── SCROLL ANIMATIONS ──────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.75s ease 0.12s, transform 0.75s ease 0.12s;
}
.fade-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.75s ease 0.12s, transform 0.75s ease 0.12s;
}
.animate-in {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

/* ── INLINE CITATIONS ───────────────────────────────────── */
.cite-ref {
  font-size: 0.72em;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  text-decoration: none;
}
.cite-ref:hover { text-decoration: underline; }

/* ── WORKS CITED ────────────────────────────────────────── */
.works-cited-list {
  list-style: none;
  counter-reset: cite-counter;
  padding: 0;
  margin-top: 0.5rem;
}
.works-cited-list li {
  counter-increment: cite-counter;
  padding: 0.85rem 0 0.85rem 2.5rem;
  text-indent: -2.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
  line-height: 1.68;
}
.works-cited-list li::before {
  content: counter(cite-counter) ".";
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.45rem;
  font-size: 0.85em;
}
.works-cited-list li:last-child { border-bottom: none; }
.works-cited-list a { color: var(--accent); word-break: break-all; }

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  background: var(--bg-dark);
  color: rgba(237,221,200,0.38);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.75;
}
footer a { color: rgba(237,221,200,0.58); }

/* ── RESPONSIVE NAVBAR ──────────────────────────────────── */
@media (max-width: 768px) {
  #nav-toggle-btn { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--bg-dark2);
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-left: 3px solid transparent;
    border-top: none;
    min-height: auto;
    font-size: 0.875rem;
    white-space: normal;
  }
  .nav-links li a:hover,
  .nav-links li a.active {
    border-left-color: var(--accent);
    background: rgba(255,255,255,0.04);
  }
}
