/* ==========================================================================
 * AISquare — Design Foundations
 * A standalone, framework-free stylesheet. No build step, no Tailwind,
 * no JavaScript, no dependencies.
 *
 * Contains ONLY foundations: color, typography, spacing, grid & layout,
 * corner radius, elevation/shadow, and motion.
 * Contains NO components (no buttons, cards, inputs, etc.).
 *
 * --------------------------------------------------------------------------
 * HOW TO USE
 * --------------------------------------------------------------------------
 * 1. Drop the file in and link it first, before your own stylesheet:
 *
 *      <link rel="stylesheet" href="/css/aisquare-foundations.css">
 *      <link rel="stylesheet" href="/css/site.css">
 *
 * 2. Use the tokens anywhere in your own CSS:
 *
 *      .hero      { background: var(--color-navy-900); color: #fff; }
 *      .hero h1   { font: var(--text-display); }        // shorthand, see §2
 *      .panel     { padding: var(--space-6);
 *                   border-radius: var(--radius-3);
 *                   box-shadow: var(--elevation-2); }
 *
 * 3. Two ways to name a color — both are provided for every color:
 *
 *      var(--color-navy-900)          ready-to-use, use this by default
 *      hsl(var(--navy-900) / 0.2)     raw HSL triplet, for custom opacity
 *
 *    The raw triplet has no `hsl()` around it, so `color: var(--navy-900)`
 *    will NOT work. Use `--color-*` unless you need the alpha channel.
 *
 * 4. Dark mode. Put `class="dark"` (or `data-theme="dark"`) on <html>:
 *
 *      <html class="dark">
 *
 *    To follow the operating-system setting, add this before </body>:
 *
 *      <script>
 *        const m = matchMedia('(prefers-color-scheme: dark)');
 *        const s = () => document.documentElement.classList.toggle('dark', m.matches);
 *        s(); m.addEventListener('change', s);
 *      </script>
 *
 * 5. Optional helper classes (§10) are included at the bottom — a type-scale
 *    class per step, elevation classes, and a page container. Delete that
 *    section if you only want the tokens.
 *
 * --------------------------------------------------------------------------
 * THE TWO-TIER COLOR MODEL — important
 * --------------------------------------------------------------------------
 * PRIMITIVES (§1) are absolute values: `--navy-900` is the same color in
 * light and dark mode. They are the raw palette.
 *
 * SEMANTICS (§5) describe a ROLE: `--color-bg`, `--color-text`,
 * `--color-primary`. These DO flip between light and dark mode (§9).
 *
 * Reach for a semantic token first — it is what keeps a page readable in both
 * modes. Drop to a primitive ramp step only when no semantic role fits
 * (a soft tinted fill, a hover state, a chart series).
 *
 * The one exception to "primitives don't flip": the elevation ladder (§6),
 * which is mode-aware by nature — a dark shadow on a dark surface needs more
 * weight to read at all.
 *
 * --------------------------------------------------------------------------
 * OVERRIDING
 * --------------------------------------------------------------------------
 * Redeclare any variable in your own `:root { }` AFTER this file loads and
 * yours wins. Changing `--color-primary` or `--radius` re-skins everything
 * downstream of it. Do not edit this file — override it.
 *
 * --------------------------------------------------------------------------
 * Hex values in comments are the exact rendered output of the HSL triplet
 * beside them, so you can copy them straight into a design tool.
 * ======================================================================== */


/* ==========================================================================
 * §0 · TYPEFACE
 *
 * The brand face is Inter (variable weight + optical size). It is NOT bundled
 * with this file. Pick one of the following, or skip both — the stacks in §2
 * fall back to the system UI font, which renders acceptably everywhere.
 *
 * a) Self-host (recommended: no third-party request, works offline).
 *    Download from https://rsms.me/inter/ or https://fontsource.org/fonts/inter
 *    and point these at your own files:
 *
 *      @font-face {
 *        font-family: "Inter Variable";
 *        font-style: normal;
 *        font-weight: 100 900;
 *        font-display: swap;
 *        src: url("/fonts/inter-variable.woff2") format("woff2-variations");
 *      }
 *
 * b) Google Fonts CDN. Uncomment the line below. Note this sends a request to
 *    fonts.googleapis.com on every page load, which has privacy and
 *    performance implications, and will not work offline.
 *
 *      @import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap");
 *
 * An @import must be the first rule in the file, above every other rule
 * including this comment's section — move it to the very top if you use it.
 * ======================================================================== */


