/* ==========================================================================
   KANAC ACCOUNTING — Design Tokens
   Single source of truth. Every other stylesheet consumes these.
   Palette, type and spacing are taken verbatim from plan.txt §02–§06.
   ========================================================================== */

:root {
  /* --- Brand colour (plan.txt §02) --------------------------------------
     Royal Purple is the primary. Rose Gold is an ACCENT — hairlines,
     eyebrows, hover states, key figures. It is never a large fill, and it is
     never a section background. Usage target is 60/25/10/5 off-white /
     purple / slate / rose. ------------------------------------------------ */
  --purple: #1a1333;       /* primary — nav, buttons, headings, dark bands */
  --purple-deep: #120c24;  /* deepest surface — footer, process band       */
  --purple-ink: #0b0819;   /* near-black — photo overlays, vignettes       */
  --purple-mid: #2a2049;   /* gradients, hover lift                        */
  --purple-soft: #4a3d75;  /* accents on dark                              */

  --slate: #2e3440;
  --slate-muted: #6b7280;

  /* Rose gold: hairlines, eyebrows, active states, key numerals. */
  --rose: #b8734a;
  --rose-soft: #c98d6a;
  --rose-bright: #d9a582;
  --rose-deep: #9c5f3b;

  --off-white: #f8f9fb;
  --off-white-deep: #eef0f5;
  --gray: #e9ecef;
  --black: #0b0b0d;
  --white: #ffffff;

  /* --- Functional -------------------------------------------------------- */
  --text: var(--slate);
  --text-strong: var(--black);
  --text-muted: var(--slate-muted);
  --text-on-dark: rgba(248, 249, 251, 0.92);
  --text-on-dark-muted: rgba(248, 249, 251, 0.6);
  --bg: var(--off-white);   /* paper ground — cards read as white ON something */

  /* Hairline rules. The rose rule is the recurring premium device; the
     neutral rule does the structural work so rose stays scarce. */
  --line: rgba(184, 115, 74, 0.26);
  --line-strong: rgba(184, 115, 74, 0.5);
  --line-neutral: rgba(26, 19, 51, 0.13);
  --line-on-dark: rgba(248, 249, 251, 0.16);

  --focus: var(--rose);

  /* --- Typography (plan.txt §03–§04) -------------------------------------
     Instrument Serif is the brand voice: display, h1, h2, pull-quotes,
     figures. Source Sans 3 carries body, nav, buttons, h3/h4, card titles
     and forms, for readability.
     IBM Plex Mono is the data layer ONLY: eyebrows, numerals, metadata.
     ---------------------------------------------------------------------- */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  --font-ui: var(--font-sans);

  /* --- Global type scale -------------------------------------------------
     THE single knob for overall text size. Every size in every stylesheet is
     expressed in rem, so changing --font-size-root rescales the entire site
     — body, headings, eyebrows, buttons, forms — in one edit. Never hardcode
     px font sizes anywhere; that would opt out of this control. */
  --font-size-root: 17.5px;   /* was the 16px browser default */

  /* Fluid scale — no breakpoint jumps. Anchored on plan.txt's mobile and
     desktop pairs (e.g. display 48 -> 72, h1 40 -> 56). */
  --fs-display: clamp(3rem, 1.85rem + 5.1vw, 4.5rem);
  --fs-h1: clamp(2.5rem, 2rem + 2.2vw, 3.5rem);
  --fs-h2: clamp(2.125rem, 1.8rem + 1.5vw, 2.75rem);
  --fs-h3: clamp(1.5rem, 1.4rem + 0.45vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --fs-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-data: clamp(0.875rem, 0.85rem + 0.1vw, 1rem);
  --fs-eyebrow: 0.75rem;

  --lh-tight: 1.04;
  --lh-heading: 1.14;
  --lh-body: 1.65;

  /* Instrument Serif ships a single weight. Headings get their authority
     from size and space, not from weight. */
  --wt-display: 400;
  --wt-h: 400;

  --ls-eyebrow: 0.18em;
  --ls-ui: 0.06em;

  /* --- Spacing — plan.txt §05: 4/8/12/16/24/32/48/64/80/120/160 ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 80px;
  --s-10: 120px;
  --s-11: 160px;

  /* Vertical rhythm. plan.txt §05 asks for 80–160px on major sections and
     is explicit that whitespace is a feature, so this runs deliberately
     more generous than a standard corporate rhythm. */
  --section-y: clamp(2.25rem, 3.5vw, 3.75rem);

  /* --- Container (plan.txt §05: 1200–1280 max, 24–32 gutters) ------------ */
  --container-max: 1240px;
  --gutter: 24px;

  --measure: 66ch;      /* prose measure */
  --measure-sm: 30ch;   /* heading measure */

  /* --- Header ------------------------------------------------------------ */
  --header-h: 88px;
  --header-h-scrolled: 68px;
  --notice-h: 40px;

  /* --- Radius (plan.txt §06) — architectural, never pill ----------------- */
  --r-btn: 3px;
  --r-input: 3px;
  --r-card: 6px;
  --r-lg: 10px;

  --shadow-soft: 0 1px 1px rgba(26, 19, 51, 0.04),
    0 8px 22px -14px rgba(26, 19, 51, 0.18);
  --shadow-card: 0 1px 2px rgba(26, 19, 51, 0.05),
    0 12px 28px -16px rgba(26, 19, 51, 0.16),
    0 40px 80px -48px rgba(26, 19, 51, 0.28);

  /* --- Motion ------------------------------------------------------------ */
  --dur-fast: 200ms;
  --dur: 320ms;
  --dur-slow: 560ms;
  --dur-reveal: 900ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Hero -------------------------------------------------------------- */
  --hero-min-h: clamp(600px, 84vh, 820px);
  --hero-overlay: linear-gradient(
    100deg,
    rgba(11, 8, 25, 0.94) 0%,
    rgba(26, 19, 51, 0.86) 44%,
    rgba(42, 32, 73, 0.52) 100%
  );

  --z-header: 80;
  --z-mobilebar: 70;
  --z-drawer: 90;
}

@media (max-width: 599px) {
  :root {
    /* Slightly tighter on small screens so the scale-up doesn't cost
       line length. Still larger than the old 16px baseline. */
    --font-size-root: 16.5px;
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

@media (min-width: 1120px) {
  :root {
    --gutter: 56px;
  }
}
