/* ============================================================
   Helm design tokens — v0 draft
   Generated from tokens.json. Source-of-truth lives there.
   See design/README.md for the brief.

   Brief: editorial / legal-brief register. Black on white. Inter only.
   No AI-design elements (no gradients, no glassmorphism, no sparkles,
   no glow, no animation beyond state-change). Print-grade by default.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* -- Color ----------------------------------------------------------- */
  /* Two-color base + two semantic accents. No gradients ever. */
  --color-ink:          #000000;
  --color-paper:        #FFFFFF;
  --color-muted:        #5C5C5C;
  --color-subtle:       #8A8A8A;
  --color-rule:         #D6D6D6;
  --color-rule-strong:  #000000;
  --color-warning:      #8B0000;  /* destructive actions, missed deadlines */
  --color-citation:     #1A237E;  /* contract clauses, links, inline refs */
  --color-highlight:    #FFF8C7;  /* highlighter-marker on matched copy */

  /* -- Type ------------------------------------------------------------ */
  /* Inter as the only family (Matt 19:50). JetBrains Mono for IDs,
     timestamps, money columns, code. Bringhurst: don't go heavier as
     you go larger; let size do the work. */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --fs-caption: 13px;
  --fs-small:   14px;
  --fs-body:    16px;
  --fs-lead:    19px;
  --fs-h6:      16px;
  --fs-h5:      18px;
  --fs-h4:      22px;
  --fs-h3:      28px;
  --fs-h2:      36px;
  --fs-h1:      48px;

  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-body:  1.6;
  --lh-lead:  1.55;
  --lh-head:  1.15;

  --tr-tight:  -0.02em;
  --tr-body:   -0.011em;
  --tr-normal: 0;
  --tr-wide:   0.06em;
  --tr-caps:   0.12em;

  /* -- Space (4px base) ----------------------------------------------- */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* -- Layout --------------------------------------------------------- */
  /* Bringhurst body measure ~65–75cc. At 16/1.6 in Inter, ~620px lands ~70cc. */
  --measure-narrow: 560px;
  --measure-body:   640px;
  --measure-wide:   800px;

  --page-max: 1280px;
  --page-pad: clamp(24px, 5vw, 80px);

  /* -- Border --------------------------------------------------------- */
  --bw-hairline: 1px;
  --bw-rule:     2px;

  /* -- Radius — zero by default. The input exception only. ------------ */
  --radius-0:     0;
  --radius-input: 2px;

  /* -- Shadow — none by default. Modal exception only. ---------------- */
  --shadow-0:     none;
  --shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* -- Motion (state-change only) ------------------------------------- */
  --dur-fast:    120ms;
  --dur-default: 200ms;
  --ease:        cubic-bezier(0.2, 0.8, 0.2, 1);

  /* -- Z-index -------------------------------------------------------- */
  --z-base:    0;
  --z-raised:  10;
  --z-sticky:  100;
  --z-overlay: 500;
  --z-modal:   1000;
}

/* ============================================================
   Base reset + document defaults
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

::selection {
  background: var(--color-ink);
  color: var(--color-paper);
}

/* ============================================================
   Print
   Editorial / legal-brief: US Letter, generous margins, no decoration.
   The case-file PDF export uses these same styles via Paged.js.
   ============================================================ */

@page {
  size: letter;
  margin: 1in 1.25in;
}

@media print {
  :root {
    --color-citation: #000000; /* citations render black-on-white in print */
  }

  body {
    background: var(--color-paper);
    color: var(--color-ink);
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

  /* Avoid orphan headings */
  h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
  }

  /* Don't split lists across pages where possible */
  li {
    break-inside: avoid;
  }
}
