/* ==========================================================================
   Latx Technologies — Design tokens
   --------------------------------------------------------------------------
   Single source of truth for color, typography, space, radius, shadow and
   motion. Nothing here selects an element or paints anything; this file only
   declares custom properties. Values come from html/style.guide.html.

   This file loads first and has no dependencies. Every other stylesheet in the
   theme, including every block component, reads values from here by name. Add
   a token before using a value that does not have one yet — a raw hex code or
   a hard-coded pixel size anywhere else in the theme is a bug.

   Naming rules
   ------------
   1. Full words only. No abbreviations, no initials, no truncation.
   2. Raw palette values are named by what they are:      --color-brand-blue
   3. Semantic roles are named by what they do:           --color-text-muted
   4. Components consume semantic roles, never raw palette values, so a color
      can be re-pointed in exactly one place.
   5. Size steps read as words: 3x-small, 2x-small, x-small, small, medium,
      large, x-large, 2x-large, 3x-large.

   The .theme-inverse scope at the bottom re-points the same semantic roles for
   dark sections (hero, call-to-action band, footer).
   ========================================================================== */

:root {
  /* ------------------------------------------------------------- 1. Palette */

  --color-brand-blue: #2e6bf6;
  --color-brand-azure: #2f8cff;
  --color-brand-indigo: #4f46e5;
  --color-brand-violet: #7c3aed;
  --color-brand-purple: #6d28d9;

  /* Darkened brand tones for text on light backgrounds, where the raw brand
     blue would fall below the 4.5:1 contrast requirement. */
  --color-brand-blue-dark: #1e52d6;
  --color-brand-violet-dark: #5b21b6;

  /* Lightened brand tones for the reverse: text and marks on the dark ink
     ground, where the raw brand blue is too dim to read. */
  --color-brand-blue-light: #6ba9ff;
  --color-brand-violet-light: #a78bfa;

  --color-ink-900: #080c1a;
  --color-ink-800: #0d1426;
  --color-ink-700: #161f38;
  --color-ink-600: #24304f;

  --color-slate-600: #3d465c;
  --color-slate-500: #475069;
  --color-slate-400: #5f677c; /* darkened from the guide's #6b7385 for contrast */
  --color-slate-300: #9aa3b5;
  --color-slate-200: #d6dbe6;
  --color-slate-100: #eaedf3;
  --color-slate-050: #f2f4f9;

  --color-mist: #f5f7fb;
  --color-white: #ffffff;
  --color-black: #000000;

  /* The one dark surface that sits above the ink gradient rather than in it:
     the browser mockup's body and the header submenu panel. */
  --color-surface-dark-raised: #0f1730;

  --color-success: #15803d;
  --color-warning: #b45309;
  --color-error: #b91c1c;

  /* A tick, a cross or a status dot on the dark ground. The 4.5:1 success
     green and error red both read as almost black against the ink gradient,
     so the reverse gets its own pair. */
  --color-success-bright: #4ade80;
  --color-error-bright: #fca5a5;

  --color-success-soft: #e7f6ec;
  --color-error-soft: #fdeaea;

  /* ----------------------------------------------------------- 2. Gradients */

  --gradient-brand: linear-gradient(120deg, #1e6bff 0%, #4f52ec 48%, #7c3aed 100%);
  --gradient-soft: linear-gradient(120deg, #eaf1ff 0%, #f1ecff 100%);
  --gradient-ink: linear-gradient(160deg, #0a1128 0%, #070b1a 60%, #0b0720 100%);
  --gradient-rule: linear-gradient(90deg, #2f8cff, #7c3aed);

  /* The brand gradient, lightened for the dark ground. Used on the wordmark's
     final character and on the phrase picked out in the hero headline. */
  --gradient-brand-on-dark: linear-gradient(
    135deg,
    var(--color-brand-blue-light) 0%,
    var(--color-brand-violet-light) 100%
  );

  /* ---------------------------------------------------- 3. Semantic color */

  --color-background: var(--color-mist);
  --color-background-raised: var(--color-white);
  --color-background-sunken: var(--color-slate-050);
  --color-background-accent-soft: #e8f0ff;

  --color-text: var(--color-ink-800);
  --color-text-strong: var(--color-ink-900);
  --color-text-muted: var(--color-slate-500);
  --color-text-subtle: var(--color-slate-400);
  --color-text-on-brand: var(--color-white);

  --color-border: var(--color-slate-200);
  --color-border-subtle: var(--color-slate-100);
  --color-border-strong: var(--color-slate-300);

  --color-accent: var(--color-brand-blue);
  --color-accent-text: var(--color-brand-blue-dark);
  --color-accent-hover: var(--color-brand-indigo);

  --color-focus: #1e52d6;
  --focus-ring: 0 0 0 3px var(--color-background), 0 0 0 6px var(--color-focus);

  /* ------------------------------------------------------- 4. Typography */

  --font-family-display: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-family-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-family-monospace: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid scale: minimum at a 360px viewport, maximum at 1280px. */
  --font-size-overline: 0.75rem;   /* 12px */
  --font-size-small: 0.875rem;     /* 14px */
  --font-size-body: 1rem;          /* 16px */
  --font-size-body-large: clamp(1.0625rem, 0.99rem + 0.33vw, 1.1875rem);
  --font-size-heading-4: clamp(1.125rem, 1.06rem + 0.28vw, 1.25rem);
  --font-size-heading-3: clamp(1.25rem, 1.09rem + 0.7vw, 1.625rem);
  --font-size-heading-2: clamp(1.625rem, 1.25rem + 1.6vw, 2.125rem);
  --font-size-heading-1: clamp(2rem, 1.36rem + 2.8vw, 3.25rem);
  --font-size-display: clamp(2.5rem, 1.5rem + 4.4vw, 4.5rem);

  --line-height-tight: 1.1;
  --line-height-heading: 1.2;
  --line-height-body: 1.65;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-heading: -0.01em;
  --letter-spacing-overline: 0.22em;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --max-text-width: 65ch;
  --max-text-width-short: 46ch;

  /* ------------------------------------------------------------- 5. Space */

  --space-3x-small: 0.25rem;  /*  4px */
  --space-2x-small: 0.5rem;   /*  8px */
  --space-x-small: 0.75rem;   /* 12px */
  --space-small: 1rem;        /* 16px */
  --space-medium: 1.5rem;     /* 24px */
  --space-large: 2rem;        /* 32px */
  --space-x-large: 3rem;      /* 48px */
  --space-2x-large: 4rem;     /* 64px */
  --space-3x-large: 6rem;     /* 96px */

  /* Rhythm between page sections. Fluid so mobile does not feel cavernous. */
  --space-section: clamp(3.5rem, 2rem + 6vw, 6.5rem);

  /* -------------------------------------------------------- 6. Dimensions */

  --container-max-width: 75rem;         /* 1200px */
  --container-narrow-max-width: 46rem;  /*  736px */
  --container-gutter: clamp(1.25rem, 0.85rem + 1.7vw, 2rem);
  --header-height: 4.5rem;
  --minimum-target-size: 2.75rem;       /* 44px — WCAG 2.2 target size floor */

  /* Breakpoints, declared here so the CSS and the per-device visibility
     controls in the block editor agree on where each device starts:
     mobile below 40rem, tablet 40rem to 61.9375rem, desktop 62rem and up. */
  --breakpoint-tablet: 40rem;           /* 640px */
  --breakpoint-desktop: 62rem;          /* 992px */

  /* ------------------------------------------------------------ 7. Radius */

  --radius-x-small: 0.375rem;
  --radius-small: 0.625rem;
  --radius-medium: 0.75rem;
  --radius-large: 1rem;
  --radius-x-large: 1.5rem;
  --radius-pill: 999px;

  /* ------------------------------------------------------------ 8. Shadow */

  --shadow-small: 0 1px 2px rgb(8 12 26 / 6%), 0 1px 3px rgb(8 12 26 / 5%);
  --shadow-medium: 0 8px 24px rgb(8 12 26 / 8%);
  --shadow-large: 0 24px 60px rgb(16 24 64 / 16%);
  --shadow-brand: 0 8px 20px rgb(59 72 220 / 28%);
  --shadow-brand-hover: 0 12px 26px rgb(59 72 220 / 36%);

  /* ------------------------------------------------------------ 9. Motion */

  --duration-fast: 140ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;
  --easing-out: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* --------------------------------------------------------- 10. Z-index */

  --z-index-base: 1;
  --z-index-sticky: 100;
  --z-index-header: 200;
  --z-index-drawer: 300;
  --z-index-skip-link: 400;
}

/* ==========================================================================
   Inverse theme — dark sections inside a light page
   --------------------------------------------------------------------------
   Applied to the hero, the call-to-action band and the footer. It re-points
   the semantic roles, so every component nested inside renders correctly
   without a single component-level override.
   ========================================================================== */

.theme-inverse {
  --color-background: #0a1128;
  --color-background-raised: rgb(255 255 255 / 5%);
  --color-background-sunken: rgb(255 255 255 / 3%);
  --color-background-accent-soft: rgb(47 140 255 / 14%);

  --color-text: #dce5f7;
  --color-text-strong: #ffffff;
  --color-text-muted: #a9b7d4;
  --color-text-subtle: #8e9dbd;

  --color-border: rgb(255 255 255 / 14%);
  --color-border-subtle: rgb(255 255 255 / 9%);
  --color-border-strong: rgb(255 255 255 / 24%);

  --color-accent: var(--color-brand-azure);
  --color-accent-text: #9dc4ff;

  --color-focus: #ffffff;
  --focus-ring: 0 0 0 3px #0a1128, 0 0 0 6px #ffffff;

  color: var(--color-text);
  background-color: var(--color-background);
}