:root {
  /* ========================================================================
   * §1 · COLOR PRIMITIVES — the raw palette
   *
   * Seven ramps, 50 (lightest) → 950 (darkest). Absolute: these do not change
   * between light and dark mode.
   *
   * Rough guide to picking a step:
   *   50–100   page-level tinted backgrounds, very soft fills
   *   200–300  borders, dividers, disabled surfaces
   *   400–500  the ramp's "true" color — icons, fills, chart series
   *   600–700  text on a light background (600+ generally clears AA on white)
   *   800–950  dark surfaces, high-contrast ink
   * ====================================================================== */

  /* --- Navy · brand ink -------------------------------------------------- */
  --navy-50:  213 45% 96%;   /* #F0F4F9 */
  --navy-100: 213 42% 91%;   /* #DEE7F2 */
  --navy-200: 213 38% 83%;   /* #C3D2E4 */
  --navy-300: 213 34% 71%;   /* #9CB3CE */
  --navy-400: 214 28% 56%;   /* #6F8BAE */
  --navy-500: 214 30% 42%;   /* #4B678B */
  --navy-600: 214 40% 32%;   /* #314D72 */
  --navy-700: 213 55% 24%;   /* #1C3A5F */
  --navy-800: 213 68% 18%;   /* #0F2B4D */
  --navy-900: 213 80% 13%;   /* #071E3C — BRAND NAVY, the primary ink */
  --navy-950: 214 85% 8%;    /* #031226 */

  /* --- Accent · brand action blue ---------------------------------------- */
  --accent-50:  213 100% 97%; /* #F0F7FF */
  --accent-100: 213 100% 93%; /* #DBEBFF */
  --accent-200: 213 100% 87%; /* #BDDBFF */
  --accent-300: 213 100% 78%; /* #8FC1FF */
  --accent-400: 213 100% 67%; /* #57A2FF */
  --accent-500: 213 100% 56%; /* #1F84FF — BRAND BLUE, the action color */
  --accent-600: 213 90% 48%;  /* #0C6FE9 */
  --accent-700: 213 85% 40%;  /* #0F5DBD */
  --accent-800: 213 80% 32%;  /* #104B93 */
  --accent-900: 213 78% 24%;  /* #0D386D */
  --accent-950: 213 80% 16%;  /* #082649 */

  /* --- Slate · neutral --------------------------------------------------- */
  --slate-50:  210 40% 98%;     /* #F8FAFC */
  --slate-100: 210 40% 96.1%;   /* #F1F5F9 */
  --slate-200: 214 31.8% 91.4%; /* #E2E8F0 — the default border color */
  --slate-300: 213 26.8% 83.9%; /* #CBD5E1 */
  --slate-400: 215 20.2% 65.1%; /* #94A3B8 */
  --slate-500: 215 16.3% 46.9%; /* #64748B — the default secondary-text color */
  --slate-600: 215 19.3% 34.5%; /* #475569 */
  --slate-700: 215 25% 26.7%;   /* #334155 */
  --slate-800: 217 32.6% 17.5%; /* #1E293B */
  --slate-900: 222 47.4% 11.2%; /* #0F172A */
  --slate-950: 229 84% 4.9%;    /* #020617 */

  /* --- Red · error, destructive ------------------------------------------ */
  --red-50:  0 85.7% 97.3%; /* #FEF2F2 */
  --red-100: 0 93.3% 94.1%; /* #FEE2E2 */
  --red-200: 0 96.3% 89.4%; /* #FECACA */
  --red-300: 0 93.5% 81.8%; /* #FCA5A5 */
  --red-400: 0 90.6% 70.8%; /* #F87171 */
  --red-500: 0 84.2% 60.2%; /* #EF4444 */
  --red-600: 0 72.2% 50.6%; /* #DC2626 */
  --red-700: 0 73.7% 41.8%; /* #B91C1C */
  --red-800: 0 70% 35.3%;   /* #991B1B */
  --red-900: 0 62.8% 30.6%; /* #7F1D1D */
  --red-950: 0 74.7% 15.5%; /* #450A0A */

  /* --- Green · success --------------------------------------------------- */
  --green-50:  138 76.5% 96.7%; /* #F0FDF4 */
  --green-100: 141 84.2% 92.5%; /* #DCFCE7 */
  --green-200: 141 78.9% 85.1%; /* #BBF7D0 */
  --green-300: 142 76.6% 73.1%; /* #86EFAC */
  --green-400: 142 69.2% 58%;   /* #4ADE80 */
  --green-500: 142 70.6% 45.3%; /* #22C55E */
  --green-600: 142 76.2% 36.3%; /* #16A34A */
  --green-700: 142 71.8% 29.2%; /* #15803C */
  --green-800: 143 64.2% 24.1%; /* #166534 */
  --green-900: 144 61.2% 20.2%; /* #14532D */
  --green-950: 145 80.4% 10%;   /* #052E16 */

  /* --- Amber · warning, premium ------------------------------------------ */
  --amber-50:  48 100% 96.1%;  /* #FFFBEB */
  --amber-100: 48 96.5% 88.8%; /* #FEF3C7 */
  --amber-200: 48 96.6% 76.7%; /* #FDE68A */
  --amber-300: 46 96.7% 64.5%; /* #FCD34D */
  --amber-400: 43 96.4% 56.3%; /* #FBBE24 */
  --amber-500: 38 92.1% 50.2%; /* #F59F0B */
  --amber-600: 32 94.6% 43.7%; /* #D97606 */
  --amber-700: 26 90.5% 37.1%; /* #B45309 */
  --amber-800: 23 82.5% 31.4%; /* #92410E */
  --amber-900: 22 77.8% 26.5%; /* #78360F */
  --amber-950: 21 91.7% 14.1%; /* #451A03 */

  /* --- Sky · info -------------------------------------------------------- */
  /* Deliberately a different blue from the accent ramp: information is not
     an action, and the two should never be confused at a glance. */
  --sky-50:  204 100% 97.1%;  /* #F0F9FF */
  --sky-100: 204 93.8% 93.7%; /* #E0F2FE */
  --sky-200: 201 94.4% 86.1%; /* #BAE6FD */
  --sky-300: 199 95.5% 73.9%; /* #7DD4FC */
  --sky-400: 198 93.2% 59.6%; /* #38BEF8 */
  --sky-500: 199 88.7% 48.4%; /* #0EA4E9 */
  --sky-600: 200 98% 39.4%;   /* #0285C7 */
  --sky-700: 201 96.3% 32.2%; /* #036AA1 */
  --sky-800: 201 90% 27.5%;   /* #075985 */
  --sky-900: 202 80.3% 23.9%; /* #0C4A6E */
  --sky-950: 204 80.2% 15.9%; /* #082F49 */


  /* ========================================================================
   * §2 · TYPOGRAPHY
   *
   * One family for everything. Hierarchy is carried by the SCALE — size,
   * weight and tracking — never by mixing typefaces.
   *
   * Eight named steps, all whole-pixel sizes (half-pixels smear on
   * non-retina displays). Each step ships four tokens plus a `font`
   * shorthand you can apply in one line:
   *
   *     h1 { font: var(--text-heading); letter-spacing: var(--text-heading-tracking); }
   *
   * The shorthand carries weight/size/line-height/family. Tracking is not
   * part of the CSS `font` shorthand, so apply it separately where it
   * matters — it matters most on `display`, `heading`, `title` and `eyebrow`.
   * The §10 helper classes do both for you.
   * ====================================================================== */

  --font-sans:
    "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* The display voice is the same family — its optical-size cut, not a
     different typeface. Kept as its own token so it can fork later. */
  --font-display: var(--font-sans);
  /* No branded mono ships. This is a system stack; the load-bearing feature
     is `font-variant-numeric: tabular-nums`, applied by `.font-mono` in §9. */
  --font-mono:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;

  /* --- display · 56px · hero and stage moments, one per page at most ----- */
  --text-display-size: 56px;
  --text-display-line: 1.02;
  --text-display-tracking: -0.02em;
  --text-display-weight: 700;
  --text-display: var(--text-display-weight) var(--text-display-size) / var(--text-display-line) var(--font-display);

  /* --- heading · 30px · section headings -------------------------------- */
  --text-heading-size: 30px;
  --text-heading-line: 1.1;
  --text-heading-tracking: -0.02em;
  --text-heading-weight: 700;
  --text-heading: var(--text-heading-weight) var(--text-heading-size) / var(--text-heading-line) var(--font-sans);

  /* --- title · 20px · card and block titles ----------------------------- */
  --text-title-size: 20px;
  --text-title-line: 1.25;
  --text-title-tracking: -0.01em;
  --text-title-weight: 600;
  --text-title: var(--text-title-weight) var(--text-title-size) / var(--text-title-line) var(--font-sans);

  /* --- body-lg · 17px · lead paragraphs, article body ------------------- */
  --text-body-lg-size: 17px;
  --text-body-lg-line: 1.6;
  --text-body-lg-tracking: 0;
  --text-body-lg-weight: 400;
  --text-body-lg: var(--text-body-lg-weight) var(--text-body-lg-size) / var(--text-body-lg-line) var(--font-sans);

  /* --- body · 15px · the default. Everything is this unless it isn't. --- */
  --text-body-size: 15px;
  --text-body-line: 1.6;
  --text-body-tracking: 0;
  --text-body-weight: 400;
  --text-body: var(--text-body-weight) var(--text-body-size) / var(--text-body-line) var(--font-sans);

  /* --- label · 13px · form labels, dense UI text ------------------------ */
  --text-label-size: 13px;
  --text-label-line: 1.4;
  --text-label-tracking: 0;
  --text-label-weight: 500;
  --text-label: var(--text-label-weight) var(--text-label-size) / var(--text-label-line) var(--font-sans);

  /* --- caption · 12px · helper text, timestamps, footnotes -------------- */
  --text-caption-size: 12px;
  --text-caption-line: 1.4;
  --text-caption-tracking: 0;
  --text-caption-weight: 500;
  --text-caption: var(--text-caption-weight) var(--text-caption-size) / var(--text-caption-line) var(--font-sans);

  /* --- eyebrow · 11px · the small uppercase kicker above a heading ------ */
  /* Always uppercase, always wide-tracked. The tracking is what makes it
     legible at this size — do not use the size without it. */
  --text-eyebrow-size: 11px;
  --text-eyebrow-line: 1.3;
  --text-eyebrow-tracking: 0.12em;
  --text-eyebrow-weight: 600;
  --text-eyebrow: var(--text-eyebrow-weight) var(--text-eyebrow-size) / var(--text-eyebrow-line) var(--font-mono);

  /* Weight ramp, for when you need a weight outside a named step. */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;


  /* ========================================================================
   * §3 · SPACING — a strict 4px grid
   *
   * Every gap, pad and margin should be one of these. The step NUMBER is the
   * multiplier: `--space-6` = 6 × 4px = 24px. Steps 7, 9, 11, 13-15 etc. are
   * intentionally absent — the scale gets coarser as it grows, because
   * differences of 4px stop being perceptible at large sizes.
   * ====================================================================== */
  --space-0:  0px;
  --space-1:  4px;   /* icon-to-label, hairline offsets */
  --space-2:  8px;   /* inside a control */
  --space-3:  12px;  /* tight stack */
  --space-4:  16px;  /* default gap between related items */
  --space-5:  20px;
  --space-6:  24px;  /* default gap between blocks — also the grid gutter */
  --space-8:  32px;  /* padding of a page or a large card */
  --space-10: 40px;
  --space-12: 48px;  /* between sections */
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;  /* between major page regions */


  /* ========================================================================
   * §4 · CORNER RADIUS
   *
   * `--radius` is the one knob that matters: every shape below derives from
   * it, so changing it alone re-shapes the whole surface language. The
   * numbered ladder is for absolute one-offs that must not follow the knob.
   * ====================================================================== */
  --radius: 12px;                              /* THE KNOB — change this one */

  --radius-sm: calc(var(--radius) - 4px);      /*  8px · chips, tags, inputs */
  --radius-md: calc(var(--radius) - 2px);      /* 10px · buttons */
  --radius-lg: var(--radius);                  /* 12px · cards, panels */
  --radius-xl: calc(var(--radius) + 4px);      /* 16px · modals, sheets */
  --radius-2xl: calc(var(--radius) + 8px);     /* 20px · hero surfaces */

  --radius-0: 0px;
  --radius-1: 4px;
  --radius-2: 8px;
  --radius-3: 12px;
  --radius-4: 16px;
  --radius-5: 20px;
  --radius-6: 24px;
  --radius-full: 9999px;                       /* pills, avatars */


  /* ========================================================================
   * §5 · SEMANTIC COLOR — LIGHT MODE
   *
   * Role-based. These flip in dark mode (§9); the §1 primitives do not.
   * Prefer these in page CSS — they are what keeps a layout legible in both
   * themes without you writing the theme twice.
   *
   * Each role comes as a foreground/background PAIR. Using a `-fg` token on
   * anything other than its own surface is how contrast bugs happen.
   * ====================================================================== */

  /* Page + surfaces */
  --background:          0 0% 100%;    /* #FFFFFF */
  --foreground:          213 80% 13%;  /* #071E3C · navy-900 */
  --card:                0 0% 100%;    /* raised surface on the page */
  --card-foreground:     213 80% 13%;
  --popover:             0 0% 100%;    /* floating surface — menus, tooltips */
  --popover-foreground:  213 80% 13%;

  /* Brand roles */
  --primary:             213 80% 13%;  /* #071E3C · the brand ink */
  --primary-foreground:  0 0% 100%;
  --secondary:           210 40% 96%;  /* #F1F5F9 · quiet surface */
  --secondary-foreground:213 80% 13%;
  --accent:              213 100% 56%; /* #1F84FF · the action color */
  --accent-foreground:   0 0% 100%;

  /* De-emphasised text and fills */
  --muted:               210 40% 96%;  /* #F1F5F9 */
  --muted-foreground:    215 16% 47%;  /* #65758B · secondary text */

  /* Status */
  --destructive:            0 84% 60%;   /* #EF4343 */
  --destructive-foreground: 0 0% 100%;
  --success:                142 71% 45%; /* #21C45D */
  --success-foreground:     0 0% 100%;
  --warning:                38 92% 50%;  /* #F59F0A */
  --warning-foreground:     38 75% 12%;
  --info:                   199 89% 48%; /* #0DA2E7 */
  --info-foreground:        0 0% 100%;
  --premium:                38 92% 50%;  /* #F59F0A · paid-tier gold */
  --premium-foreground:     38 25% 12%;

  /* Chrome — borders, inputs, focus ring */
  --border:  214 32% 91%;  /* #E1E7EF */
  --input:   214 32% 91%;
  --ring:    213 80% 13%;  /* focus ring — see §10 for the focus-visible rule */

  /* Hairline dividers. These are literal colors, not triplets — use them
     directly: `border-top: 1px solid var(--hairline)`. */
  --hairline: #E1E7EF;
  --hairline-strong: #C7CFDB;

  /* --- Ready-to-use semantic colors ------------------------------------- */
  /* Aliases wrapped in hsl(). Reach for these in day-to-day CSS. */
  --color-bg:            hsl(var(--background));
  --color-text:          hsl(var(--foreground));
  --color-text-muted:    hsl(var(--muted-foreground));
  --color-card:          hsl(var(--card));
  --color-card-text:     hsl(var(--card-foreground));
  --color-popover:       hsl(var(--popover));
  --color-popover-text:  hsl(var(--popover-foreground));
  --color-primary:       hsl(var(--primary));
  --color-primary-text:  hsl(var(--primary-foreground));
  --color-secondary:     hsl(var(--secondary));
  --color-secondary-text:hsl(var(--secondary-foreground));
  --color-accent:        hsl(var(--accent));
  --color-accent-text:   hsl(var(--accent-foreground));
  --color-muted:         hsl(var(--muted));
  --color-danger:        hsl(var(--destructive));
  --color-danger-text:   hsl(var(--destructive-foreground));
  --color-success:       hsl(var(--success));
  --color-success-text:  hsl(var(--success-foreground));
  --color-warning:       hsl(var(--warning));
  --color-warning-text:  hsl(var(--warning-foreground));
  --color-info:          hsl(var(--info));
  --color-info-text:     hsl(var(--info-foreground));
  --color-premium:       hsl(var(--premium));
  --color-premium-text:  hsl(var(--premium-foreground));
  --color-border:        hsl(var(--border));
  --color-input:         hsl(var(--input));
  --color-ring:          hsl(var(--ring));


  /* ========================================================================
   * §6 · ELEVATION & SHADOW
   *
   * Three families, each with a different job. Do not mix them on one
   * element.
   *
   *   elevation-1..4  neutral depth. How far off the page is this?
   *                   This is the default answer for "add a shadow".
   *   glow-*          accent-tinted aura. Signals ACTIVITY or focus, not
   *                   height. Use sparingly — it draws the eye hard.
   *   lift / pop      named one-offs for hover and floating read-only
   *                   surfaces.
   *
   * The elevation ladder is the one primitive that IS mode-aware: it flips to
   * pure black at higher opacity in dark mode, because a navy-tinted shadow
   * is invisible on a dark surface. See §9.
   * ====================================================================== */

  --elevation-1: 0 1px 3px rgba(10, 37, 64, 0.1);
  /* resting — cards at rest, inputs */
  --elevation-2: 0 2px 4px rgba(10, 37, 64, 0.1), 0 10px 22px rgba(10, 37, 64, 0.13);
  /* raised — hovered cards, dropdowns */
  --elevation-3: 0 2px 6px rgba(10, 37, 64, 0.08), 0 18px 40px rgba(10, 37, 64, 0.17);
  /* floating — side panels, drawers */
  --elevation-4: 0 30px 60px rgba(10, 37, 64, 0.18);
  /* overlay — modals, and anything that dims the page behind it */

  /* Accent glow. Alpha rises with the step; `aurora` adds a hairline ring
     and a wide brand-tinted bloom for hero moments. */
  --shadow-glow-sm: 0 4px 12px hsl(var(--accent) / 0.15);
  --shadow-glow:    0 8px 24px hsl(var(--accent) / 0.20);
  --shadow-glow-lg: 0 12px 36px hsl(var(--accent) / 0.28);
  --shadow-glow-xl: 0 20px 60px hsl(var(--accent) / 0.36);
  --shadow-glow-aurora:
    0 0 0 1px hsl(var(--accent) / 0.12),
    0 8px 24px hsl(var(--accent) / 0.24),
    0 24px 80px hsl(var(--primary) / 0.18);

  /* Named one-offs */
  --shadow-lift: 0 8px 20px hsl(var(--primary) / 0.18);  /* hover response */
  --shadow-pop:  0 30px 60px rgba(10, 37, 64, 0.18);     /* = elevation-4 */


  /* ========================================================================
   * §7 · GRID, LAYOUT & MOTION
   * ====================================================================== */

  /* --- 12-column grid contract ------------------------------------------ */
  --grid-columns: 12;
  --grid-gutter:  24px;    /* the gap between columns — = --space-6 */
  --grid-margin:  32px;    /* the page's outer padding — = --space-8 */
  --content-max:  1280px;  /* content never gets wider than this */

  /* Breakpoints. CSS cannot use a variable inside a media query, so these
     are here for documentation and for JavaScript to read. Write the literal
     value in your @media rules:
         @media (min-width: 768px) { ... }   is `md` */
  --screen-sm: 640px;   /* large phones, landscape */
  --screen-md: 768px;   /* tablets */
  --screen-lg: 1024px;  /* small laptops */
  --screen-xl: 1280px;  /* desktops — matches --content-max */
  --screen-2xl: 1536px; /* wide desktops */

  /* --- Motion ------------------------------------------------------------
   * Five durations, four curves. Pick the duration by how far the thing
   * travels and how much of the screen it covers: small and local is fast,
   * large and page-covering is slow. Anything over 480ms feels broken.
   * ---------------------------------------------------------------------- */
  --motion-duration-fast:     120ms; /* hover tints, presses — micro feedback */
  --motion-duration-base:     180ms; /* the default for any UI transition */
  --motion-duration-moderate: 240ms; /* overlays, accordions */
  --motion-duration-slow:     320ms; /* card entrances, layout shifts */
  --motion-duration-slower:   480ms; /* hero and stage reveals */

  --motion-ease-smooth-out: cubic-bezier(0.16, 1, 0.3, 1);   /* default decel */
  --motion-ease-snappy:     cubic-bezier(0.4, 0, 0.2, 1);    /* standard */
  --motion-ease-anticipate: cubic-bezier(0.7, -0.2, 0.4, 1.3); /* overshoot */
  --motion-ease-out-soft:   cubic-bezier(0.22, 1, 0.36, 1);  /* entrances */

  /* A ready-made default. `transition: color var(--transition-base);` */
  --transition-fast: var(--motion-duration-fast) var(--motion-ease-smooth-out);
  --transition-base: var(--motion-duration-base) var(--motion-ease-smooth-out);
  --transition-slow: var(--motion-duration-slow) var(--motion-ease-out-soft);
}


