/* ═══════════════════════════════════════════════════════════════
   CHECKPOINT K — SITE.CSS
   Core design system: tokens, typography, layout primitives
   ═══════════════════════════════════════════════════════════════ */

/* ─── Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── Design tokens ─── */
:root {
  /* Base colors */
  --bg-void: #030509;
  --bg-deep: #07101b;
  --bg-panel: #0d1627;
  --bg-raised: #131f35;
  --bg-elevated: #1a2a47;

  /* Borders */
  --border-faint: #121e34;
  --border: #1a2a47;
  --border-strong: #253963;
  --border-glow: rgba(126, 201, 255, 0.3);

  /* Ice blue accent system */
  --ice: #7ec9ff;
  --ice-bright: #a8ddff;
  --ice-mid: #4a9eff;
  --ice-deep: #2a5a9a;
  --ice-dark: #152d4e;
  --ice-glow: rgba(126, 201, 255, 0.4);
  --ice-glow-soft: rgba(126, 201, 255, 0.15);

  /* Text */
  --text: #e8eef7;
  --text-dim: #8592ad;
  --text-faint: #4a5570;
  --text-mute: #2e3a52;

  /* Semantic */
  --gold: #d9ae47;
  --gold-bright: #f0c568;
  --gold-glow: rgba(217, 174, 71, 0.35);
  --red: #ff5a5a;
  --red-dim: #b84848;
  --red-glow: rgba(255, 90, 90, 0.3);
  --green: #5ad99e;
  --green-dim: #48a87a;
  --green-glow: rgba(90, 217, 158, 0.3);
  --orange: #ff9544;

  /* Fonts */
  --display: 'Oswald', 'Impact', sans-serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Radii — minimal. Edges, not softness. */
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;

  /* Shadows — glow-based, not drop */
  --glow-ice: 0 0 24px rgba(126, 201, 255, 0.25);
  --glow-gold: 0 0 24px rgba(217, 174, 71, 0.3);
  --glow-panel: 0 0 32px rgba(0, 0, 0, 0.6);

  /* Layout */
  --nav-height: 72px;
  --content-max: 1320px;
  --content-reading: 820px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset + base ─── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The atmospheric backdrop — hex pattern + subtle gradient */
body {
  background:
    radial-gradient(ellipse at top, rgba(42, 90, 154, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(126, 201, 255, 0.04) 0%, transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52' width='60' height='52'><path d='M30 1 L57 15 L57 37 L30 51 L3 37 L3 15 Z' fill='none' stroke='%231a2a47' stroke-width='0.5' opacity='0.35'/></svg>"),
    var(--bg-void);
  background-size: auto, auto, 60px 52px, auto;
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--text);
}

h1 { font-size: clamp(40px, 5vw, 72px); font-weight: 600; }
h2 { font-size: clamp(28px, 3vw, 44px); font-weight: 500; }
h3 { font-size: 22px; font-weight: 500; }
h4 { font-size: 18px; font-weight: 500; }

p { margin: 0 0 1em 0; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--ice);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover { color: var(--ice-bright); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

img { max-width: 100%; display: block; }

::selection { background: var(--ice-deep); color: var(--ice-bright); }

/* ─── Utility classes ─── */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--sp-5); }
.container-narrow { max-width: var(--content-reading); margin: 0 auto; padding: 0 var(--sp-5); }

.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: var(--sp-2); }
.gap-md { gap: var(--sp-4); }
.gap-lg { gap: var(--sp-5); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.text-center { text-align: center; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.display { font-family: var(--display); }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }

.mt-sm { margin-top: var(--sp-2); }
.mt-md { margin-top: var(--sp-4); }
.mt-lg { margin-top: var(--sp-6); }
.mt-xl { margin-top: var(--sp-8); }
.mb-sm { margin-bottom: var(--sp-2); }
.mb-md { margin-bottom: var(--sp-4); }
.mb-lg { margin-bottom: var(--sp-6); }

.w-full { width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ─── Text hierarchy helpers ─── */
.eyebrow {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: var(--sp-3);
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
}
.eyebrow a:hover { color: var(--ice-bright); }

.section-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ice);
  padding-bottom: var(--sp-3);
  margin: var(--sp-7) 0 var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, var(--ice), transparent);
  box-shadow: 0 0 8px var(--ice-glow);
}

.page-header {
  padding: var(--sp-8) 0 var(--sp-5) 0;
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-weight: 600; margin-bottom: var(--sp-2); }
.page-header .sub {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 720px;
}

/* ─── Prose (markdown content) ─── */
.prose { font-size: 16px; line-height: 1.75; color: var(--text); }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.5em; margin-bottom: 0.5em; }
.prose h2 { font-size: 28px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.prose h3 { font-size: 22px; color: var(--ice); }
.prose p { margin-bottom: 1.2em; }
.prose blockquote {
  border-left: 3px solid var(--ice);
  padding: var(--sp-3) var(--sp-5);
  margin: var(--sp-5) 0;
  background: var(--bg-panel);
  font-style: italic;
  color: var(--text-dim);
}
.prose code {
  background: var(--bg-panel);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ice);
  border: 1px solid var(--border);
}
.prose pre {
  background: var(--bg-panel);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  overflow-x: auto;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
}
.prose pre code { background: transparent; border: 0; padding: 0; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose img { margin: var(--sp-5) auto; border-radius: var(--r-md); border: 1px solid var(--border); }
.prose hr { margin: var(--sp-6) 0; }
.prose strong { color: var(--ice-bright); }
.prose a { text-decoration: underline; text-decoration-color: var(--ice-deep); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ice); }
