/*
 * SaaS style pack: design tokens.
 *
 * Every value in the system lives here as a custom property prefixed `--sa-`. Components use
 * ONLY these tokens: no raw hex, px sizes, durations or radii anywhere else.
 *
 * FOUR LOOKS FROM ONE PAGE. Two attributes on <html> pick them, and the markup never changes:
 *   data-sa-theme="light" | "dark"     light is the default
 *   data-sa-style="flat"  | "glass"    flat is the default; glass is the premium material
 * Put both on <html>, not on an inner element: the glass and the sky read them from there.
 *
 * The switches. Each is one line in your own `:root { }` block after the pack's imports:
 *   1. The sky: --sa-sky, the one colour (sky blue). The glow, the active item, the plan on
 *      sale, the chart's bar of the week and the hairline tint are all mixed from it, in both
 *      themes. Keep it a clear, light-ish colour; purple reads generic, so do not.
 *   2. Corners, in two halves:
 *      --sa-control-radius  buttons, fields, chips, the proof pill, the nav capsule.
 *                           999px pill (default), 14px, 10px, 6px.
 *      --sa-corner-surface  cards, the app window, the closing case (a multiplier).
 *                           0.5 tight, 1 soft (default), 1.3 round.
 *   3. Headlines: --sa-font-display. Serif by default (the face in fonts/geist.css); set it
 *      to var(--sa-font-sans) for an all-sans page.
 *   4. Headline size: --sa-headline scales the four serif steps. 0.85 quieter, 1.15 louder.
 *   5. Density: --sa-density scales the space between sections and inside cards.
 *   6. Width: --sa-content-max, the measure (1200px).
 *   7. The glow: --sa-glow-motion, `running` (default) or `paused`. Paused holds the sky
 *      still; reduced motion always does.
 */

@import './fonts/geist.css';

:root,
[data-sa-theme] {
  /* ---------- The one colour ---------- */
  --sa-sky: #2fa8ff;
  --sa-on-sky: #ffffff; /* text on a sky fill (a chip, the chart's bar of the week) */
  --sa-star: #ffd102; /* the proof pill's stars, gold in every theme */
  --sa-thumb: #ffffff; /* a switch's knob when on */

  /* ---------- Neutrals: light ---------- */
  --sa-page: #ffffff;
  --sa-ink: #0b1220; /* headings, values             18.9:1 on page */
  --sa-sub: #42526a; /* body copy, sublines           8.0:1 */
  --sa-quiet: #5b6b7f; /* labels, captions, the footer 5.6:1 */
  --sa-faint: #9db3c8; /* a figure that is not on sale yet ("Soon"); never small text */
  --sa-grey: #e3e7ec; /* the neutral the hairline is mixed from */
  --sa-surface: #ffffff; /* the app window, a menu, a raised control */
  --sa-well-base: #f6f8fa; /* the neutral the card fill is mixed from */
  --sa-primary: #0b1220; /* the primary button: ink */
  --sa-primary-hover: #1c2740;
  --sa-on-primary: #ffffff;
  --sa-ok: #17794a;
  --sa-ok-bg: #e7f8ee;
  --sa-wait: #8a6100;
  --sa-wait-bg: #fff4d6;
  --sa-danger: #c2182b;
  --sa-window-shadow: 0 50px 100px -40px rgb(16 92 160 / 0.4);
  --sa-tint-dark: #000000; /* the active text is the sky mixed toward this */
  --sa-tint-share: 62%;

  color-scheme: light;
}

[data-sa-theme='dark'] {
  --sa-page: #05080f;
  --sa-ink: #f2f6fb;
  --sa-sub: #a6b6cb;
  --sa-quiet: #8496ad;
  --sa-faint: #3b4d63;
  --sa-grey: #1a212c;
  --sa-surface: #070c15;
  --sa-well-base: #0c121b;
  --sa-primary: #ffffff;
  --sa-primary-hover: #dbeeff;
  --sa-on-primary: #05080f;
  --sa-on-sky: #04111f;
  --sa-ok: #6ed3a0;
  --sa-ok-bg: #0f2c1f;
  --sa-wait: #e9c15a;
  --sa-wait-bg: #33270a;
  --sa-danger: #ff6b7d;
  --sa-window-shadow: 0 50px 100px -40px rgb(0 0 0 / 0.7);
  --sa-tint-dark: #ffffff;
  --sa-tint-share: 55%;

  color-scheme: dark;
}

