/* ==========================================================================
   THE ROGUE PATIENT - BRAND TOKENS
   V1.2, 2026-10-21

   SOURCE OF TRUTH: the founder's own selections, read back from the saved
   decision records on 2026-10-21.

     Type Round 2 (decisions/type-round2)      Instrument Serif ticked
     Masthead Mock (approved by screenshot)    Instrument Serif
                                               All caps: on
                                               Hard shadow: on
                                               Headlines in same face: on
     Masthead Mock palette                     paper #F5EEE3, card #FAF6EE,
                                               ink #121211, crimson #990000,
                                               slate #1E293B, gold #FACC15,
                                               rules black, 3px, hard offset

   Body text is Libre Baskerville, the reading face in the approved mock.
   Labels and small furniture are Inter. Nothing here comes from the
   Substack theme; that reading (V1.1, Spectral on white) was wrong.
   ========================================================================== */

/* --- Self-hosted faces. Zero external CDN, per Discipline 01. ------------- */
@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/instrument-serif-400.woff2') format('woff2');
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/instrument-serif-400-italic.woff2') format('woff2');
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('assets/fonts/libre-baskerville-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('assets/fonts/libre-baskerville-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('assets/fonts/libre-baskerville-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('assets/fonts/libre-baskerville-700-italic.woff2') format('woff2');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-700.woff2') format('woff2');
  font-weight: 700 900; font-style: normal; font-display: swap;
}

:root {
  /* --- Palette, from the approved masthead mock ---------------------------- */
  --trp-canvas: #F5EEE3;           /* paper, page background */
  --trp-surface: #FAF6EE;          /* card, the framed page */
  --trp-surface-2: #EADFCC;        /* deeper paper for inset blocks */
  --trp-text: #121211;             /* ink */
  --trp-text-secondary: #4A4640;   /* muted ink, 8.1:1 on paper */
  --trp-crimson: #990000;          /* masthead, stamp, accents */
  --trp-crimson-dark: #800000;
  --trp-on-crimson: #FFFFFF;
  --trp-slate: #1E293B;            /* headline ink and the order block */
  --trp-on-slate: #F5EEE3;
  --trp-gold: #FACC15;             /* the satire band */
  --trp-on-gold: #111111;
  --trp-rule: #000000;             /* every rule and frame is black */
  --trp-rule-hair: #000000;

  /* --- Type -------------------------------------------------------------- */
  --trp-font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --trp-font-body: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --trp-font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --trp-font-mono: ui-monospace, 'JetBrains Mono', Menlo, monospace;

  --trp-body-size: 17px;
  --trp-body-leading: 1.6;

  /* --- Structure ---------------------------------------------------------- */
  --trp-measure: 66ch;
  --trp-gutter: 16px;
  --trp-max: 1040px;
  --trp-rule-weight: 3px;
  --trp-shadow: 8px 8px 0 var(--trp-rule);
  --trp-shadow-sm: 3px 3px 0 var(--trp-rule);
  --trp-text-shadow: 4px 4px 0 var(--trp-rule);

  /* --- Scale, fluid -------------------------------------------------------- */
  --trp-step-mast: clamp(2.8rem, 10vw, 7rem);
  --trp-step-h1: clamp(1.9rem, 4.6vw, 3.2rem);
  --trp-step-h2: clamp(1.5rem, 3.4vw, 2.3rem);
  --trp-step-h3: 1.3rem;
  --trp-step-meta: 0.72rem;
}

/* Accessibility mode: raises contrast without changing the brand. */
body.trp-contrast {
  --trp-canvas: #FFFFFF;
  --trp-surface: #FFFFFF;
  --trp-surface-2: #F0F0F0;
  --trp-text: #000000;
  --trp-text-secondary: #2B2B2B;
  --trp-crimson: #7A0000;
  --trp-slate: #000000;
}

/* Reader mode: body face swapped for a high-legibility sans. */
body.trp-legible,
body.trp-legible * {
  font-family: var(--trp-font-ui) !important;
  letter-spacing: 0.012em !important;
  line-height: 1.75 !important;
  text-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
