/* ============================================================
   Peter Swain Institute — Design System v2 ("PSI v2")
   Source: claude.ai/design project 2687d40d — colors_and_type.css
   Three colours: pure black, pure white, Swain yellow #FACA11.
   One rule: maximum contrast, zero ornament.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Saira+Stencil+One&display=swap');

:root {
  /* ===== CORE COLOR ===== */
  --bg:            #000000;  /* canvas, always */
  --bg-elev-1:     #0A0A0A;  /* subtle elevation on black */
  --bg-elev-2:     #141414;  /* card / hover */
  --bg-paper:      #FFFFFF;  /* white panel surfaces */

  --fg:            #FFFFFF;
  --fg-2:          #C9C9C9;
  --fg-3:          #8A8A8A;
  --fg-4:          #4A4A4A;

  --fg-on-paper:   #0B0B0B;
  --fg-on-paper-2: #4B4B4B;

  /* ===== ACCENT — The Swain Yellow =====
     Yellow fills always take BLACK text (--on-yellow).
     Small yellow TEXT on white uses --yellow-ink, never --yellow. */
  --yellow:        #FACA11;
  --yellow-hot:    #FFDA4D;
  --yellow-deep:   #B08A00;
  --yellow-ink:    #8A6A00;
  --yellow-glow:   rgba(250, 202, 17, 0.45);
  --on-yellow:     #0B0B0B;

  /* Legacy aliases — old --red-* names resolve to yellow */
  --red:           var(--yellow);
  --red-hot:       var(--yellow-hot);
  --red-deep:      var(--yellow-deep);
  --red-glow:      var(--yellow-glow);

  /* ===== HAIRLINES + RULES ===== */
  --rule:          rgba(255,255,255,0.08);
  --rule-strong:   rgba(255,255,255,0.18);
  --rule-yellow:   var(--yellow);
  --rule-red:      var(--yellow);
  --rule-on-paper: rgba(0,0,0,0.12);
  --rule-on-paper-strong: rgba(0,0,0,0.18);

  /* ===== TYPE FAMILIES ===== */
  --font-display:  'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --font-body:     'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --font-stencil:  'Saira Stencil One', 'Barlow', sans-serif;

  /* ===== TYPE SCALE ===== */
  --fs-hero:       96px;
  --fs-display:    72px;
  --fs-h1:         56px;
  --fs-h2:         40px;
  --fs-h3:         28px;
  --fs-eyebrow:    14px;
  --fs-body-lg:    18px;
  --fs-body:       16px;
  --fs-sm:         14px;
  --fs-xs:         12px;

  --lh-tight:      1.02;
  --lh-snug:       1.15;
  --lh-body:       1.55;
  --lh-mono:       1.5;

  --tracking-display: -0.01em;
  --tracking-eyebrow: 0.18em;
  --tracking-body:    0em;
  --tracking-mono:    0em;

  /* ===== TERMINAL SURFACE SCALE ===== */
  --fs-term-display: 64px;
  --fs-term-h:       18px;
  --fs-term-body:    15px;
  --fs-term-small:   12px;

  /* ===== SPACING ===== */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 24px;  --space-6: 32px;  --space-7: 48px;  --space-8: 64px;
  --space-9: 96px;  --space-10: 128px;

  /* ===== RADII ===== */
  --r-0: 0px; --r-1: 2px; --r-2: 4px; --r-3: 8px; --r-4: 12px; --r-pill: 999px;

  /* ===== ELEVATION ===== */
  --shadow-card:   0 4px 24px rgba(0,0,0,0.35);
  --shadow-pop:    0 8px 40px rgba(0,0,0,0.5);
  --shadow-yellow: 0 0 0 1px var(--yellow), 0 0 24px var(--yellow-glow);
  --shadow-red:    var(--shadow-yellow);

  /* ===== MOTION ===== */
  --ease:     cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 120ms;
  --dur:      200ms;
  --dur-slow: 400ms;
}

/* ============================================================
   COMPATIBILITY LAYER
   The live site's pages each inline an aurora-era palette under
   these names. Remapping them here re-skins every existing rule
   without rewriting it. The three aurora hues collapse to the
   single Swain yellow — the system has exactly one accent.
   ============================================================ */
:root {
  --void:          var(--bg);
  --deep:          var(--bg-elev-1);
  --card:          var(--bg-elev-2);
  --pink:          var(--yellow);
  --purple:        var(--yellow);
  --blue:          var(--yellow);
  --white:         var(--fg);
  --body:          var(--fg-2);
  --body-dim:      var(--fg-3);
  --border:        var(--rule-strong);
  --border-subtle: var(--rule);
}

/* ============================================================
   SEMANTIC TYPE
   ============================================================ */
.t-hero, .t-display, .t-h1, .t-h2, .t-h3 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  color: var(--fg);
  text-wrap: balance;
}
.t-hero    { font-size: var(--fs-hero); }
.t-display { font-size: var(--fs-display); line-height: var(--lh-snug); }
.t-h1      { font-size: var(--fs-h1);      line-height: var(--lh-snug); }
.t-h2      { font-size: var(--fs-h2);      line-height: var(--lh-snug); }
.t-h3      { font-size: var(--fs-h3);      line-height: var(--lh-snug); }

