/* ============================================================
   BLOG-BASE.CSS — Foundation: variables, typography, color, layout
   The Coral and the Polyp — Blog Post Architecture
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,800;1,9..144,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Backgrounds */
  --bg: #08090c;
  --bg-raised: #0e1017;
  --bg-elevated: #131620;

  /* Text */
  --text: #c4c8d4;
  --text-bright: #e8eaf0;
  --text-dim: rgba(196, 200, 212, 0.5);

  /* Semantic colors — meaning is fixed across all posts */
  --gold: #d4a853;           /* Primary insight trail — reader follows gold */
  --gold-dim: #9a7a3d;       /* Section markers, labels */
  --cyan: #4ecdc4;           /* Technical detail, source attribution */
  --cyan-dim: rgba(78, 205, 196, 0.15);
  --green: #7bc47f;          /* Positive findings, confirmations */
  --red: #e85d5d;            /* Warnings, anti-propaganda markers, breaks */
  --violet: #9b72cf;         /* The void, thresholds, discomfort */
  --violet-dim: rgba(155, 114, 207, 0.08);
  --amber-glow: rgba(212, 168, 83, 0.08);

  /* Typography */
  --display: 'Fraunces', serif;
  --body: 'Source Serif 4', serif;
  --mono: 'IBM Plex Mono', monospace;
}

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

/* ── Base ── */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Prose Container ── */
.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Links ── */
a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 168, 83, 0.3);
  transition: border-color 0.3s;
}
a:hover {
  border-bottom-color: var(--gold);
}

/* ── Strong / Em ── */
strong {
  color: var(--text-bright);
  font-weight: 600;
}
em {
  font-style: italic;
}
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(212, 168, 83, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
}
.hero-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.12;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.6s forwards;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  font-family: var(--body);
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 1s 0.9s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Sections ── */
section {
  position: relative;
}
section p {
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

.section-number {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}

section h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 2rem;
}

section h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* ── Selection ── */
::selection {
  background: rgba(212, 168, 83, 0.25);
  color: var(--text-bright);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }
  .hero-sub {
    font-size: 1rem;
  }
  .prose {
    padding: 0 1.2rem;
  }
}
