/* Reach Us proposal design tokens. Shared by every client proposal page
   (rate-card, virtual-office, storyspace-* and anything new).
   Direction: "Live Editorial Ledger". Read proposals/DESIGN-LANGUAGE.md first.

   Rules
   - Tokens only. No selectors that style components live here, except the
     brand scopes at the bottom (they only re-point semantic tokens).
   - Components use the SEMANTIC tokens (--color-*, --text-*, --space-*, ...),
     never the primitives (--navy-950, --gold-400, ...).
   - Light only. Proposals are business documents with dark bands; no auto dark mode.
   - Contrast ratios in comments were computed with the WCAG 2 formula (25 Nov 2026).
   - Fonts: the @font-face rules (self-hosted, base64 inlined by the build) live in
     proposals/fonts/fonts.css, not here. The stacks below fall back cleanly if they
     are missing. */

@layer tokens {
  :root {
    color-scheme: light;

    /* ------------------------------------------------------------ primitives */
    /* Reach Us navy (Business Hub / Solutions) */
    --navy-950: #0A1630;   /* cover band, pay panel. white on it 17.9:1 */
    --navy-900: #0E2244;   /* same navy the virtual-office page uses */
    --navy-800: #1A3463;   /* interactive accent on light. 12.2:1 on white */
    --navy-600: #3A5487;
    --navy-100: #E3EAF6;
    --navy-50:  #EEF3FB;   /* selected tint. ink-2 on it 7.07:1 */

    /* Cool neutrals (Hub / Solutions pages) */
    --slate-0:   #FFFFFF;
    --slate-25:  #F5F7FA;  /* page paper */
    --slate-50:  #EEF1F5;
    --slate-100: #DCE2EB;  /* hairline */
    --slate-300: #B4BECC;
    --slate-500: #7A869A;  /* control borders (UI 3.68:1 on white) */
    --slate-600: #667085;  /* tertiary text, 4.97:1 on white, 4.64:1 on paper */
    --slate-700: #475266;  /* secondary text, 7.87:1 on white */
    --slate-900: #121A2B;  /* ink, 17.4:1 on white */

    /* Logo gold */
    --gold-300: #F2C25B;   /* focus ring on dark bands, 10.8:1 on navy-950 */
    --gold-400: #E2B24C;   /* gold on dark: text 9.15:1 on navy-950, buttons */
    --gold-500: #C9973A;   /* decoration only (rules, dots). never text on light */
    --gold-700: #7F5410;   /* gold text on light, 6.61:1 on white */
    --gold-50:  #FBF4E4;   /* "Our pick" chip fill. gold-700 on it 6.03:1 */

    /* The Story Space: warm studio charcoal + warm paper (matches the Leobiss proposal) */
    --studio-950: #161514; /* band. gold-400 on it 9.30:1, #C9C1B2 on it 10.2:1 */
    --studio-800: #2A2724;
    --studio-paper: #F7F5F0;
    --studio-100: #E3DDD2; /* warm hairline */
    --studio-50:  #F4EEE2; /* warm selected tint */
    --studio-700: #5C5852; /* warm secondary text, 6.48:1 on studio-paper */
    --studio-on-dark-2: #C9C1B2;

    /* Status */
    --green-700: #1D6A45;  /* 6.56:1 on white, 5.80:1 on green-50 */
    --green-50:  #E7F4EC;
    --amber-800: #8A3B00;  /* 7.01:1 on amber-50 */
    --amber-50:  #FFF1E6;
    --amber-200: #F2C9A6;
    --red-700:   #B42318;
    --blue-600:  #2F6FDF;  /* focus ring on light, 4.71:1 on white */
    --green-600: #128C4A;  /* WhatsApp glyph only (icon, 4.31:1 on white). Named by colour so no page carries the word in its CSS */

    /* ------------------------------------------------------------ semantic: colour */
    --color-paper: var(--slate-25);          /* page background */
    --color-sheet: var(--slate-0);           /* cards, ledger, receipt */
    --color-sheet-sunk: var(--slate-50);     /* card headers, hover rows, steppers */
    --color-rule: var(--slate-100);          /* 1px hairlines everywhere */
    --color-rule-strong: var(--slate-300);   /* receipt sum rule, dashed empty box */
    --color-control: var(--slate-500);       /* unchecked checkbox / radio border */

    --color-text: var(--slate-900);
    --color-text-2: var(--slate-700);        /* descriptions, units, labels */
    --color-text-3: var(--slate-600);        /* tertiary only, on sheet/paper only (4.39:1 on sheet-sunk: fails). never for prices */

    --color-accent: var(--navy-800);         /* the ONE interactive accent on light */
    --color-accent-strong: var(--navy-950);  /* checkbox fill, primary button */
    --color-on-accent: #FFFFFF;
    --color-selected: var(--navy-50);        /* ticked row, chosen package, Due-now row */

    --color-signature: var(--gold-500);      /* hairline under the cover band, pick dot */
    --color-signature-text: var(--gold-700); /* gold words on light (Our pick, step timing) */
    --color-signature-tint: var(--gold-50);

    --color-band: var(--navy-950);           /* cover band + pay panel */
    --color-on-band: #FFFFFF;
    --color-on-band-2: #B9C6DD;              /* 10.4:1 on navy-950 */
    --color-on-band-3: #8E9BB4;              /* 6.41:1, small meta only */
    --color-on-band-accent: var(--gold-400);
    --color-band-line: rgba(255, 255, 255, 0.14);
    --color-band-fill: rgba(255, 255, 255, 0.06);

    --color-ok: var(--green-700);
    --color-ok-bg: var(--green-50);
    --color-warn: var(--amber-800);
    --color-warn-bg: var(--amber-50);
    --color-warn-line: var(--amber-200);
    --color-danger: var(--red-700);
    --color-focus: var(--blue-600);
    --color-focus-on-band: var(--gold-300);

    /* Brand marks used inside a mixed (two-brand) page */
    --color-brand-rus: var(--navy-950);
    --color-brand-tss: var(--studio-950);
    --color-brand-tss-accent: var(--gold-400);

    /* ------------------------------------------------------------ semantic: type */
    --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;

    /* Scale (Inter unless noted). 1.2 minor third on phones, opens up on desktop. */
    --text-2xs: 0.75rem;                              /* 12px  eyebrow caps only */
    --text-xs: 0.8125rem;                             /* 13px  chips, step timing, sticky-bar labels */
    --text-sm: 0.875rem;                              /* 14px  units, hints, payee */
    --text-base: 1rem;                                /* 16px  body, scope lists */
    --text-md: 1.0625rem;                             /* 17px  row titles, receipt lines (desktop) */
    --text-lg: 1.25rem;                               /* 20px  card titles, amounts in rows */
    --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);   /* 24-30  section h2 (display) */
    --text-2xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.25rem);  /* 28-36  pay amount on phones, pkg price */
    --text-display: clamp(2.25rem, 1.3rem + 4.2vw, 3.75rem); /* 36-60 cover h1 (display) */
    --text-money-xl: clamp(2.25rem, 1.6rem + 2.6vw, 3rem);   /* 36-48 Due now in the pay panel */

    --leading-tight: 1.04;   /* display h1 */
    --leading-snug: 1.22;    /* h2, h3, card titles */
    --leading-body: 1.55;
    --tracking-display: -0.022em;
    --tracking-tight: -0.012em;
    --tracking-caps: 0.12em; /* eyebrow caps */

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-display: 560;   /* Newsreader instance */

    --numeric: tabular-nums lining-nums; /* every price, count, date, UTR */

    /* ------------------------------------------------------------ semantic: space (4-pt) */
    --space-1: 0.25rem;  /* 4 */
    --space-2: 0.5rem;   /* 8 */
    --space-3: 0.75rem;  /* 12 */
    --space-4: 1rem;     /* 16 */
    --space-5: 1.25rem;  /* 20 */
    --space-6: 1.5rem;   /* 24 */
    --space-8: 2rem;     /* 32 */
    --space-10: 2.5rem;  /* 40 */
    --space-12: 3rem;    /* 48 */
    --space-16: 4rem;    /* 64 */
    --space-20: 5rem;    /* 80 */
    --space-24: 6rem;    /* 96 */

    --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);            /* page side padding */
    --section-gap: clamp(3rem, 2rem + 4vw, 5.5rem);       /* between parts */
    --card-pad: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);      /* inside cards and rows */

    /* Layout */
    --page-max: 72.5rem;   /* 1160: cover band + two-column shell */
    --flow-max: 45rem;     /* 720: reading column */
    --rail-w: 21.25rem;    /* 340: live receipt rail (desktop) */
    --measure: 62ch;       /* max line length for prose */
    --bp-rail: 1080px;     /* reference only (custom properties can't drive @media) */

    /* ------------------------------------------------------------ radius */
    --radius-xs: 6px;      /* checkbox, code chip, small tags */
    --radius-sm: 10px;     /* buttons, inputs, Due-now row, QR tile */
    --radius-md: 14px;     /* cards, ledger, receipt */
    --radius-lg: 22px;     /* pay panel, rail card */
    --radius-pill: 999px;  /* chips, stepper, valid-until */

    /* ------------------------------------------------------------ elevation
       Borders first (Linear). Shadows only where something floats. */
    --shadow-0: none;
    --shadow-1: 0 1px 0 rgba(10, 22, 48, 0.04), 0 1px 2px rgba(10, 22, 48, 0.05);          /* chosen package, receipt */
    --shadow-2: 0 14px 34px -14px rgba(10, 22, 48, 0.28), 0 2px 6px rgba(10, 22, 48, 0.06); /* rail, sticky bar */
    --shadow-3: 0 30px 70px -28px rgba(10, 22, 48, 0.55);                                    /* pay panel */
    --ring-accent: 0 0 0 2px var(--color-accent);       /* chosen state without layout shift */
    --ring-focus: 0 0 0 3px var(--color-focus);

    /* Cover-band texture: hairline engineering grid, faded by a mask in the component. */
    --texture-grid:
      linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 32px 32px,
      linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 32px 32px;

    /* ------------------------------------------------------------ motion
       Personality: crisp. Durations from MOTION-RULES.md. transform/opacity only. */
    --dur-instant: 90ms;   /* press, tick fill, colour */
    --dur-fast: 160ms;     /* hover, chevron, row tint, copy -> copied */
    --dur-base: 240ms;     /* number tween, consult step enter, UTR reveal */
    --dur-slow: 420ms;     /* cover entrance (once, on load) */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
    --stagger: 50ms;

    /* ------------------------------------------------------------ layers */
    --z-rail: 10;
    --z-bar: 20;

    /* ------------------------------------------------------------ component tokens (only where reused) */
    --control-size: 1.375rem;  /* 22px checkbox / radio */
    --target-min: 2.75rem;     /* 44px touch target */
    --button-h: 3rem;          /* 48px */

    /* Added for the rate-card build (B3), 25 Nov 2026: spec values that had no token. */
    --weight-money: 650;                 /* Inter money figures (package price, Due now, rail) */
    --weight-display-italic: 480;        /* Newsreader italic instance (business name only) */
    --tracking-code: 0.04em;             /* UTR input */
    --rule-w: 1px;                       /* every hairline */
    --control-w: 1.5px;                  /* checkbox, radio, node and button outlines */
    --rule-print: 0.5pt;                 /* hairlines in the PDF */
    --radius-2xs: 3px;                   /* 10px brand chip */
    --chip-size: 0.625rem;               /* 10px brand chip square */
    --icon-sm: 1rem;                     /* 16px icon (lists, buttons inside chips) */
    --icon-md: 1.25rem;                  /* 20px icon box */
    --radio-size: 1.25rem;               /* 20px package radio */
    --check-size: 0.875rem;              /* 14px check inside a ticked box */
    --tick-col: 1.75rem;                 /* 28px ledger tick column */
    --node: 1.75rem;                     /* 28px timeline node */
    --price-col: 10.5rem;                /* aligned price column in ledger rows (>= 640px) */
    --pkg-min: 12rem;                    /* package card minimum width */
    --summary-h: 3.5rem;                 /* 56px Add more summary row */
    --pill-h: 2.25rem;                   /* 36px pill button (Copy) */
    --stepper-h: 2.5rem;                 /* 40px qty stepper button height */
    --qr-size: 12.5rem;                  /* 200px QR tile on wide screens */
    --qr-size-sm: 8rem;                  /* 128px QR tile on phones */
    --cover-overlap: var(--space-16);    /* rail overlaps the cover by 64px */
    --rise: 0.375rem;                    /* 6px rise for live inserts (consult step, UTR) */
    --rise-cover: var(--space-2);        /* 8px rise for the cover entrance */
    --opacity-disabled: 0.55;            /* expired controls */
    --dur-nudge: 180ms;                  /* phone bar nudge when an amount changes */
    --dur-flash: 600ms;                  /* rail/bar line tint flash */
    --dur-draw: 320ms;                   /* thank-you check draw */
    --blur-bar: 12px;                    /* frosted phone bar */
    --nudge: 2px;                        /* optical alignment, chip vertical padding */
    --dot: 6px;                          /* "Our pick" dot */
    --focus-w: 3px;                      /* focus ring width */
    --focus-offset: 2px;

    --color-on-band-line-strong: rgba(255, 255, 255, 0.45); /* Copy pill border on bands */
    --color-on-band-ghost: rgba(255, 255, 255, 0.6);        /* ghost button border on bands */
    --color-on-band-disabled: rgba(255, 255, 255, 0.25);    /* disabled Send button on bands */
    --color-button-gold: var(--gold-400);
    --color-button-gold-hover: var(--gold-300);
    --color-on-button-gold: #1B1407;                        /* 9.3:1 on gold-400 */
    --color-bar-frost: rgba(255, 255, 255, 0.88);           /* phone sticky bar */
    --color-glyph-green: var(--green-600);                  /* messaging glyph only */
    --color-inverse: #FFFFFF;                               /* light surface on a band (QR tile, Send button) */

    /* Masks and icons as data URIs (stroke colour only matters for the white one). */
    --mask-cover: radial-gradient(ellipse at 85% 0%, #000 0%, transparent 65%);
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --icon-check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --icon-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  }

  /* ------------------------------------------------------------ brand scopes
     Put class "brand-tss" on any element whose contents belong to The Story Space
     (the page root when the page is Story Space only, a pay panel, a receipt, a
     timeline block). Rows already carry data-brand="tss". Only re-points tokens. */
  .brand-tss,
  [data-brand="tss"] {
    --color-accent: var(--studio-950);
    --color-accent-strong: var(--studio-950);
    --color-selected: var(--studio-50);
    --color-band: var(--studio-950);
    --color-on-band-2: var(--studio-on-dark-2);
    --color-on-band-3: #A39B8E;               /* 6.63:1 on studio-950 */
    --color-signature: var(--gold-400);
  }

  /* Story Space only page: warm paper and warm hairlines everywhere. */
  .brand-tss.page,
  .page.shape-tss {
    --color-paper: var(--studio-paper);
    --color-sheet-sunk: #EFEBE3;
    --color-rule: var(--studio-100);
    --color-text-2: var(--studio-700);
    --color-band-line: rgba(255, 255, 255, 0.12);
  }

  @media print {
    :root, .brand-tss, [data-brand="tss"], .page.shape-tss {
      --color-paper: #FFFFFF;
      --color-band: #FFFFFF;
      --color-on-band: var(--slate-900);
      --color-on-band-2: var(--slate-700);
      --color-on-band-3: var(--slate-700);
      --shadow-1: none; --shadow-2: none; --shadow-3: none;
      --text-display: 26pt;
      --text-xl: 15pt;
      --text-money-xl: 18pt;
      --text-2xl: 15pt;
      --text-lg: 12pt;
      --text-md: 11pt;
      --text-base: 10.5pt;
      --text-sm: 9.5pt;
      --text-xs: 9pt;
      --text-2xs: 8pt;
      --rule-w: var(--rule-print);
      --section-gap: 18pt;
      --card-pad: 9pt;
    }
  }
}
