/*
 * spec.css — chapter typography + layout for /spec.html
 * Adds to style.css (must come AFTER style.css in the cascade).
 * Voice: whitepaper-academic; line measure ~70ch; Inter sans for
 * body density; JetBrains Mono cyan Roman numerals as tech accent.
 */

/* ── Hero ─────────────────────────────────────────────────────── */

.spec-hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 80px 24px 32px;
  text-align: center;
}

.spec-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2EE6E2;
  margin: 0 0 16px;
}

.spec-hero h1 {
  font-size: clamp(48px, 7vw, 80px);
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: #F5F6FA;
}

.spec-lede {
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.65;
  color: #B2B7C2;
  max-width: 64ch;
  margin: 0 auto;
}

/* ── Table of contents ────────────────────────────────────────── */

.spec-toc {
  max-width: 680px;
  margin: 32px auto 64px;
  padding: 24px 32px;
  border: 1px solid #1F2230;
  border-radius: 12px;
  background: #0F121A;
  position: relative;
}

.spec-toc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(46,230,226,0.20), rgba(167,139,250,0.20));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.spec-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 32px;
}

@media (max-width: 640px) {
  .spec-toc ol { grid-template-columns: 1fr; }
}

.spec-toc li {
  margin: 0;
}

.spec-toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  color: #C7CBD6;
  font-size: 15px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.spec-toc a:hover {
  color: #2EE6E2;
  border-bottom-color: rgba(46,230,226,0.35);
}

.toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #6B7080;
  letter-spacing: 0.05em;
  min-width: 32px;
  flex-shrink: 0;
}

.spec-toc a:hover .toc-num {
  color: #2EE6E2;
}

/* ── Chapter ──────────────────────────────────────────────────── */

.spec-chapter {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px;
  scroll-margin-top: 80px;       /* TOC anchor offset for the topbar */
  position: relative;
}

.spec-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: #2EE6E2;
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(46,230,226,0.35);
  border-radius: 4px;
  margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(46,230,226,0.45);
}

/* Rotate accent across chapters in pairs (matches the index.html
   compare/cards rhythm). */
.spec-chapter:nth-of-type(3n+2) .spec-num {
  color: #A78BFA;
  border-color: rgba(167,139,250,0.35);
  text-shadow: 0 0 8px rgba(167,139,250,0.45);
}
.spec-chapter:nth-of-type(3n+3) .spec-num {
  color: #FFD166;
  border-color: rgba(255,209,102,0.35);
  text-shadow: 0 0 8px rgba(255,209,102,0.45);
}

.spec-chapter h2 {
  font-size: clamp(28px, 3.4vw, 36px);
  letter-spacing: -0.015em;
  margin: 0 0 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1F2230;
  color: #F5F6FA;
}

.spec-chapter p {
  font-size: 16.5px;
  line-height: 1.75;
  color: #D9DCE5;
  margin: 0 0 22px;
  max-width: 70ch;
}

.spec-chapter p:last-child {
  margin-bottom: 0;
}

.spec-chapter > p:first-of-type {
  font-size: 17.5px;
  color: #E6E8EE;
}

/* Chapter separator — a single horizontal hairline between articles */
.spec-chapter + .spec-chapter {
  border-top: 1px solid #1F2230;
  margin-top: 16px;
  padding-top: 56px;
}

/* ── Footer ───────────────────────────────────────────────────── */

.spec-foot {
  max-width: 680px;
  margin: 96px auto 64px;
  padding: 48px 24px 0;
  border-top: 1px solid #1F2230;
  text-align: center;
}

.spec-foot p {
  font-size: 16px;
  line-height: 1.7;
  color: #B2B7C2;
  max-width: 56ch;
  margin: 0 auto 24px;
}

.spec-foot-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #6B7080;
}

.spec-foot-meta a {
  color: #2EE6E2;
}

.spec-foot-meta a:hover {
  color: #A78BFA;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .spec-hero { padding: 48px 20px 24px; }
  .spec-toc { margin: 24px 20px 48px; padding: 20px; }
  .spec-chapter { padding: 40px 20px; }
  .spec-chapter + .spec-chapter { padding-top: 40px; }
  .spec-chapter p { font-size: 15.5px; line-height: 1.7; }
}