/* ==========================================================================
 * §8 · READY-TO-USE PRIMITIVE COLORS
 *
 * Every ramp step above, wrapped in hsl(). Split into its own block purely
 * for readability — it resolves at the same `:root` level.
 *
 * Use these when you want the color as-is:      var(--color-slate-600)
 * Use the §1 triplets when you want alpha:      hsl(var(--slate-600) / 0.4)
 * ======================================================================== */
:root {
  --color-navy-50:  hsl(var(--navy-50));
  --color-navy-100: hsl(var(--navy-100));
  --color-navy-200: hsl(var(--navy-200));
  --color-navy-300: hsl(var(--navy-300));
  --color-navy-400: hsl(var(--navy-400));
  --color-navy-500: hsl(var(--navy-500));
  --color-navy-600: hsl(var(--navy-600));
  --color-navy-700: hsl(var(--navy-700));
  --color-navy-800: hsl(var(--navy-800));
  --color-navy-900: hsl(var(--navy-900));
  --color-navy-950: hsl(var(--navy-950));

  --color-accent-50:  hsl(var(--accent-50));
  --color-accent-100: hsl(var(--accent-100));
  --color-accent-200: hsl(var(--accent-200));
  --color-accent-300: hsl(var(--accent-300));
  --color-accent-400: hsl(var(--accent-400));
  --color-accent-500: hsl(var(--accent-500));
  --color-accent-600: hsl(var(--accent-600));
  --color-accent-700: hsl(var(--accent-700));
  --color-accent-800: hsl(var(--accent-800));
  --color-accent-900: hsl(var(--accent-900));
  --color-accent-950: hsl(var(--accent-950));

  --color-slate-50:  hsl(var(--slate-50));
  --color-slate-100: hsl(var(--slate-100));
  --color-slate-200: hsl(var(--slate-200));
  --color-slate-300: hsl(var(--slate-300));
  --color-slate-400: hsl(var(--slate-400));
  --color-slate-500: hsl(var(--slate-500));
  --color-slate-600: hsl(var(--slate-600));
  --color-slate-700: hsl(var(--slate-700));
  --color-slate-800: hsl(var(--slate-800));
  --color-slate-900: hsl(var(--slate-900));
  --color-slate-950: hsl(var(--slate-950));

  --color-red-50:  hsl(var(--red-50));
  --color-red-100: hsl(var(--red-100));
  --color-red-200: hsl(var(--red-200));
  --color-red-300: hsl(var(--red-300));
  --color-red-400: hsl(var(--red-400));
  --color-red-500: hsl(var(--red-500));
  --color-red-600: hsl(var(--red-600));
  --color-red-700: hsl(var(--red-700));
  --color-red-800: hsl(var(--red-800));
  --color-red-900: hsl(var(--red-900));
  --color-red-950: hsl(var(--red-950));

  --color-green-50:  hsl(var(--green-50));
  --color-green-100: hsl(var(--green-100));
  --color-green-200: hsl(var(--green-200));
  --color-green-300: hsl(var(--green-300));
  --color-green-400: hsl(var(--green-400));
  --color-green-500: hsl(var(--green-500));
  --color-green-600: hsl(var(--green-600));
  --color-green-700: hsl(var(--green-700));
  --color-green-800: hsl(var(--green-800));
  --color-green-900: hsl(var(--green-900));
  --color-green-950: hsl(var(--green-950));

  --color-amber-50:  hsl(var(--amber-50));
  --color-amber-100: hsl(var(--amber-100));
  --color-amber-200: hsl(var(--amber-200));
  --color-amber-300: hsl(var(--amber-300));
  --color-amber-400: hsl(var(--amber-400));
  --color-amber-500: hsl(var(--amber-500));
  --color-amber-600: hsl(var(--amber-600));
  --color-amber-700: hsl(var(--amber-700));
  --color-amber-800: hsl(var(--amber-800));
  --color-amber-900: hsl(var(--amber-900));
  --color-amber-950: hsl(var(--amber-950));

  --color-sky-50:  hsl(var(--sky-50));
  --color-sky-100: hsl(var(--sky-100));
  --color-sky-200: hsl(var(--sky-200));
  --color-sky-300: hsl(var(--sky-300));
  --color-sky-400: hsl(var(--sky-400));
  --color-sky-500: hsl(var(--sky-500));
  --color-sky-600: hsl(var(--sky-600));
  --color-sky-700: hsl(var(--sky-700));
  --color-sky-800: hsl(var(--sky-800));
  --color-sky-900: hsl(var(--sky-900));
  --color-sky-950: hsl(var(--sky-950));
}


