/* Parliament Design System Tokens
   Generated from the approved homepage system (parliament_homepage_alt).
   Two faces (Newsreader, IBM Plex Sans), no monospace; tabular figures everywhere. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* ---------- Color Tokens ---------- */
  
  /* Neutrals */
  --ink: #1c1a17;
  --ink-2: #27241f;
  --ink-3: #332f29;
  --ink-soft: #c9c1b3;
  --paper: #e6e0d4;
  --paper-2: #d8d0c1;
  --stone: #f1eee8;
  --muted: #57514a;  /* 5.96:1 on paper, 6.76:1 on stone */
  
  /* Brand and accent */
  --bronze: #8a5a12;
  --bronze-f: #6e470d;  /* fills */
  --gold: #d9b26a;
  --gold-2: #e5c88e;
  --aegean: #23505f;
  --aegean-2: #1a4150;
  --aegean-l: #8fbcc6;
  
  /* Gain and loss (directional only) */
  --up: #2f5a3a;       /* 6.86:1 on stone */
  --down: #a0482b;     /* 5.25:1 on stone, 4.62:1 on paper */
  --up-l: #a9d6b2;     /* for dark panels */
  --down-l: #f2ae95;   /* for dark panels */
  --up-bg: #dbe7dc;    /* tint background */
  --up-ink: #1f3d27;   /* ink on tint */
  --down-bg: #f3dcd2;
  --down-ink: #7a2f18;
  --warn-bg: #f3e6c4;
  --warn-ink: #5e3d08;
  
  /* Application roles */
  --ground: var(--paper);
  --surface: var(--stone);
  --sunk: var(--paper-2);
  --line: #cfc6b6;
  --rule: #ddd5c7;
  --control: #b9ae9b;
  --text: var(--ink);
  --meta: var(--muted);
  --data: var(--bronze);          /* main chart hue */
  --theme-c: var(--bronze-f);     /* theme object color */
  --ticker-c: var(--aegean);      /* ticker object color */
  
  /* Section tones (color chapters) */
  /* Applied via .tone-* classes on page header and bar */
  
  /* ---------- Typography Tokens ---------- */
  
  /* Font families */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  
  /* Font sizes */
  --t-display: clamp(42px, 5.3vw, 82px);  /* public pages only */
  --t-h1: 32px;       /* app page title */
  --t-h2: 22px;       /* section heading */
  --t-h3: 17px;       /* panel title */
  --t-prose: 17px;    /* body text in app */
  --t-cell: 15px;     /* table cell */
  --t-meta: 14px;     /* metadata, table headers */
  --t-tick: 13px;     /* chart ticks - minimum size */
  
  /* Line heights */
  --lh-display: 1.02;
  --lh-h1: 1.1;
  --lh-h2: 1.2;
  --lh-h3: 1.3;
  --lh-prose: 1.55;
  --lh-cell: 1.4;
  
  /* ---------- Spacing Tokens ---------- */
  
  /* Base 4px scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  
  /* Layout units */
  --m: 32px;          /* page margin (16px on phone) */
  --gap: 24px;        /* grid gap (16px on phone) */
  --rail: 360px;      /* right rail width */
  --site-frame: 1586px; /* the one site container width; every page frame uses it */
  --frame: var(--site-frame);
  --read: 70ch;       /* reading measure */
  
  /* Component heights */
  --bar-h: 64px;      /* top bar height (56px on phone) */
  --ctl: 36px;        /* control height */
  --row: 44px;        /* table row height */
  
  /* ---------- Radius Tokens ---------- */
  
  --r: 8px;           /* controls, inputs, chips and table frames */
  --r-panel: 14px;    /* panels and cards */
  
  /* ---------- Motion Tokens ---------- */
  
  --ease: cubic-bezier(.16, 1, .3, 1);
  --duration-fast: 160ms;
  --duration-normal: 200ms;
}

/* ---------- Responsive Overrides ---------- */

@media (max-width: 640px) {
  :root {
    --m: 16px;
    --gap: 16px;
    --t-h1: 26px;
    --bar-h: 56px;
  }
}

/* ---------- Reduced Motion ---------- */

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

/* ---------- Base Resets ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 120px;
  background: var(--ground);
  scrollbar-color: var(--control) var(--ground);
}

body {
  margin: 0;
  font: 400 var(--t-cell)/var(--lh-cell) var(--sans);
  color: var(--text);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: .22em;
  text-decoration-thickness: 1px;
}

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--t-h1);
  line-height: var(--lh-h1);
}

h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-h2);
}

h3 {
  font: 600 var(--t-h3)/var(--lh-h3) var(--sans);
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Utility Classes ---------- */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--m);
  top: -60px;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 60;
}

.skip:focus {
  top: 12px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--meta); }

.meta {
  color: var(--meta);
  font-size: var(--t-meta);
}

/* Placeholder markers for mockup review */
.ph {
  outline: 2px dashed var(--down);
  outline-offset: 2px;
}

.ph-tag {
  display: inline-block;
  font: 600 12px/1 var(--sans);
  background: var(--down-bg);
  color: var(--down-ink);
  padding: 4px 6px;
  border-radius: var(--r);
  white-space: nowrap;
}
