/* Wellspring design tokens, v0.1 (October 2026).
   Values transcribed from docs/design/system/wellspring-design-system.html.
   Set data-theme="light|dark" and data-text="standard|large|xl" on <html> from the
   person's profile, server-side, so the first paint is right. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-next-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-hyperlegible-mono-latin.woff2') format('woff2');
}

:root {
  /* Surfaces, lines and text */
  --ws-bg: #F2F5F6;
  --ws-surface: #FFFFFF;
  --ws-sunken: #E6ECEE;
  --ws-raised: #FFFFFF;
  --ws-ink: #10212B;
  --ws-ink-2: #3E4F59;
  --ws-ink-3: #56666F;
  --ws-line: #D2DBDF;
  --ws-line-2: #788A94;

  /* Brand: Crimson (brand surfaces), Sky (everything you press), Sandstone (attention) */
  --ws-deep: #900028;
  --ws-deep-2: #A3163D;
  --ws-on-deep: #FBF1EC;
  --ws-on-deep-2: #E2C197;
  --ws-accent: #255F83;
  --ws-accent-hover: #1D4C69;
  --ws-accent-tint: #E2EFF8;
  --ws-accent-ink: #225777;
  --ws-on-accent: #FFFFFF;
  --ws-lamp: #E2C197;
  --ws-lamp-tint: #F6ECDF;

  /* Focus: 3 px Ink ring with a soft Sandstone halo */
  --ws-focus: #10212B;
  --ws-halo: rgba(226, 193, 151, .75);

  /* Semantic states: text, fill, line. Always with an icon and a word. */
  --ws-ok: #1D6A3A;      --ws-ok-bg: #E1F1E6;   --ws-ok-line: #82BE98;
  --ws-warn: #764700;    --ws-warn-bg: #FFEFCF; --ws-warn-line: #DDA94F;
  --ws-bad: #A01F18;     --ws-bad-bg: #FBE4E1;  --ws-bad-line: #E0978E; --ws-bad-solid: #B42318;
  --ws-info: #1C4B8A;    --ws-info-bg: #E2EAF7; --ws-info-line: #93AEDA;
  --ws-neu: #3E4F59;     --ws-neu-bg: #E6ECEE;  --ws-neu-line: #B6C3C9;

  /* Confidentiality tiers: name + icon + 1–4 level marks + deepening fill. Confidential is the only solid badge. */
  --ws-tier-public: #1E5A44;  --ws-tier-public-bg: #E2F0E9;
  --ws-tier-cong: #21508D;    --ws-tier-cong-bg: #E1EAF7;
  --ws-tier-council: #77440F; --ws-tier-council-bg: #F5E6D0;
  --ws-tier-conf: #FFFFFF;    --ws-tier-conf-bg: #3D1E4C;

  /* Single-job roles */
  --ws-rest: #33406A; --ws-rest-bg: #E5E9F3;
  --ws-redact-a: #10212B; --ws-redact-b: #34444E; /* stripes at 135°, same in both themes */

  /* Church year thread (4 px, always named beside it) */
  --ws-cy-advent: #3C4196;
  --ws-cy-gold: #B8861E;   /* Christmas, Easter */
  --ws-cy-green: #2E7A4C;  /* after Epiphany, after Pentecost */
  --ws-cy-lent: #5E2D72;
  --ws-cy-red: #B3302A;    /* Pentecost */

  /* Chart series, fixed order; never status or brand colours */
  --ws-c1: #2B76AE; --ws-c2: #B57208; --ws-c3: #8E4DB5; --ws-c4: #2D8C66;

  /* Elevation */
  --ws-sh1: 0 1px 2px rgba(16, 33, 43, .07), 0 1px 3px rgba(16, 33, 43, .06);
  --ws-sh2: 0 6px 16px rgba(16, 33, 43, .10), 0 2px 4px rgba(16, 33, 43, .06);
  --ws-sh3: 0 18px 44px rgba(16, 33, 43, .20);

  /* Type: body sizes grow ×1.18 / ×1.41, headings ×1.10 / ×1.22 */
  --ws-font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ws-mono: 'Atkinson Hyperlegible Mono', ui-monospace, Menlo, Consolas, monospace;
  --ws-scale: 1;
  --ws-scale-h: 1;
  --ws-text-display: calc(3rem * var(--ws-scale-h));     /* 48/52 · 800 */
  --ws-text-h1: calc(2.125rem * var(--ws-scale-h));      /* 34/40 · 800 */
  --ws-text-h2: calc(1.75rem * var(--ws-scale-h));       /* 28/34 · 700 */
  --ws-text-h3: calc(1.375rem * var(--ws-scale));        /* 22/28 · 700 */
  --ws-text-lead: calc(1.25rem * var(--ws-scale));       /* 20/30 · 400 */
  --ws-text-body: calc(1.0625rem * var(--ws-scale));     /* 17/26 · 400 */
  --ws-text-small: calc(0.9375rem * var(--ws-scale));    /* 15/22 · 400 */
  --ws-text-label: calc(0.875rem * var(--ws-scale));     /* 14/20 · 700 */
  --ws-measure: 68ch;

  /* Space (4-based) */
  --ws-space-1: 4px;  --ws-space-2: 8px;   --ws-space-3: 12px;  --ws-space-4: 16px;
  --ws-space-5: 20px; --ws-space-6: 24px;  --ws-space-7: 32px;  --ws-space-8: 40px;
  --ws-space-9: 48px; --ws-space-10: 64px; --ws-space-11: 80px; --ws-space-12: 96px;

  /* Sizing */
  --ws-target-min: 44px; --ws-control: 48px; --ws-target-main: 56px;
  --ws-icon-inline: 16px; --ws-icon-chip: 20px; --ws-icon: 24px; --ws-icon-empty: 32px;

  /* Shape: round where you act, soft where you read */
  --ws-radius-check: 8px;
  --ws-radius-input: 12px;
  --ws-radius-card: 20px;
  --ws-radius-sheet: 28px;
  --ws-radius-pill: 999px;

  /* Motion */
  --ws-dur-quick: 120ms;
  --ws-dur-standard: 200ms;
  --ws-dur-gentle: 320ms;
  --ws-dur-ripple: 1.6s;  /* the assistant writing; nothing else loops */
  --ws-ease: cubic-bezier(.2, 0, 0, 1);
  --ws-ease-exit: cubic-bezier(.3, 0, 1, 1);

  /* Layers */
  --ws-z-page: 0; --ws-z-sticky: 100; --ws-z-nav: 200; --ws-z-menu: 300;
  --ws-z-sheet: 400; --ws-z-dialog: 500; --ws-z-toast: 600; --ws-z-skip: 700;

  /* Layout */
  --ws-content-max: 1440px;
  --ws-gutter-phone: 16px;
}