.t-eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg);
}

.t-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body); }
.t-body    { font-size: var(--fs-body);    line-height: var(--lh-body); color: var(--body); }
.t-sm      { font-size: var(--fs-sm);      line-height: var(--lh-body); color: var(--body); }
.t-xs      { font-size: var(--fs-xs);      line-height: 1.4;            color: var(--fg-3); }

.t-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-term-body);
  line-height: var(--lh-mono);
  letter-spacing: var(--tracking-mono);
}
.t-mono-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-term-display);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.t-mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-term-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.t-stencil {
  font-family: var(--font-stencil);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================================
   EDITORIAL PRIMITIVES — the recipes from README
   ============================================================ */

/* Eyebrow pill — yellow fill, black text, mono, letterspaced */
.ps-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-yellow);
  background: var(--yellow);
  padding: 4px 10px;
}
.ps-eyebrow--wide { font-size: 11px; letter-spacing: 0.32em; padding: 5px 14px; }

/* 4px accent rule that opens an issue / major section */
.ps-rule-accent { height: 4px; background: var(--yellow); border: 0; margin: 0; }

/* Issue strip — mono metadata bar */
.ps-issue-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 56px;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.ps-issue-strip .dot { color: var(--yellow); }

/* Drop cap — first paragraph of a lead story only */
.ps-dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 64px;
  float: left;
  line-height: 0.82;
  padding-right: 10px;
  padding-top: 4px;
  color: var(--yellow);
}
.on-paper .ps-dropcap::first-letter { color: var(--yellow-ink); }

/* Pull quote */
.ps-pullquote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--fg);
  border-left: 3px solid var(--yellow);
  padding-left: 22px;
}
.ps-attrib {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
  border-left: 1px solid var(--yellow);
  padding-left: 14px;
}
.on-paper .ps-pullquote { color: var(--fg-on-paper); }
.on-paper .ps-attrib    { color: var(--yellow-ink); font-weight: 700; }

/* Inline key-stat highlight — 2-3 per article maximum */
.ps-stat { color: var(--yellow); font-weight: 700; }
.on-paper .ps-stat { color: var(--yellow-ink); }

/* Editorial figure — grayscale, FIG. caption pill */
.ps-figure { margin: 0; position: relative; }
.ps-figure img { width: 100%; display: block; filter: grayscale(1) contrast(1.05); }
.ps-figure .ps-fig-tag {
  position: absolute; left: 0; bottom: 0;
  background: var(--yellow); color: var(--on-yellow);
  padding: 8px 14px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
}

/* ============================================================
   WHITE PANEL — the SPREAD surface
   ============================================================ */
.on-paper { background: var(--bg-paper); color: var(--fg-on-paper); }
.on-paper .t-body,
.on-paper .t-sm     { color: var(--fg-on-paper-2); }
.on-paper .t-xs,
.on-paper .t-mono-label { color: var(--fg-on-paper); }
.on-paper .t-h1,
.on-paper .t-h2,
.on-paper .t-h3,
.on-paper .t-hero,
.on-paper .t-display,
.on-paper .t-eyebrow { color: var(--fg-on-paper); }
.on-paper .ps-issue-strip { border-bottom-color: var(--rule-on-paper-strong); color: var(--fg-on-paper); }

/* ============================================================
   BUTTON — hollow yellow rectangle, fills on hover
   ============================================================ */
.btn-swain {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--yellow);
  background: transparent;
  border: 2px solid var(--yellow);
  border-radius: var(--r-2);
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-swain:hover  { background: var(--yellow); color: var(--on-yellow); }
.btn-swain:active { background: var(--yellow-deep); border-color: var(--yellow-deep); color: var(--fg); }
.on-paper .btn-swain { color: var(--fg-on-paper); border-color: var(--fg-on-paper); }
.on-paper .btn-swain:hover { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }

/* ============================================================
   TERMINAL CHROME
   ============================================================ */
.term-rule { border-top: 1px solid var(--rule-strong); }
.term-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
  padding: 4px 8px;
  border: 1px solid var(--rule-strong);
}
.term-bullet::before { content: '> '; color: var(--fg-3); font-family: var(--font-mono); }


/* ============================================================
   TAPE — highlighted display word. Black text on a yellow
   ground, the way the nameplate sets its accent word. Use this
   instead of colouring display type yellow: yellow type is thin
   on black and fails contrast on white, the tape does neither.
   ============================================================ */
.tape {
  background: var(--yellow);
  color: var(--on-yellow);
  padding: 0 0.16em 0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

::selection { background: var(--yellow); color: var(--on-yellow); }

/* <em> inside display type is an accent word, not emphasis — it must not
   fall back to the browser's italic. Prose <em> keeps it. */
h1 em, h2 em, h3 em, h4 em,
[class*="headline"] em, [class*="title"] em, [class*="-head"] em { font-style: normal; }
