/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

:root {
  --max-width: 1180px;
  --color-ink: #1A1712;
  --color-ink-soft: #2A241C;
  --color-paper: #F7F3EA;
  --color-paper-raised: #FFFDF8;
  --color-accent: #C05621;
  --color-accent-dark: #8F3F17;
  --color-accent-soft: #F0DDC8;
  --color-text: #2E2A22;
  --color-muted: #6B6154;
  --color-line: #DED4C0;
  --color-good: #3C6E47;
  --color-good-soft: #E1EDE2;
  --color-bad: #A23B2E;
  --color-bad-soft: #F5E2DD;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(26, 23, 18, 0.08);
  --shadow-md: 0 10px 28px rgba(26, 23, 18, 0.16);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 600; }

p { max-width: 74ch; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { display: block; }

.mono { font-family: var(--font-mono); }

/* ============ Icons ============ */
.icon { flex-shrink: 0; stroke: currentColor; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--color-ink);
  border-bottom: 1px solid rgba(240, 221, 200, 0.15);
}
.site-header .container {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo__img { height: 40px; width: auto; display: block; flex-shrink: 0; }
.site-logo { display: flex; align-items: center; gap: 0.7rem; }
.site-logo__text { display: flex; flex-direction: column; line-height: 1.2; }
.site-logo__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #FBF7EE;
}
.site-logo__tag {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: #9C907C;
  margin-top: 0.1rem;
}
.site-footer .site-logo__name { color: #FBF7EE; }
.site-footer .site-logo__tag { color: #7A6F5D; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
  color: #B9AE9A;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--color-accent-soft); }
.site-nav a.active { color: var(--color-accent-soft); border-color: var(--color-accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--color-accent-soft);
}

@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-ink);
    border-bottom: 1px solid rgba(240, 221, 200, 0.15);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav a { width: 100%; padding: 0.7rem 0; }
}

/* ============ Footer ============ */
.site-footer {
  background: var(--color-ink);
  color: #B9AE9A;
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  border-top: 3px solid var(--color-accent);
}
.site-footer a { color: #D9CCB4; }
.site-footer a:hover { color: var(--color-accent-soft); }
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-brand p { color: #9C907C; font-size: 0.9rem; margin-top: 0.75rem; max-width: 40ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  color: #F2E9DA;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}
.footer-col ul li { margin-bottom: 0.55rem; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(240, 221, 200, 0.15);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #7A6F5D;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

/* ============ Utility ============ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.inline-cite {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(192, 86, 33, 0.45);
  text-underline-offset: 2px;
}
.inline-cite:hover { text-decoration-color: var(--color-accent-dark); }

.static-page {
  padding: 3rem 0 4rem;
}
.static-page h1 { margin-bottom: 1rem; }
.static-page h2 { margin: 2rem 0 0.75rem; }
.static-page p, .static-page li { color: var(--color-text); margin-bottom: 0.85rem; }
.static-page ul { padding-left: 1.25rem; list-style: disc; }
