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

/* ── Tokens ─────────────────────────────────────── */
:root {
  --bg: #f6f0e4;
  --surface: #ebe4d5;
  --surface-2: #e1d9c9;
  --border: #c9c0aa;
  --blue: #b85f30;
  --amber: #c49820;
  --text: #221b13;
  --muted: #6b5a48;
  --font:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --max-w: 1080px;
  --reading: 700px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

/* ── Type scale ─────────────────────────────────── */
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.65rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.5rem;
}

p {
  color: var(--muted);
}

p + p {
  margin-top: 0.9rem;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.reading {
  max-width: var(--reading);
}

.label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.9rem;
}

/* ── NAV ────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 240, 228, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
}

.nav-brand a {
  color: var(--muted);
  font-weight: 400;
  transition: color 0.2s;
}

.nav-brand a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ── Button ─────────────────────────────────────── */
.btn-outline {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 5px;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

/* ── Images ─────────────────────────────────────── */
figure {
  margin: 0;
}

.img-wrap {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

/* Diagrams: contain so nothing is cropped */
.img-grid .img-wrap img {
  max-height: 300px;
  object-fit: contain;
  background: var(--surface-2);
}

.img-single {
  margin-top: 1.75rem;
}

figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.55rem;
  line-height: 1.45;
}

/* ── Info / callout boxes ────────────────────────── */
.info-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 1rem 1.4rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.info-box strong {
  color: var(--text);
}

.why-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.summary-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 1.5rem;
}

.summary-box p {
  font-size: 1rem;
}

/* ── Two-col text layout ─────────────────────────── */
.two-col-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── Footer ─────────────────────────────────────── */
footer {
  padding: 2.25rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--blue);
  text-decoration: none;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.25rem;
  }

  .nav-inner,
  .footer-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .nav-links {
    gap: 1.1rem;
  }
}

@media (max-width: 900px) {
  .img-grid,
  .two-col-text {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  .nav-inner,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  h2 {
    font-size: clamp(1.25rem, 6vw, 1.6rem);
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}
