/* ==========================================================================
   Velstand design tokens
   Philosophy: Swiss / International Typographic, inverted to dark,
   with one signature element: the V-mark diagonal (74.3° from horizontal).
   Source: .design/velstand-site/DESIGN_BRIEF.md · docs: DESIGN_TOKENS.md

   Deviation from the design-tokens skill default: the site is DARK ONLY by
   brand decision. There is no light theme toggle; the light palette below is
   applied only for print (@media print). No prefers-color-scheme switching.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---------------------------------------------------------------- Brand */
  --brand-red:            #BF0A30;   /* flag red, from the V mark */
  --brand-navy:           #002868;   /* flag navy, from the V mark (print/light only) */
  --brand-white:          #FFFFFF;

  /* V-mark stripe colors. Navy is lifted on dark: #002868 is only 1.4:1
     against the background and disappears. */
  --v-red:                var(--brand-red);
  --v-white:              var(--brand-white);
  --v-navy:               #1E4FC4;

  /* ----------------------------------------------------------- Background */
  --color-bg-primary:     #0A0D14;   /* page: near-black, navy tint */
  --color-bg-secondary:   #111622;   /* raised panels, cards */
  --color-bg-tertiary:    #182031;   /* inputs, wells, hover surfaces */
  --color-bg-inverse:     #EEF1F6;   /* rare light blocks */

  /* ----------------------------------------------------------------- Text */
  --color-text-primary:   #EEF1F6;   /* 17.2:1 on bg-primary */
  --color-text-secondary: #A3ACBD;   /*  8.5:1 */
  --color-text-tertiary:  #7D879B;   /*  5.4:1 — placeholders, meta, still AA */
  --color-text-inverse:   #0A0D14;
  --color-text-link:      #FF4D6A;   /*  6.0:1 — lifted red for small text */
  --color-text-on-accent: #FFFFFF;   /*  6.4:1 on brand red */

  /* -------------------------------------------------------------- Borders */
  --color-border-primary:   #2A3345; /* hairline rules (decorative, Swiss grid lines) */
  --color-border-secondary: #1C2333; /* subtle dividers */
  --color-border-input:     #6A7488; /* form controls: 4.1:1 on page, 3.5:1 on input bg (≥3:1 UI boundary) */
  --color-border-focus:     #5B95FF; /*  6.7:1 */

  /* --------------------------------------------------------------- Accent */
  --color-accent-primary:        var(--brand-red); /* buttons, big shapes, stripes */
  --color-accent-primary-hover:  #D41237;          /* white text 5.3:1 */
  --color-accent-primary-active: #A00828;
  --color-accent-secondary:      #2F6BFF;          /* electric navy: glows, highlights, progress */
  --color-accent-glow:           rgb(47 107 255 / 0.35);

  /* --------------------------------------------------------------- Status */
  --color-status-success: #3DD68C;
  --color-status-warning: #FFB020;
  --color-status-error:   #FF5C6E;
  --color-status-info:    #5B95FF;

  /* Charts (thrust-sim.css). Highlight series red, comparison series neutral grey; checked with the
     dataviz validator on bg-secondary: lightness band, CVD ΔE 13.5 (deutan), contrast ≥ 3:1. The grey
     is deliberately below the chroma floor (it is the de-emphasised series, not a category). */
  --color-chart-highlight: #D41237;   /* = accent hover red; 2 px lines and dots */
  --color-chart-compare:   #7D879B;   /* = text-tertiary */
  --color-chart-grid:      var(--color-border-primary);
  --color-chart-limit:     var(--color-text-secondary); /* engine power mark */

  --color-surface-overlay: rgb(5 7 12 / 0.92);  /* mobile menu, lightbox */
  --color-surface-scrim:   linear-gradient(180deg, rgb(10 13 20 / 0) 0%, rgb(10 13 20 / 0.85) 100%); /* text over images */

  /* -------------------------------------------------------------- Spacing
     4px base (Swiss: tight, grid-driven). */
  --space-0:  0;
  --space-1:  0.25rem;  /*   4 */
  --space-2:  0.5rem;   /*   8 */
  --space-3:  0.75rem;  /*  12 */
  --space-4:  1rem;     /*  16 */
  --space-5:  1.5rem;   /*  24 */
  --space-6:  2rem;     /*  32 */
  --space-7:  3rem;     /*  48 */
  --space-8:  4rem;     /*  64 */
  --space-9:  6rem;     /*  96 */
  --space-10: 8rem;     /* 128 */
  --space-11: 12rem;    /* 192 */
  --space-12: 16rem;    /* 256 */

  /* Fluid section rhythm */
  --space-section: clamp(var(--space-8), 10vw, var(--space-11));
  --space-gutter:  clamp(var(--space-4), 3vw, var(--space-6));   /* grid gutter */
  --space-page:    clamp(var(--space-4), 5vw, var(--space-9));   /* page side margin; 16px at 375 */

  /* ----------------------------------------------------------- Typography
     Archivo (variable: wdth 62–125, wght 100–900) for display + body;
     IBM Plex Mono for specs, numbers, labels. Load via Google Fonts or self-host. */
  --font-family-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-family-body:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-family-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; /* labels, meta — not big numbers */
  --font-family-numeric: var(--font-family-display); /* spec numbers: Archivo + tabular-nums */

  --font-stretch-display: 125%;  /* expanded cut for headlines */
  --font-stretch-body:    100%;
  --font-stretch-label:   112%;

  /* Fluid scale (375 → 1440). Dramatic display/body contrast per Swiss. */
  --font-size-xs:   0.75rem;                                   /* 12 — mono labels */
  --font-size-sm:   0.875rem;                                  /* 14 */
  --font-size-base: 1.0625rem;                                 /* 17 — body */
  --font-size-md:   clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);   /* 18→21 lead */
  --font-size-lg:   clamp(1.375rem, 1.2rem + 0.75vw, 1.875rem);    /* 22→30 h3 */
  --font-size-xl:   clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem);       /* 28→44 h2 */
  --font-size-2xl:  clamp(2.25rem, 1.6rem + 2.8vw, 4.25rem);       /* 36→68 page title */
  --font-size-3xl:  clamp(3rem, 1.9rem + 4.8vw, 6.5rem);           /* 48→104 big numbers */
  --font-size-4xl:  clamp(2rem, 8.4vw, 8.75rem);                   /* 32→140 hero words: sized so the longest word ("PROTOTYPING", 11 chars expanded) fits the page width */

  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     800;   /* display */

  --line-height-tight:   0.92;  /* display, all caps */
  --line-height-snug:    1.15;  /* h2/h3 */
  --line-height-normal:  1.55;  /* body */
  --line-height-relaxed: 1.7;

  --letter-spacing-tight:  -0.02em; /* display */
  --letter-spacing-normal: 0;
  --letter-spacing-wide:   0.14em;  /* all-caps mono labels */

  /* ---------------------------------------------------------------- Layout */
  --max-width-content: 68ch;     /* reading measure */
  --max-width-wide:    1200px;
  --max-width-page:    1520px;
  --grid-columns:      12;

  /* Swiss: square corners. Radius only where touch affordance needs it. */
  --border-radius-sm:   2px;     /* inputs, tags */
  --border-radius-md:   2px;
  --border-radius-lg:   4px;
  --border-radius-full: 999px;   /* only: icon buttons, pause control */

  --border-width-hairline: 1px;
  --border-width-strong:   2px;

  /* Swiss: flat — no drop shadows. Depth comes from surface steps and glow. */
  --shadow-sm:    none;
  --shadow-md:    none;
  --shadow-lg:    0 24px 80px -24px rgb(0 0 0 / 0.6);   /* lightbox/menu only */
  --shadow-glow:  0 0 0 1px var(--color-accent-secondary), 0 0 32px -4px var(--color-accent-glow);
  --shadow-focus: 0 0 0 2px var(--color-bg-primary), 0 0 0 4px var(--color-border-focus);

  /* --------------------------------------------------- The V (signature)
     Measured from the stripe edges in Asset-2.svg: dx 108.5 / dy 385 →
     74.3° from horizontal = 15.7° off vertical. Every diagonal on the site
     uses these values so cuts, wipes and sweeps are parallel to the mark. */
  --v-angle:  74.3deg;          /* from horizontal */
  --v-lean:   15.7deg;          /* from vertical — use for skewX(calc(-1 * var(--v-lean))) */
  --v-slope:  0.281;            /* tan(15.7°): horizontal offset per unit of height */
  --v-cut:    clamp(2.5rem, 8vw, 7rem);  /* horizontal size of section/image cuts (≈ height × slope) */
  /* Stripe proportions from the mark (red : white : navy widths at the top) */
  --v-ratio-red:   2.83;
  --v-ratio-white: 1;
  --v-ratio-navy:  1.11;

  /* ---------------------------------------------------------------- Motion
     Swiss: precise, no bounce. Expo-out for arrivals, standard for UI. */
  --duration-instant: 50ms;
  --duration-fast:    150ms;   /* hover colour, focus */
  --duration-normal:  250ms;   /* UI state changes */
  --duration-slow:    450ms;   /* reveals */
  --duration-slower:  700ms;   /* stripe wipe */
  --duration-page:    300ms;   /* page transition: hard cap, never longer */
  --duration-sweep:   900ms;   /* white light-sweep across a card */
  --duration-draw:    900ms;   /* V draws in (total, 3 stripes) */
  --duration-cycle:   4500ms;  /* hero word cycle dwell */
  --stagger:          90ms;    /* between items in a reveal group */
  --stagger-stripe:   120ms;   /* between red → white → navy stripes */

  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-in:      cubic-bezier(0.55, 0, 1, 0.45);
  --easing-out:     cubic-bezier(0.16, 1, 0.3, 1);    /* expo-out: arrivals, wipes */
  --easing-in-out:  cubic-bezier(0.87, 0, 0.13, 1);   /* expo-in-out: page transition */
  /* No bounce easing — deliberately omitted (Swiss: "no playful bounce"). */

  /* --------------------------------------------------------- Breakpoints
     Reference only (custom properties can't be used inside @media).
     Mobile-first: base = 375px, then min-width queries. */
  --breakpoint-sm:  640px;
  --breakpoint-md:  960px;    /* nav collapses below this */
  --breakpoint-lg:  1280px;
  --breakpoint-xl:  1536px;

  /* ---------------------------------------------------------- Components */
  --header-height:        4.5rem;
  --header-height-compact: 3.75rem;
  --button-height:        3rem;    /* ≥44px touch target */
  --button-padding-x:     var(--space-5);
  --input-height:         3rem;
  --tap-target-min:       2.75rem; /* 44px */
  --z-header:   50;
  --z-overlay:  80;
  --z-transition: 90;
}