/* ---------- Roles mixed from the sky and the page ----------
   Declared wherever a theme is, so a theme change re-mixes them. */
:root,
[data-sa-theme] {
  --sa-line: color-mix(in srgb, var(--sa-sky) 9%, var(--sa-grey)); /* hairline */
  --sa-well: color-mix(in srgb, var(--sa-sky) 3%, var(--sa-well-base)); /* a flat card */
  --sa-pill: var(--sa-surface); /* the proof pill and the nav capsule */
  --sa-chip: color-mix(in srgb, var(--sa-sky) 8%, var(--sa-page)); /* a quiet control on the plain page */
  --sa-chip-hover: color-mix(in srgb, var(--sa-sky) 14%, var(--sa-page));
  --sa-secondary: var(--sa-surface); /* the secondary button on the sky */
  --sa-secondary-hover: color-mix(in srgb, var(--sa-sky) 6%, var(--sa-surface));
  --sa-bar: color-mix(in srgb, var(--sa-sky) 24%, var(--sa-page)); /* chart bars */
  --sa-active-bg: color-mix(in srgb, var(--sa-sky) 10%, var(--sa-page)); /* the current item */
  --sa-active-fg: color-mix(in srgb, var(--sa-sky) var(--sa-tint-share), var(--sa-tint-dark));
  --sa-draft-bg: color-mix(in srgb, var(--sa-sky) 6%, var(--sa-grey));
  --sa-plan: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sa-sky) 6%, var(--sa-page)) 0%,
    color-mix(in srgb, var(--sa-sky) 32%, var(--sa-page)) 100%
  ); /* the plan on sale */
  --sa-plan-sub: var(--sa-active-fg);
  /* the sky glow, from the sky to the page */
  --sa-glow:
    var(--sa-sky) 0%, color-mix(in srgb, var(--sa-sky) 68%, var(--sa-page)) 24%,
    color-mix(in srgb, var(--sa-sky) 36%, var(--sa-page)) 46%,
    color-mix(in srgb, var(--sa-sky) 12%, var(--sa-page)) 66%, var(--sa-page) 88%;
  --sa-selection: color-mix(in srgb, var(--sa-sky) 30%, var(--sa-page));
  --sa-focus: var(--sa-sky);
  --sa-scrim: color-mix(in srgb, var(--sa-page) 55%, transparent);
  --sa-glass-blur: blur(20px) saturate(160%); /* the nav capsule and the proof pill, both styles */
}

/* Dark: the chip and the secondary sit a step above the page instead. */
[data-sa-theme='dark'] {
  --sa-chip: color-mix(in srgb, var(--sa-sky) 10%, #0d1520);
  --sa-chip-hover: color-mix(in srgb, var(--sa-sky) 16%, #0d1520);
  --sa-secondary: #0a111c;
  --sa-secondary-hover: #111b2b;
  --sa-plan: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sa-sky) 8%, var(--sa-page)) 0%,
    color-mix(in srgb, var(--sa-sky) 55%, var(--sa-page)) 100%
  );
  --sa-pill: #0a111c;
}

/* ---------- Glass: the same roles, plus a material ----------
   A pane is a translucent tint with a gradient hairline bright along the top, a one-pixel
   highlight inside the top edge, a darker line inside the bottom, a soft depth shadow and
   fine grain. Panes do NOT blur what is behind them; only floating layers do. */
