/* ============================================================
   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);

  /* Borders & shadows */
  --border: rgba(196, 200, 212, 0.08);
  --border-focus: rgba(196, 200, 212, 0.16);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

  /* 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;
}

/* ── Prose emphasis — semantic color system ──
   Default strong/em get bright white (lifts off gray).
   Semantic classes assign meaning-based color:
   .thesis  = gold    (crystallized insight, the takeaway)
   .evidence= cyan    (data, count, proof, technical detail)
   .void    = violet  (negation, uncomfortable truth, threshold)
   .method  = green   (practical, resolution, methodology)
   .term    = cyan    (technical term introduction)
*/
.prose strong,
.spec-section strong,
.case-study strong {
  color: var(--text-bright);
  font-weight: 600;
}
.prose em,
.spec-section em,
.case-study em {
  color: var(--text-bright);
  font-style: italic;
}
section .thesis {
  color: var(--gold);
}
section .evidence {
  color: var(--cyan);
}
section .void {
  color: var(--violet);
}
section .method {
  color: var(--green);
}
section em.term {
  color: var(--cyan);
}
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;
}
.hero-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-top: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 1.2s 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;
}

/* ============================================================
   LEGAL MEMO COMPONENTS — Block 10 organism
   Professional legal memo layout: IRAC, citations, confidence
   ============================================================ */

/* ── Memo Header ── */
.memo-header {
  max-width: 800px;
  margin: 4rem auto 3rem;
  padding: 2rem 2rem 2rem 2.5rem;
  border-left: 3px solid var(--gold-dim);
  background: var(--bg-raised);
  border-radius: 0 6px 6px 0;
}
.memo-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
}
.memo-field {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.memo-field-label {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text-dim);
  min-width: 4rem;
  text-align: right;
}
.memo-field-value {
  color: var(--text-bright);
}

/* ── Memo Sections ── */
.memo-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}
.memo-section-heading {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(196, 200, 212, 0.1);
}
.memo-discussion {
  padding-top: 1.5rem;
}

/* ── IRAC Components ── */
.irac-issue {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(196, 200, 212, 0.06);
}
.irac-issue:last-child {
  border-bottom: none;
}
.irac-issue-heading {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 1.5rem;
}
.irac-component {
  margin-bottom: 1.5rem;
}
.irac-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}
.irac-application {
  padding-left: 1rem;
  border-left: 2px solid rgba(212, 168, 83, 0.15);
}

/* ── Counter-Argument ── */
.counter-argument {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--violet-dim);
  border-left: 3px solid var(--violet);
  border-radius: 0 6px 6px 0;
}
.counter-argument-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.75rem;
}

/* ── Citation List ── */
.citation-list {
  max-width: 800px;
  margin: 0 auto;
}
.citation-group-heading {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(196, 200, 212, 0.08);
}
.citation-entries {
  list-style: none;
  padding: 0;
}
.citation-entry {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
  border-bottom: 1px solid rgba(196, 200, 212, 0.04);
}
.citation-entry:last-child {
  border-bottom: none;
}
.citation-text {
  flex: 1;
  color: var(--text);
}
.citation-text em {
  color: var(--text-bright);
}
.citation-confidence {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  white-space: nowrap;
}
.confidence-high {
  color: var(--green);
  background: rgba(123, 196, 127, 0.1);
}
.confidence-medium {
  color: var(--cyan);
  background: var(--cyan-dim);
}
.confidence-low {
  color: var(--gold);
  background: var(--amber-glow);
}
.confidence-unverified {
  color: var(--red);
  background: rgba(232, 93, 93, 0.1);
}
.citation-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  border-bottom-color: rgba(78, 205, 196, 0.3);
  white-space: nowrap;
}

/* ── Memo Disclaimer ── */
.memo-disclaimer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(196, 200, 212, 0.08);
}
.memo-disclaimer .prose p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── Print Styles for Legal Memo ── */
@media print {
  .memo-header {
    border-left-color: #333;
    background: #f8f8f8;
  }
  .memo-section {
    break-inside: avoid;
  }
  .irac-issue {
    break-inside: avoid;
  }
  .counter-argument {
    background: #f0f0f4;
    border-left-color: #666;
  }
  .citation-confidence {
    border: 1px solid #ccc;
  }
  .nav-back {
    display: none;
  }
  body {
    background: white;
    color: #1a1a1a;
    font-size: 11pt;
  }
  .memo-section-heading {
    color: #1a1a1a;
  }
}

/* ── 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;
  }
}

/* ── CTA — Blog to App ── */
.torad-cta {
  margin: 4rem auto 2rem;
  max-width: 600px;
  padding: 2rem;
  text-align: center;
  background: rgba(155, 114, 207, 0.04);
  border: 1px solid rgba(155, 114, 207, 0.12);
  border-radius: 12px;
}

.torad-cta h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.torad-cta p {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.torad-cta a.cta-link {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.torad-cta a.cta-link:hover {
  opacity: 0.9;
}