/* ------------------------------------------------------------------ Motion
   Reduced motion: collapse durations so CSS transitions become instant.
   JS (GSAP) must also check matchMedia('(prefers-reduced-motion: reduce)'). */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-slow:   1ms;
    --duration-slower: 1ms;
    --duration-sweep:  1ms;
    --duration-draw:   1ms;
    --stagger:         0ms;
    --stagger-stripe:  0ms;
  }
}

/* ------------------------------------------------------------------- Print
   The "light mode": ink-friendly palette for printed project/product pages. */
@media print {
  :root {
    color-scheme: light;
    --v-navy:               var(--brand-navy);
    --color-bg-primary:     #FFFFFF;
    --color-bg-secondary:   #FFFFFF;
    --color-bg-tertiary:    #F3F4F6;
    --color-bg-inverse:     #0A0D14;
    --color-text-primary:   #111111;  /* 18.9:1 */
    --color-text-secondary: #555B66;  /*  6.8:1 */
    --color-text-tertiary:  #6B7280;
    --color-text-inverse:   #FFFFFF;
    --color-text-link:      var(--brand-red);  /* 6.4:1 on white */
    --color-border-primary: #D1D5DB;
    --color-border-secondary: #E5E7EB;
    --color-border-input:   #6B7280;
    --color-accent-secondary: var(--brand-navy);
    --shadow-glow: none;
    --shadow-lg:   none;
  }
}