[data-sa-style='glass'] {
  --sa-page: #f4fbff;
  --sa-pill: rgb(255 255 255 / 0.6);
  --sa-chip: rgb(255 255 255 / 0.55);
  --sa-chip-hover: rgb(255 255 255 / 0.8);
  --sa-secondary: rgb(255 255 255 / 0.55);
  --sa-secondary-hover: rgb(255 255 255 / 0.8);
  --sa-glass-tint: rgb(255 255 255 / 0.62);
  --sa-glass-float: rgb(255 255 255 / 0.55);
  --sa-glass-sheen: rgb(255 255 255 / 0.5);
  --sa-glass-highlight: rgb(255 255 255 / 0.95);
  --sa-glass-low: color-mix(in srgb, var(--sa-sky) 10%, transparent);
  --sa-glass-rim: linear-gradient(180deg, #ffffff, rgb(255 255 255 / 0.6) 35%, color-mix(in srgb, var(--sa-sky) 22%, transparent));
  --sa-glass-rim-hover: linear-gradient(180deg, #ffffff, rgb(255 255 255 / 0.7) 35%, color-mix(in srgb, var(--sa-sky) 45%, transparent));
  --sa-glass-rim-brand: linear-gradient(180deg, color-mix(in srgb, var(--sa-sky) 90%, transparent), color-mix(in srgb, var(--sa-sky) 30%, transparent) 40%, rgb(255 255 255 / 0.6));
  --sa-glass-depth: 0 1px 2px rgb(16 92 160 / 0.08), 0 18px 40px -24px rgb(16 92 160 / 0.4);
  --sa-glass-plan: linear-gradient(180deg, rgb(255 255 255 / 0.55) 0%, color-mix(in srgb, var(--sa-sky) 55%, transparent) 100%);
  --sa-stage: linear-gradient(#ffffff, color-mix(in srgb, var(--sa-sky) 10%, #ffffff));
  --sa-glow-opacity: 0.9; /* the fluted glass */
}

[data-sa-style='glass'][data-sa-theme='dark'] {
  --sa-page: #05080f;
  --sa-pill: rgb(255 255 255 / 0.07);
  --sa-chip: rgb(255 255 255 / 0.08);
  --sa-chip-hover: rgb(255 255 255 / 0.14);
  --sa-secondary: rgb(255 255 255 / 0.07);
  --sa-secondary-hover: rgb(255 255 255 / 0.13);
  --sa-glass-tint: rgb(12 18 28 / 0.72);
  --sa-glass-float: rgb(12 18 28 / 0.6);
  --sa-glass-sheen: rgb(255 255 255 / 0.04);
  --sa-glass-highlight: rgb(255 255 255 / 0.08);
  --sa-glass-low: rgb(0 0 0 / 0.25);
  --sa-glass-rim: linear-gradient(180deg, rgb(255 255 255 / 0.18), rgb(255 255 255 / 0.05) 35%, rgb(255 255 255 / 0.03));
  --sa-glass-rim-hover: linear-gradient(180deg, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0.09) 40%, rgb(255 255 255 / 0.04));
  --sa-glass-rim-brand: linear-gradient(180deg, color-mix(in srgb, var(--sa-sky) 70%, transparent), color-mix(in srgb, var(--sa-sky) 16%, transparent) 40%, rgb(255 255 255 / 0.04));
  --sa-glass-depth: 0 1px 2px rgb(0 0 0 / 0.35), 0 18px 40px -24px rgb(0 0 0 / 0.7);
  --sa-glass-plan: linear-gradient(180deg, rgb(255 255 255 / 0.05) 0%, color-mix(in srgb, var(--sa-sky) 42%, transparent) 100%);
  --sa-stage: linear-gradient(#0a111c, #05080f);
  --sa-glow-opacity: 0.75;
}

:root {
  /* ---------- Type ---------- */
  --sa-headline: 1;
  /* serif steps (headlines and figures), multiplied by --sa-headline */
  --sa-text-hero: calc(clamp(56px, 9vw, 132px) * var(--sa-headline)); /* the h1 only */
  --sa-leading-hero: 0.92;
  --sa-tracking-hero: -0.055em;
  --sa-text-close: calc(clamp(48px, 7.4vw, 112px) * var(--sa-headline)); /* the closing ask */
  --sa-leading-close: 0.94;
  --sa-text-display: calc(clamp(40px, 5.4vw, 76px) * var(--sa-headline)); /* a section's heading */
  --sa-leading-display: 1;
  --sa-tracking-display: -0.05em;
  --sa-text-figure: calc(clamp(72px, 8vw, 104px) * var(--sa-headline)); /* a price */
  --sa-tracking-figure: -0.06em;
  --sa-text-title: calc(clamp(28px, 2.6vw, 34px) * var(--sa-headline)); /* a card's title */
  --sa-leading-title: 1.05;
  --sa-tracking-title: -0.04em;
  --sa-text-stat: 32px; /* a figure inside the app window */
  --sa-text-wordmark: 26px;
  /* sans steps */
  --sa-text-lede: clamp(17px, 1.5vw, 20px); /* the hero's subline */
  --sa-leading-lede: 1.45;
  --sa-text-body: 16px;
  --sa-leading-body: 1.5;
  --sa-text-control: 16px; /* large buttons */
  --sa-text-nav: 15px; /* nav links, the proof pill, small buttons */
  --sa-text-small: 14px; /* app UI text, chips */
  --sa-text-meta: 13px; /* labels in the app window */
  --sa-text-micro: 12px; /* status badges */
  --sa-tracking-tight: -0.01em;

  /* ---------- Space ---------- */
  --sa-density: 1;
  --sa-content-max: 1200px;
  --sa-window-max: 1080px; /* the app window */
  --sa-pair-max: 880px; /* two price cards */
  --sa-gutter: 24px; /* page side padding */
  --sa-gap: 16px; /* between cards */
  --sa-space-1: 4px;
  --sa-space-2: 8px;
  --sa-space-3: 12px;
  --sa-space-4: 16px;
  --sa-space-5: 20px;
  --sa-space-6: 24px;
  --sa-space-7: 28px;
  --sa-space-8: 32px;
  --sa-space-9: 36px;
  --sa-space-10: 40px;
  --sa-space-12: 48px;
  --sa-space-14: 56px;
  --sa-space-20: 80px;
  --sa-space-28: 112px;
  --sa-section: calc(clamp(96px, 10vw, 128px) * var(--sa-density)); /* a section's top and bottom */
  --sa-card-pad: calc(32px * var(--sa-density));
  --sa-plan-pad: calc(40px * var(--sa-density));
  --sa-close-pad: calc(clamp(112px, 12vw, 144px) * var(--sa-density));
  --sa-measure-hero: 13ch;
  --sa-measure-display: 18ch;
  --sa-measure-lede: 40ch;
  --sa-measure-card: 30ch;
  --sa-measure-prose: 64ch;
  --sa-plan-solo: 440px; /* one plan alone */
  --sa-touch: 44px; /* the smallest target on a touch screen */

  /* ---------- Shape ---------- */
  --sa-control-radius: 999px;
  --sa-corner-surface: 1;
  --sa-radius-control: var(--sa-control-radius);
  --sa-radius-card: calc(20px * var(--sa-corner-surface));
  --sa-radius-window: calc(20px * var(--sa-corner-surface));
  --sa-radius-case: calc(28px * var(--sa-corner-surface)); /* the closing case */
  --sa-radius-cell: calc(14px * var(--sa-corner-surface)); /* a box inside the app window */
  --sa-radius-item: calc(10px * var(--sa-corner-surface)); /* a list item, a menu item */
  --sa-radius-bar: 4px;
  --sa-radius-round: 999px; /* dots, badges, the stars: always round */
  --sa-control-h: 52px; /* large buttons */
  --sa-control-h-md: 44px; /* fields, the proof pill, the nav capsule */
  --sa-control-h-sm: 40px; /* header buttons */
  --sa-hairline: 1px;

  /* ---------- Motion ----------
     Things come into focus as they arrive: a short rise, a fade and a blur that clears,
     together. Children of a group follow 70ms apart. */
  --sa-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sa-dur-press: 200ms;
  --sa-dur-enter: 900ms;
  --sa-dur-reveal: 760ms;
  --sa-step-enter: 90ms; /* between the hero's lines */
  --sa-step-reveal: 70ms; /* between a group's children */
  --sa-rise: 18px;
  --sa-rise-reveal: 24px;
  --sa-focus-in: blur(10px);
  --sa-focus-in-hero: blur(8px);
  --sa-press: 0.98;
  --sa-arrow-nudge: 2px;
  --sa-glow-motion: running;
  --sa-glow-cycle: 22s;

  /* ---------- Layers ---------- */
  --sa-z-header: 50;
  --sa-z-overlay: 80;
}

