/* ============================================================
   code::core — African Graphyte Autobox
   Shared stylesheet — navy / gold / ivory design system
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --navy:    #0D2340;
  --gold:    #B8922A;
  --ivory:   #F9F6EF;
  --parch:   #EDE8DC;
  --ink:     #1C1A16;
  --inksoft: #6B6760;
  --rule:    #D5CFC3;
  --blue700: #1E4D8C;
  --blue500: #3970B8;
  --magenta: #870C71;
  --teal:    #0F6E56;
  --rust:    #B5552E;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ── Base ────────────────────────────────────────────────── */
body {
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.85;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
}

p { margin: 0 0 1rem; }

a { color: var(--blue700); text-decoration: none; }
a:hover { color: var(--gold); }

ul, ol { padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }

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

/* ── Layout shell ────────────────────────────────────────── */
.shell,
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Alias: .module = .section */
.module {
  padding: 64px 0;
  border-bottom: 1px solid var(--rule);
}
.module:last-of-type { border-bottom: none; }
.module .label,
.module .kicker { display: block; margin-bottom: 8px; }
.module h2 { font-size: clamp(20px, 3vw, 30px); margin-bottom: 6px; }
.module .sub {
  color: var(--inksoft);
  font-size: 14.5px;
  margin-bottom: 28px;
  max-width: 560px;
}
.module p { margin-bottom: 16px; max-width: 680px; }
.module p strong { color: var(--navy); font-weight: 500; }

/* Wordmark (used in nav on some pages) */
.wordmark {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ivory);
  flex-shrink: 0;
  text-decoration: none;
}
.wordmark span { color: var(--gold); }

/* ── Navigation ──────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13, 35, 64, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(184, 146, 42, 0.3);
}

.site-nav .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  flex-shrink: 0;
}
.brand strong {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ivory);
}
.brand strong span { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: var(--ivory);
  opacity: 0.7;
  font-size: 12.5px;
  font-weight: 300;
  white-space: nowrap;
  transition: opacity 0.15s, color 0.15s;
}
.nav-links a:hover { opacity: 1; color: var(--gold); }
.nav-links a.active { opacity: 1; color: var(--gold); }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  aria-label: "Menu";
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ivory);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Hero / page header ──────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--rule);
}

.kicker {
  display: block;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--inksoft);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(26px, 5vw, 44px);
  max-width: 680px;
  margin-bottom: 20px;
}

/* Alias: .lede = .lead */
.lede,
.lead {
  font-size: 16px;
  color: var(--inksoft);
  max-width: 560px;
  font-weight: 300;
  margin-bottom: 20px;
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  padding: 52px 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }

.section h2 {
  font-size: clamp(20px, 3vw, 28px);
  margin-bottom: 14px;
}

/* ── Two-column grid ─────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: #fefbf6;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 20px;
}
.card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 10px;
}
.card p { font-size: 14px; color: var(--inksoft); margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card .checklist { margin-top: 8px; }

/* ── Callout / panel ─────────────────────────────────────── */
.callout,
.panel {
  border-left: 3px solid var(--gold);
  padding: 14px 20px;
  background: var(--parch);
  border-radius: 0 8px 8px 0;
  margin: 22px 0;
  max-width: 680px;
}
.callout p, .panel p { margin: 0 0 6px; font-size: 13.5px; }
.callout p:last-child, .panel p:last-child { margin: 0; }
.callout .kicker { margin-bottom: 6px; color: var(--navy); }
.callout.warn { border-left-color: var(--magenta); }
.callout.warn .kicker { color: var(--magenta); }

/* ── Quote block ─────────────────────────────────────────── */
.quote {
  border-left: 3px solid var(--gold);
  padding: 14px 20px;
  margin: 20px 0;
  max-width: 640px;
}
.quote p {
  font-size: 15px;
  color: #3a2f20;
  font-style: italic;
  margin: 0;
}

/* ── Equation / code block ───────────────────────────────── */
.eq-block {
  background: var(--navy);
  color: var(--ivory);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 22px 0;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 15px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.7;
}
.eq-block .eq-note {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 11.5px;
  color: var(--gold);
  margin-top: 10px;
}

/* ── Tables ──────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 22px 0;
}

th {
  background: var(--navy);
  color: var(--ivory);
  text-align: left;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12.5px;
  vertical-align: top;
}

td.prose {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 13px;
}

tr:nth-child(even) td { background: var(--parch); }
tr:last-child td { border-bottom: none; }

/* ── Book list ───────────────────────────────────────────── */
.book-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.book {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
  font-size: 13.5px;
}
.book strong { color: var(--navy); display: block; margin-bottom: 4px; }
.book span { color: var(--inksoft); font-size: 13px; }

/* ── Checklist ───────────────────────────────────────────── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.checklist li {
  padding-left: 1.2rem;
  position: relative;
  font-size: 13.5px;
  color: var(--inksoft);
  margin-bottom: 6px;
}
.checklist li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  padding: 44px 0 52px;
  text-align: center;
  font-size: 12px;
  color: var(--inksoft);
  border-top: 1px solid var(--rule);
  margin-top: 20px;
}

/* ── Responsive — Tablet 860px ───────────────────────────── */
@media (max-width: 860px) {
  .shell, .wrap { padding: 0 20px; }
  .two-col { grid-template-columns: 1fr; }
  .book-list { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  .module { padding: 48px 0; }
}

/* ── Responsive — Mobile 640px ───────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .shell, .wrap { padding: 0 16px; }

  /* Show hamburger, stack nav links */
  .nav-toggle { display: flex; }

  .site-nav { position: relative; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(13, 35, 64, 0.98);
    border-top: 1px solid rgba(184, 146, 42, 0.2);
    padding: 8px 0 12px;
    z-index: 199;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 11px 20px;
    font-size: 13.5px;
    opacity: 0.85;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .nav-links a:last-child { border-bottom: none; }

  /* Hero */
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 26px; }
  .lead { font-size: 15px; }

  /* Sections */
  .section { padding: 36px 0; }

  /* Cards */
  .card { padding: 16px; }

  /* Tables — scroll horizontally on mobile */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  th, td { padding: 8px 10px; font-size: 11.5px; }

  /* Callout/panel */
  .callout, .panel { max-width: 100%; }

  /* Eq block */
  .eq-block { font-size: 13px; padding: 16px 18px; border-radius: 8px; }

  /* Books */
  .book-list { gap: 10px; }
}

/* ── Responsive — Small 400px ────────────────────────────── */
@media (max-width: 400px) {
  .hero h1 { font-size: 22px; }
  .eq-block { font-size: 12px; padding: 14px; }
}
