/* ============================================================
 * SKERVA · DESIGN TOKENS  (single source of truth)
 * ------------------------------------------------------------
 * This file is linked site-wide. The variable NAMES here match
 * the inline :root used on every page (--bg, --ink, --accent,
 * --line, --sans, --container, ...), so pages that override are
 * harmless and pages that DON'T override now inherit a brand-
 * accurate system instead of a stale one.
 *
 * Brand reality (verified across 91 pages):
 *   Accent  : #7c5cff  (electric purple)
 *   Type    : 'Inter Tight' (display + body)
 *   Surface : near-black #0a0a0b stack
 *
 * Adds the scale tokens the inline blocks were missing:
 * radius, shadow, motion, spacing, z-index, semantic color.
 * No component CSS lives here.
 * ============================================================ */

:root {
  /* ---------- SURFACE (background stack) ---------- */
  --bg:   #0a0a0b;                 /* page background */
  --bg-2: #131316;                 /* card / panel */
  --bg-3: #1a1a1e;                 /* elevated / hover surface */
  --bg-4: #212128;                 /* highest elevation */

  /* ---------- STROKE (borders / dividers) ---------- */
  --line:        rgba(255,255,255,0.08);
  --line-2:      rgba(255,255,255,0.14);
  --line-strong: rgba(255,255,255,0.22);

  /* ---------- INK (foreground text) ---------- */
  --ink-0: #ffffff;                /* max contrast */
  --ink:   #f5f5f6;                /* primary body */
  --ink-2: #b8b8bd;                /* secondary */
  --ink-3: #7c7c84;                /* tertiary / metadata */
  --ink-4: #4a4a52;                /* disabled hint */

  /* ---------- ACCENT (single electric-purple accent) ---------- */
  --accent:       #7c5cff;
  --accent-hover: #957aff;
  --accent-soft:  rgba(124,92,255,0.10);
  --accent-mid:   rgba(124,92,255,0.20);
  --accent-edge:  rgba(124,92,255,0.38);

  /* ---------- SEMANTIC ---------- */
  --green:       #4ade80;
  --green-bg:    rgba(74,222,128,0.12);
  --green-edge:  rgba(74,222,128,0.28);
  --warning:     #fbbf24;
  --warning-bg:  rgba(251,191,36,0.12);
  --danger:      #f87171;
  --danger-bg:   rgba(248,113,113,0.12);
  --info:        #60a5fa;
  --info-bg:     rgba(96,165,250,0.12);

  /* ---------- iMESSAGE DEMO (hero phone) ---------- */
  --imsg-blue: #2c8cff;
  --imsg-gray: #2a2a30;

  /* ---------- TYPOGRAPHY ---------- */
  --sans:  'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: Georgia, 'Times New Roman', serif;

  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 17px;                 /* body baseline (matches site) */
  --fs-md:   19px;
  --fs-lg:   22px;
  --fs-xl:   28px;
  --fs-2xl:  36px;
  --fs-3xl:  44px;
  --fs-4xl:  56px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.04;
  --lh-snug: 1.2;
  --lh-base: 1.55;
  --lh-relaxed: 1.7;

  --tr-tight: -0.035em;
  --tr-snug: -0.02em;
  --tr-base: 0;
  --tr-wide: 0.06em;
  --tr-wider: 0.14em;              /* eyebrow / mono labels */

  /* ---------- SPACING · 4pt grid ---------- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-7: 32px;  --s-8: 40px;
  --s-9: 48px;  --s-10: 64px; --s-11: 80px; --s-12: 96px;
  --s-13: 128px;

  /* ---------- RADII ---------- */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;                    /* default button / input */
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* ---------- SHADOW · elevation ---------- */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.40);
  --shadow-2: 0 4px 12px -2px rgba(0,0,0,0.50);
  --shadow-3: 0 12px 32px -6px rgba(0,0,0,0.55);
  --shadow-4: 0 28px 64px -16px rgba(0,0,0,0.70);
  --shadow-glow: 0 0 0 1px var(--accent-edge), 0 12px 40px -8px rgba(124,92,255,0.40);

  /* ---------- MOTION ---------- */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.5, 1.5, 0.5, 1);

  /* ---------- LAYOUT ---------- */
  --container: 1100px;
  --container-narrow: 720px;
  --container-wide: 1280px;
  --container-pad: clamp(20px, 4vw, 32px);

  /* ---------- TOUCH TARGETS ---------- */
  --touch-min: 48px;               /* Android Material */
  --touch-ios: 44px;               /* iOS HIG */
  --touch-pad: 12px;

  /* ---------- Z-INDEX SCALE ---------- */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 50;
  --z-overlay: 100;
  --z-modal: 9999;

  /* ============================================================
   * BACK-COMPAT ALIASES
   * store.html was built on the original orange/IBM-Plex token
   * names. These aliases keep it functional AND re-skin it to the
   * real purple + Inter Tight brand so the store stops being the
   * one off-brand page. Every scale token (--fs-*, --r-*, --s-*,
   * --shadow-*, --fw-*, --lh-*, --tr-*, --z-*, --touch-*) already
   * shares its name with the new system, so only color / font /
   * a couple of layout+motion names need mapping here.
   * ------------------------------------------------------------ */
  --c-accent: var(--accent);
  --c-accent-hover: var(--accent-hover);
  --c-accent-soft: var(--accent-soft);
  --c-accent-mid: var(--accent-mid);
  --c-accent-edge: var(--accent-edge);

  --c-ink-0: var(--ink-0);
  --c-ink-1: var(--ink);
  --c-ink-2: var(--ink-2);
  --c-ink-3: var(--ink-3);
  --c-ink-4: var(--ink-4);

  --c-surface-0: #060608;          /* one notch below page bg */
  --c-surface-1: var(--bg);
  --c-surface-2: var(--bg-2);
  --c-surface-3: var(--bg-3);
  --c-surface-4: var(--bg-4);

  --c-stroke-1: var(--line);
  --c-stroke-2: var(--line-2);
  --c-stroke-3: var(--line-strong);
  --c-stroke-strong: var(--line-strong);

  --c-success: var(--green);
  --c-success-soft: var(--green-bg);
  --c-success-edge: var(--green-edge);
  --c-warning: var(--warning);
  --c-warning-soft: var(--warning-bg);
  --c-danger: var(--danger);
  --c-danger-soft: var(--danger-bg);
  --c-info: var(--info);
  --c-info-soft: var(--info-bg);

  --font-display: var(--sans);
  --font-body: var(--sans);
  --font-serif: var(--serif);

  --container-padding: var(--container-pad);
  --easing-out: var(--ease-out);
  --easing-in-out: var(--ease-in-out);
  --easing-spring: var(--ease-spring);
}

