/* WREN ADVISORY tokens: the single source of truth. Re-skin here first.
   Family: marginalia. Legal-pad ivory, ruled baselines, navy ink,
   marker-orange highlight sweeps, Space Mono margin annotations. */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/space-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/space-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* primitives */
  --ivory: #f7f4ec;
  --ivory-2: #f1ecdf;
  --ivory-3: #e9e2d0;
  --navy: #1a2440;
  --navy-2: #242f52;
  --navy-3: #303c66;
  --white: #ffffff;
  --marker: #c25a00;        /* deep: for ivory surfaces, AA at heading/label-bold sizes */
  --marker-bright: #ff9633; /* bright: for navy surfaces + highlight sweeps */

  /* the ruled ground: baseline pitch shared by lines and leading */
  --rule-pitch: 2rem;
  --rule-color: rgba(26, 36, 64, 0.085);
  --rule-margin: rgba(194, 90, 0, 0.35);

  /* semantic (ivory page is the default) */
  --bg: var(--ivory);
  --bg-2: var(--ivory-2);
  --fg: var(--navy);
  --muted: #5b6178;
  --line: rgba(26, 36, 64, 0.18);
  --line-strong: rgba(26, 36, 64, 0.6);
  --accent: var(--marker);
  --accent-raw: var(--marker-bright);
  --highlight: rgba(255, 150, 51, 0.42);
  --focus: #2e4a9e; /* Wren's own ring: navy pushed toward ink-blue, 7.4:1 on ivory */

  /* type */
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "Space Mono", "Courier New", monospace;
  --t-display: clamp(2.1rem, 5.2vw + 0.6rem, 4.6rem);
  --t-h1: clamp(1.9rem, 4vw + 0.5rem, 3.6rem);
  --t-h2: clamp(1.55rem, 2.6vw + 0.5rem, 2.5rem);
  --t-h3: clamp(1.25rem, 1.4vw + 0.6rem, 1.6rem);
  --t-lead: clamp(1.15rem, 1.1vw + 0.75rem, 1.4rem);
  --t-body: 1.125rem;
  --t-small: 0.9375rem;
  --t-mono: 0.75rem;
  --lh-display: 1.12;
  --lh-heading: 1.18;
  --lh-body: 1.65;
  --track-mono: 0.08em;

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section-pad: clamp(4.5rem, 11vh, 8rem);
  --gutter: clamp(1rem, 2.5vw, 1.5rem);
  --edge: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 40rem;
  --max-w: 72rem;
  --margin-col: 15rem; /* the annotation margin on wide screens */

  /* shape + depth: paper is flat; radii stay small */
  --r-1: 2px;
  --r-2: 6px;
  --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(26, 36, 64, 0.08), 0 10px 28px rgba(26, 36, 64, 0.08);

  /* motion */
  --dur-1: 150ms;
  --dur-2: 320ms;
  --dur-3: 650ms;
  --dur-4: 900ms;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-inout: cubic-bezier(0.83, 0, 0.17, 1);

  /* layers */
  --z-hud: 40;
  --z-skip: 60;
}

/* navy theme: any element with data-theme="navy" flips the semantic set */
[data-theme="navy"] {
  --bg: var(--navy);
  --bg-2: var(--navy-2);
  --fg: var(--ivory);
  --muted: #a7add0;
  --line: rgba(247, 244, 236, 0.22);
  --line-strong: rgba(247, 244, 236, 0.6);
  --accent: var(--marker-bright);
  --highlight: rgba(255, 150, 51, 0.3);
  --rule-color: rgba(247, 244, 236, 0.07);
  --focus: #8fb2ff;
}