/* ==========================================================================
 * §9 · DARK MODE
 *
 * Activated by `class="dark"` or `data-theme="dark"` on <html> (or on any
 * container, if you want a dark region inside a light page).
 *
 * Only the SEMANTIC tokens flip. The §1 ramps stay put, which is the point:
 * `--navy-900` means the same color in both modes, `--color-text` does not.
 *
 * The dark values are hand-tuned rather than mechanically inverted — status
 * colors lose saturation and gain lightness so that a 10%-alpha fill reads as
 * a calm band on a dark surface instead of an alarm.
 * ======================================================================== */
.dark,
[data-theme="dark"] {
  --background:          213 80% 6%;   /* #030E1C */
  --foreground:          0 0% 100%;
  --card:                213 80% 9%;   /* #051529 */
  --card-foreground:     0 0% 100%;
  --popover:             213 80% 9%;
  --popover-foreground:  0 0% 100%;

  /* Note the inversion: in dark mode the brand ink becomes white, because
     `--primary` means "the highest-contrast brand surface", not "navy". */
  --primary:             0 0% 100%;
  --primary-foreground:  213 80% 13%;
  --secondary:           213 50% 15%;
  --secondary-foreground:0 0% 100%;
  --accent:              213 100% 56%; /* the action blue does NOT change */
  --accent-foreground:   0 0% 100%;

  --muted:               213 50% 15%;
  --muted-foreground:    215 16% 70%;

  --destructive:            0 70% 50%;
  --destructive-foreground: 0 0% 100%;
  --success:                142 60% 55%;
  --success-foreground:     0 0% 100%;
  --warning:                38 80% 60%;
  --warning-foreground:     38 25% 8%;
  --info:                   199 80% 58%;
  --info-foreground:        0 0% 100%;
  --premium:                38 80% 62%;
  --premium-foreground:     38 25% 8%;

  --border: 213 50% 18%;
  --input:  213 50% 18%;
  --ring:   213 100% 56%;  /* the ring switches to accent — navy is invisible
                              against a dark background */

  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  /* Shadows go pure black and heavier. A tinted, subtle shadow simply does
     not exist on a dark surface. */
  --elevation-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --elevation-2: 0 1px 1px rgba(0, 0, 0, 0.3), 0 7px 16px rgba(0, 0, 0, 0.32);
  --elevation-3: 0 1px 1px rgba(0, 0, 0, 0.4), 0 16px 34px rgba(0, 0, 0, 0.4);
  --elevation-4: 0 30px 60px rgba(0, 0, 0, 0.55);
  --shadow-pop:  0 30px 60px rgba(0, 0, 0, 0.55);

  /* Glow alphas rise so the aura still reads through a dark surface. */
  --shadow-glow-sm: 0 4px 12px hsl(var(--accent) / 0.22);
  --shadow-glow:    0 8px 24px hsl(var(--accent) / 0.30);
  --shadow-glow-lg: 0 12px 36px hsl(var(--accent) / 0.40);
  --shadow-glow-xl: 0 20px 60px hsl(var(--accent) / 0.50);
  --shadow-glow-aurora:
    0 0 0 1px hsl(var(--accent) / 0.20),
    0 8px 24px hsl(var(--accent) / 0.36),
    0 24px 80px hsl(var(--primary) / 0.30);
}


