/* Sourdough, design tokens. Source of truth: design/design_system.md.
   Figma + automated sync deferred until v2.1. */

/* Two self-hosted faces, woff2 only. SIL OFL.
   See design_execution_v1.md §P0.2 and design_system.md brand invariants. */

@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/source-serif-4-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/source-serif-4-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/source-serif-4-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}

/* Berkeley Mono, primary UI face per the v0 brief argument that it is the
   most expressive choice in the system. Trial license is in use; do not
   promote to a public marketing campaign without a commercial license. */
@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMonoTrial-Regular.otf') format('opentype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2010-2027, U+2030-2052, U+20A0-20BF;
}

:root {
  /* --- Color (Federal Document palette, May 2026) ---
     The thesis: a tax product should read as a Treasury bond, not as a
     warm AI startup. Paper is cool ivory (manila), ink is cool near-black,
     no brown undertone. One workhorse accent, federal blue, does
     everything: buttons, borders, links, hovers, shadows, focus.
     Treasury red is a stamp: appears only on the scoreboard numbers, the
     wordmark dot, and <mark> highlights. Two colors, two roles. */
  --paper:         #FBFBFA;   /* eggshell near-white, premium-paper feel */
  --paper-edge:    #E8E8E2;   /* hairline separator */
  --paper-tint:    #F0F0EC;   /* elevated surface, slightly warmer for tinted blocks */
  --ink:           #0E1014;   /* cool near-black, no brown */
  --ink-soft:      #2A2D33;
  --warm:          #4A4D53;   /* cool muted, was warm gray-brown */
  --mute:          #6B6E76;
  --federal:       #1B3A6B;   /* deep federal blue, the workhorse accent */
  --federal-deep:  #122A4D;
  --federal-tint:  #D9DFE9;   /* focus ring, panel tint */
  --flag:          #B22234;   /* treasury red, numbers, dot, mark only */
  --flag-tint:     #F1D6D9;
  --selection:     #C9D3E5;
  --ink-cite:      #0E1F3A;   /* IRC §, Schedule C refs, code, anything cited */

  /* Aliases kept for compatibility during migration. New code should use the
     federal/flag names directly. */
  --terra:        var(--federal);
  --terra-deep:   var(--federal-deep);
  --terra-tint:   var(--federal-tint);
  --terra-soft:   rgba(27, 58, 107, 0.35);

  /* --- Type --- */
  --serif: 'Source Serif 4', 'Iowan Old Style', Charter, 'Sitka Text', Cambria, Georgia, serif;
  --mono:  'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale, four sizes, no exceptions.
     Hero: h1, success-card glyphs, any "shout" type.
     Lede: h2, brand wordmark, secondary headings, large emphasis text.
     Body: paragraphs, default reading text, mono body, scoreboard values.
     UI:   mono caps, labels, badges, metadata, micro disclaimers. */
  --fs-hero: 32px;
  --fs-lede: 22px;
  --fs-body: 17px;
  --fs-ui:   12px;

  --lh-body:  1.65;
  --lh-lede:  1.5;
  --lh-hero:  1.15;

  /* --- Spacing (8px grid) --- */
  --s0: 4px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 72px;
  --s7: 104px;

  /* --- Borders + shadows (hard rectangles only) ---
     Shadows are federal-deep, not ink. Solid navy shadow on ivory paper is
     the visual idiom of every Treasury form ever printed. */
  --bd:          1.5px solid var(--ink);
  --bd-soft:     1px solid var(--paper-edge);
  --bd-mute:     1px solid var(--mute);
  --shadow-hard: 4px 4px 0 var(--federal-deep);
  --shadow-soft: 2px 2px 0 var(--federal-deep);
  --shadow-live: 6px 6px 0 var(--flag);  /* reserved for the single primary CTA on a page */

  /* --- Motion (sub-100ms, compositor-friendly properties only) --- */
  --dur:  80ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* --- Layout --- */
  --content-max: 640px;
  --gutter:      24px;
}

@media (min-width: 640px) {
  :root {
    --fs-hero: 44px;
    --fs-body: 18px;
    --gutter:  40px;
  }
}
