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

:root {
  --bg: #faf9f7;
  --text: #5f8575;
  --text-light: #7a9e8d;
  --border: rgba(95, 133, 117, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #5f8575;
    --text: #faf9f7;
    --text-light: #e8e8e8;
    --border: rgba(250, 249, 247, 0.18);
  }
}

body {
  font-family: "farnham-display", Georgia, serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- Header / Nav ---- */

.site-header {
  --bg: #5f8575;
  --text: #faf9f7;
  --text-light: #e8e8e8;
  --border: rgba(250, 249, 247, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  gap: 1.5rem;
  flex-shrink: 0;
}

.nav-brand {
  line-height: 0;
  flex-shrink: 0;
  height: 42px;
}

.nav-logo {
  display: block;
  width: 60px;
  aspect-ratio: 1268.44 / 889.3;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s ease, font-weight 0s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.875rem 2rem;
    border-top: 1px solid var(--border);
  }

  .site-header.nav-open .nav-links {
    display: flex;
  }

  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

/* ---- Shared elements ---- */

.divider {
  width: 60px;
  height: 1px;
  background-color: var(--text);
  opacity: 0.4;
}

/* ---- Keyframes ---- */

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-rise-dim {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 0.4; transform: translateY(0); }
}

/* ---- Inner page layout ---- */

.page-container {
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.page-title {
  font-size: clamp(2.16rem, 6vw, 3.36rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.page-section {
  margin-top: 2.5rem;
}

.page-section h2 {
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-section h3 {
  font-size: 1.0rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.page-section p {
  font-size: clamp(1.03rem, 2.7vw, 1.19rem);
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.page-section p + p {
  margin-top: 0.75rem;
}

.page-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-section ul li {
  font-size: clamp(1.03rem, 2.7vw, 1.19rem);
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.8;
  letter-spacing: 0.03em;
  padding-left: 1.75rem;
  position: relative;
}

.page-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text);
  opacity: 0.4;
}

.page-section ul li + li {
  margin-top: 0.5rem;
}

.page-section a,
.timeline-desc a,
.page-section li a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.page-section a:hover,
.timeline-desc a:hover,
.page-section li a:hover {
  text-decoration-color: currentColor;
}

/* ---- Inner page animations ---- */

@media (prefers-reduced-motion: no-preference) {
  .page-title {
    animation: fade-rise 0.7s ease-out both;
  }

  .page-container > .divider {
    animation: fade-rise-dim 0.5s ease-out 0.15s both;
  }

  .page-section {
    animation: fade-rise 0.6s ease-out 0.3s both;
  }
}