/* ============================================================
 * RESET — site-wide
 * ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; }
img, svg { display: block; max-width: 100%; }

/* Anything interactive shows a pointer (cursor safety net) */
a, button, [role="button"], label[for], summary, select {
  cursor: pointer;
}

/* ============================================================
 * FOCUS + ACCESSIBILITY  (brand-accurate purple ring)
 * ============================================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* High-contrast users: push ink + borders harder */
@media (prefers-contrast: more) {
  :root {
    --ink: #ffffff;
    --ink-2: #e4e4e7;
    --ink-3: #b8b8bd;
    --line: rgba(255,255,255,0.22);
    --line-2: rgba(255,255,255,0.34);
  }
}

/* ============================================================
 * SELECTION  (brand-accurate purple)
 * ============================================================ */

::selection {
  background: var(--accent);
  color: var(--ink-0);
}

/* ============================================================
 * TYPOGRAPHY PRIMITIVES (optional helpers — opt-in via class)
 * ============================================================ */

.t-h1 {
  font-family: var(--sans);
  font-size: clamp(var(--fs-3xl), 4.6vw, var(--fs-4xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
}

.t-h2 {
  font-family: var(--sans);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
}

.t-h3 {
  font-family: var(--sans);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
}

.t-eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tr-wider);
  color: var(--accent);
}

.t-label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
  color: var(--ink-3);
}

.t-mono { font-family: var(--mono); }