:root[data-theme="dark"] {
  --ws-bg: #0A1318;
  --ws-surface: #111D24;
  --ws-sunken: #0D171D;
  --ws-raised: #172630;
  --ws-ink: #E7EFF2;
  --ws-ink-2: #B7C5CB;
  --ws-ink-3: #9AABB2;
  --ws-line: #24343D;
  --ws-line-2: #5D707A;
  --ws-deep: #5C0A22;
  --ws-deep-2: #6E0F2B;
  --ws-accent: #60A9D6;
  --ws-accent-hover: #86BFE3;
  --ws-accent-tint: #122F45;
  --ws-accent-ink: #8CC4E8;
  --ws-on-accent: #04202B;
  --ws-lamp-tint: #33291D;
  --ws-focus: #E2C197;
  --ws-halo: rgba(226, 193, 151, .30);
  --ws-ok: #80D29C;   --ws-ok-bg: #0F2A1B;   --ws-ok-line: #2E6A45;
  --ws-warn: #F2C46E; --ws-warn-bg: #31230A; --ws-warn-line: #7A5A1E;
  --ws-bad: #FF9D93;  --ws-bad-bg: #381311;  --ws-bad-line: #8A3029; --ws-bad-solid: #E0574C;
  --ws-info: #9EBEF1; --ws-info-bg: #11223B; --ws-info-line: #36558A;
  --ws-neu: #B7C5CB;  --ws-neu-bg: #1A2830;  --ws-neu-line: #3A4B54;
  --ws-tier-public: #8FD3B4;  --ws-tier-public-bg: #0F2A20;
  --ws-tier-cong: #A3C2F2;    --ws-tier-cong-bg: #13253F;
  --ws-tier-council: #F0C68E; --ws-tier-council-bg: #33230F;
  --ws-tier-conf: #FFFFFF;    --ws-tier-conf-bg: #6A3A80;
  --ws-rest: #B9C4EA; --ws-rest-bg: #1A2140;
  --ws-cy-advent: #8E95E6; --ws-cy-gold: #E3B655; --ws-cy-green: #6CC48D; --ws-cy-lent: #B98AD0; --ws-cy-red: #F08A80;
  --ws-c1: #4F9DCC; --ws-c2: #C08420; --ws-c3: #A274C9; --ws-c4: #36A57A;
  --ws-sh1: 0 1px 2px rgba(0, 0, 0, .4);
  --ws-sh2: 0 6px 16px rgba(0, 0, 0, .45);
  --ws-sh3: 0 18px 44px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

:root[data-text="large"] { --ws-scale: 1.18; --ws-scale-h: 1.1; }
:root[data-text="xl"]    { --ws-scale: 1.41; --ws-scale-h: 1.22; }

@media (prefers-reduced-motion: reduce) {
  :root { --ws-dur-quick: 0ms; --ws-dur-standard: 0ms; --ws-dur-gentle: 0ms; }
}
