/* ==========================================================================
   Syphers — Design Tokens
   Single source of truth for every colour, size, space and timing value.
   Values are measured from reference/Initial_Page_Idea.jpeg (853px wide),
   interpreted at the standard 1440px desktop artboard (scale ×1.688).
   Logo values come from reference/Logo_Specification.png.
   Rationale for each decision: docs/design-system.md
   Components must reference these tokens, never raw values.
   ========================================================================== */

:root {
  /* ======================================================================
     COLOUR
     ====================================================================== */

  /* ---------- Brand palette (raw values — use semantic roles below) ----- */
  /* Deep Charcoal — official logo colour; also headings, buttons, dark bands
     so the interface matches the logo. */
  --charcoal-950: #1a1823;   /* pressed/active                          */
  --charcoal-900: #242230;   /* LOGO "Deep Charcoal" — 15.6:1 on white   */
  --charcoal-700: #3a3747;   /* hover — white text 11.6:1               */

  --teal-500: #15a0a6;   /* logo dot 1, gradient start, service icons     */
  --teal-700: #0e7c81;   /* teal that passes AA as small text on white    */
  --blue-500: #2b6bea;   /* logo dot 2, gradient mid, links, active nav   */
  --blue-700: #1f55c4;
  --violet-500: #6162f6; /* logo dot 3, gradient end, service icons       */
  --violet-700: #4a4bd6;

  --gray-0: #ffffff;
  --gray-50: #f8fafd;    /* alternate section background (approach panel) */
  --gray-100: #eef1f6;   /* hairline dividers between service columns     */
  --gray-200: #dfe3ec;
  --gray-400: #8a93a6;   /* form-control borders — 3.1:1 on white (WCAG 1.4.11) */
  --gray-500: #5b6475;   /* muted text — 6.0:1 on white                  */
  --gray-700: #3d4556;   /* body text — 9.6:1 on white                   */

  /* ---------- Semantic roles ------------------------------------------- */
  --color-logo: var(--charcoal-900); /* 15.6:1 on white */

  --color-primary: var(--charcoal-900);
  --color-primary-dark: var(--charcoal-950);
  --color-primary-light: var(--charcoal-700);
  --color-on-primary: var(--gray-0);

  --color-secondary: var(--blue-500);
  --color-secondary-dark: var(--blue-700);

  --color-accent: var(--teal-500);
  --color-accent-alt: var(--violet-500);
  --color-accent-teal: var(--teal-500);
  --color-accent-blue: var(--blue-500);
  --color-accent-violet: var(--violet-500);
  --gradient-brand: linear-gradient(90deg, var(--teal-500) 0%, var(--blue-500) 55%, var(--violet-500) 100%);

  --color-text-primary: var(--charcoal-900);
  --color-text-secondary: var(--gray-700);
  --color-text-muted: var(--gray-500);
  --color-text-inverse: var(--gray-0);
  --color-text-inverse-muted: #c5cde0;
  --color-link: var(--blue-700);
  --color-link-hover: var(--charcoal-900);

  --color-background: var(--gray-0);
  --color-background-alt: var(--gray-50);
  --color-background-dark: var(--charcoal-900);
  --color-overlay: rgba(26, 24, 35, 0.72);      /* image overlays: text side */
  --color-overlay-soft: rgba(26, 24, 35, 0.45); /* image overlays: far side  */

  --color-border: var(--gray-100);
  --color-border-strong: var(--gray-200);
  --color-border-control: var(--gray-400); /* inputs: must stay ≥ 3:1 */
  --color-border-inverse: rgba(255, 255, 255, 0.2);

  --color-focus: var(--blue-500);
  --color-success: #1b7a43;  /* 5.4:1 on white */
  --color-error: #c62828;    /* 5.6:1 on white */

  /* ======================================================================
     TYPOGRAPHY
     ====================================================================== */

  /* ---------- Brand font: Plus Jakarta Sans ------------------------------
     Per the logo specification, the wordmark is matched to Plus Jakarta
     Sans ExtraBold (800); the site uses the same family. The logo itself
     may use custom letterforms, so it is NEVER typeset — always use the
     official logo file. To change the family globally:
       1. change --font-family-brand below
       2. change font.stylesheet in site.config.json (or self-host in assets/fonts/)
       3. run: node build/build.js
     No other file references the font name. */
  --font-family-brand: "Plus Jakarta Sans";
  --font-family-base: var(--font-family-brand), "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-heading: var(--font-family-base);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;  /* logo weight */

  --font-weight-body: var(--font-weight-regular);
  --font-weight-display: var(--font-weight-extrabold); /* "Secure. Build. Transform." */
  --font-weight-h1: var(--font-weight-extrabold);
  --font-weight-h2: var(--font-weight-bold);
  --font-weight-h3: var(--font-weight-semibold);       /* card titles */
  --font-weight-h4: var(--font-weight-semibold);

  /* Sizes: fluid between 375px and 1440px viewports; desktop values measured
     from the reference at 1440px, mobile values chosen for readability. */
  --font-size-display: clamp(2.5rem, 1.796rem + 3.005vw, 4.5rem);    /* 40 → 72 */
  --font-size-h1: clamp(2.125rem, 1.729rem + 1.69vw, 3.25rem);       /* 34 → 52 */
  --font-size-h2: clamp(1.875rem, 1.567rem + 1.315vw, 2.75rem);      /* 30 → 44 */
  --font-size-h3: clamp(1.1875rem, 1.122rem + 0.282vw, 1.375rem);    /* 19 → 22 */
  --font-size-h4: clamp(1.125rem, 1.081rem + 0.188vw, 1.25rem);      /* 18 → 20 */
  --font-size-h5: clamp(1.0625rem, 1.041rem + 0.094vw, 1.125rem);    /* 17 → 18 */
  --font-size-lead: clamp(1.125rem, 1.081rem + 0.188vw, 1.25rem);    /* 18 → 20 */
  --font-size-body: clamp(1rem, 0.978rem + 0.094vw, 1.0625rem);     /* 16 → 17 (readability) */
  --font-size-small: 0.9375rem;                                      /* 15 */
  --font-size-caption: 0.875rem;                                     /* 14 */
  --font-size-label: 0.8125rem;                                      /* 13 — eyebrows */
  --font-size-nav: clamp(0.9375rem, 0.784rem + 0.24vw, 1rem);        /* 15 @1024 → 16 @1440 */
  --font-size-button: 1rem;                                          /* 16 */

  --line-height-display: 1.02;
  --line-height-heading: 1.15;
  --line-height-snug: 1.35;
  --line-height-lead: 1.5;
  --line-height-body: 1.6;
  --line-height-small: 1.6;
  --line-height-none: 1;

  --letter-spacing-display: -0.025em;
  --letter-spacing-heading: -0.015em;
  --letter-spacing-label: 0.16em;

  /* ======================================================================
     SPACING — 4px base; steps match gaps measured in the reference
     ====================================================================== */
  --space-0: 0;
  --space-1: 0.25rem;  /*   4 */
  --space-2: 0.5rem;   /*   8  icon ↔ text inside buttons            */
  --space-3: 0.75rem;  /*  12  card title ↔ description              */
  --space-4: 1rem;     /*  16  eyebrow ↔ heading (measured 20)        */
  --space-5: 1.5rem;   /*  24  heading ↔ paragraph (measured 27)      */
  --space-6: 2rem;     /*  32  button ↔ button (measured 29)          */
  --space-7: 2.5rem;   /*  40  paragraph ↔ buttons (37); header ↔ content (42) */
  --space-8: 3rem;     /*  48                                          */
  --space-9: 4rem;     /*  64                                          */
  --space-10: 5rem;    /*  80                                          */
  --space-11: 6rem;    /*  96                                          */

  /* ======================================================================
     LAYOUT — 1440px artboard: 1280 content + 2 × 80 margins
     ====================================================================== */
  --container-max: 80rem;       /* 1280 — content width (measured ≈1305) */
  --container-narrow: 45rem;    /*  720 — long-form reading (~70 characters) */
  --container-padding: clamp(1.25rem, 5.5vw, 5rem); /* 20 → 80 */

  /* Generous vertical rhythm (homepage review: less density, more whitespace) */
  --section-padding-mobile: 3.5rem;                                           /* 56 */
  --section-padding: clamp(var(--section-padding-mobile), 2.62rem + 3.756vw, 6rem); /* 56 → 96 */
  --section-padding-lg: clamp(4.5rem, 3.444rem + 4.507vw, 7.5rem);            /* 72 → 120 */
  --section-header-gap: clamp(2.5rem, 2.06rem + 1.878vw, 3.75rem);            /* 40 → 60: header ↔ content */

  --header-height: 4.5rem;      /* 72 mobile; 96 desktop (responsive.css) */
  --header-height-lg: 6rem;     /* measured 57 × 1.688 */
  --nav-item-gap: clamp(1rem, -2.692rem + 5.769vw, 2.5rem); /* 16 @1024 → 40 @1440 (measured) */

  --z-header: 100;
  --z-overlay: 200;
  --z-skip-link: 300;

  /* ---------- Logo lockup --------------------------------------------------
     Official wordmark (assets/logo/syphers-logo.svg, 3.446 : 1) + tagline.
     --logo-height is the WORDMARK height; tagline, dots and gaps are
     proportions of it (components.css). Header wordmark matches the
     reference (≈142px wide at 1440): 40px tall → 138 × 40, lockup ≈ 220 × 66. */
  --logo-height: 2rem;                  /* 32 — mobile/tablet: lockup ≈ 176 × 53 */
  --logo-height-lg: clamp(2rem, 0.769rem + 1.923vw, 2.5rem); /* 32 @1024 → 40 @1440 */

  /* ======================================================================
     BORDERS, RADIUS, SHADOW
     ====================================================================== */
  --border-width: 1px;
  --border-width-thick: 2px;
  --accent-bar-width: 3.5rem;   /* 56 — coloured bar under industry titles */
  --accent-bar-height: 4px;

  --radius-sm: 0.25rem;         /*  4 — inputs, small elements */
  --radius-button: 0.375rem;    /*  6 — measured on hero/CTA buttons */
  --radius-card: 0.5rem;        /*  8 — boxed cards, card images */
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(36, 34, 48, 0.06);
  --shadow-md: 0 10px 30px rgba(36, 34, 48, 0.08);

  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* ======================================================================
     COMPONENT SIZING
     ====================================================================== */
  --button-height: 3.25rem;       /* 52 — measured hero/CTA buttons (136×31 → 230×52) */
  --button-height-sm: 3rem;       /* 48 — measured header CTA (82×29 → 138×49) */
  --button-padding-x: 2rem;       /* 32 */
  --button-padding-x-sm: 1.5rem;  /* 24 */
  --input-height: 3.25rem;

  /* ======================================================================
     ICONS & MEDIA
     ====================================================================== */
  --icon-size-sm: 1rem;         /* 16 — inline, social */
  --icon-size-md: 1.5rem;       /* 24 — lists, UI */
  --icon-size-lg: 3rem;         /* 48 — service / industry icons (measured 40–52) */
  --icon-stroke-width: 1.5;     /* on a 24×24 viewBox */

  --ratio-landscape: 16 / 9;
  --ratio-card: 3 / 2;
  --ratio-thumb: 4 / 3;
  --ratio-square: 1 / 1;
  --ratio-portrait: 4 / 5;      /* founder photos */

  /* ======================================================================
     MOTION
     ====================================================================== */
  --transition-duration-fast: 150ms;
  --transition-duration: 200ms;
  --transition-duration-slow: 300ms;
  --transition-duration-reveal: 600ms;   /* scroll reveal (components.js) */
  --reveal-distance: 1rem;
  --transition-easing: cubic-bezier(0.2, 0, 0, 1);
}

/* Breakpoints — CSS custom properties cannot be used inside @media.
   Keep these in sync with css/responsive.css and js/navigation.js.
     tablet         48em   768px
     desktop        64em  1024px
     large desktop  90em  1440px  (design artboard — tokens reach their maximums) */

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration-fast: 0ms;
    --transition-duration: 0ms;
    --transition-duration-slow: 0ms;
    --transition-duration-reveal: 0ms;
  }
}
