/* ===========================================
   BASE STYLES - Resets, Typography, Utilities
   =========================================== */

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

html {
  /* Smooth scrolling for anchor links */
  scroll-behavior: smooth;
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
  /* Better text sizing on mobile */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: var(--lead, 1.5);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography utilities */
.display {
  font-family: "Old Standard TT", "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-ligatures: none;
}

.serif {
  font-family: "Newsreader", serif;
}

.small-caps {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72em;
}

/* Layout utilities */
.wrap {
  max-width: var(--wrap-max, 1400px);
  margin: 0 auto;
  padding: 0 var(--wrap-padding, 40px);
}

/* Rules / Dividers */
.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  opacity: 0.9;
}

.rule-thick {
  border: 0;
  border-top: 3px solid var(--rule);
  margin: 0;
}

.rule-double {
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 4px;
  background: transparent;
}

/* Links */
a {
  color: var(--ink);
}

a:hover {
  color: var(--accent);
}

/* Section base */
section {
  padding: var(--pad-block, 120px) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: baseline;
  margin-bottom: 48px;
}

.section-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.section-title {
  font-family: "Old Standard TT", serif;
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-aside {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  max-width: 220px;
}

/* Keyframes */
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