/* ==========================================================================
 * §10 · OPTIONAL HELPER CLASSES
 *
 * Everything above this line is tokens only — pure data, zero output.
 * Everything below emits actual CSS rules.
 *
 * These are foundation helpers, not components: a class per type step, the
 * elevation ladder, the page container, and a sane focus ring. Delete this
 * whole section if you would rather write your own selectors against the
 * tokens.
 * ======================================================================== */

/* --- Page baseline. Remove if you already have a reset. ------------------ */
.aisq-base {
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Apply to <body> instead, if you prefer:
   body { background: var(--color-bg); color: var(--color-text); font: var(--text-body); } */

/* --- Type scale --------------------------------------------------------- */
.text-display  { font: var(--text-display);  letter-spacing: var(--text-display-tracking);  font-optical-sizing: auto; }
.text-heading  { font: var(--text-heading);  letter-spacing: var(--text-heading-tracking); }
.text-title    { font: var(--text-title);    letter-spacing: var(--text-title-tracking); }
.text-body-lg  { font: var(--text-body-lg); }
.text-body     { font: var(--text-body); }
.text-label    { font: var(--text-label); }
.text-caption  { font: var(--text-caption); }
.text-eyebrow  {
  font: var(--text-eyebrow);
  letter-spacing: var(--text-eyebrow-tracking);
  text-transform: uppercase;
}

.font-sans    { font-family: var(--font-sans); }
.font-display { font-family: var(--font-display); font-optical-sizing: auto; }
.font-mono    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- Text color --------------------------------------------------------- */
.text-default { color: var(--color-text); }
.text-muted   { color: var(--color-text-muted); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }
.text-info    { color: var(--color-info); }

/* --- Elevation ---------------------------------------------------------- */
.elevation-1 { box-shadow: var(--elevation-1); }
.elevation-2 { box-shadow: var(--elevation-2); }
.elevation-3 { box-shadow: var(--elevation-3); }
.elevation-4 { box-shadow: var(--elevation-4); }
.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-lift { box-shadow: var(--shadow-lift); }

/* --- Layout ------------------------------------------------------------- */
/* The page container: capped width, centred, with the page margin. */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--grid-margin); }
}

/* The 12-column grid. Children span columns with `grid-column: span N`. */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
}
/* Below `md` the 12-column grid stops being useful — collapse to one column
   and let content stack. */
@media (max-width: 767px) {
  .grid-12 { grid-template-columns: minmax(0, 1fr); }
  .grid-12 > * { grid-column: 1 / -1; }
}

/* --- Dividers ----------------------------------------------------------- */
.hairline        { border-color: var(--hairline); }
.hairline-strong { border-color: var(--hairline-strong); }

/* --- Focus ring --------------------------------------------------------- */
/* Keyboard-only. `:focus-visible` means mouse clicks don't draw a ring, but
   tabbing always does — never remove this without replacing it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Reduced motion ----------------------------------------------------- */
/* Respect the OS setting. This collapses durations to near-zero rather than
   to zero, so transition-end events still fire and JS that waits on them
   does not hang. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration-fast:     1ms;
    --motion-duration-base:     1ms;
    --motion-duration-moderate: 1ms;
    --motion-duration-slow:     1ms;
    --motion-duration-slower:   1ms;
  }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
