/* ==========================================================================
   GateMog design tokens
   Same token names as the Mog family (PassMog, SignMog, BuildMog, MogDrive,
   AttorneyMog) so components port between apps. Two themes:
   "sky" (light, default): a paper field for a departure board you read at
   4 AM in a bright kitchen or on a phone at the curb.
   "night" (dark): the same board for a dim bedroom the night before.
   Accent = Stripe-style violet, the one warm thing per screen (primary
   button, the selected chip, the forecast line). White text on violet.
   The second voice is the traffic-light trio: quiet green, moderate amber,
   heavy coral. They mean one thing only: how long the line is.
   ========================================================================== */

:root,
[data-theme="sky"] {
  color-scheme: light;

  /* type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.02em;

  /* surfaces: paper */
  --bg: #f7f7fc;
  --bg-2: #efeff8;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --border: rgba(16, 16, 54, 0.10);
  --border-strong: rgba(16, 16, 54, 0.22);
  --glass-blur: 16px;

  /* text */
  --text: #101036;
  --text-2: #45456b;
  --text-3: #63638a; /* 5.3:1 on --bg */

  /* brand accent: violet. White text on violet (4.7:1). */
  --accent: #635bff;
  --accent-2: #8f88ff;
  --accent-deep: #4b43e6;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #635bff 0%, #8f88ff 55%, #b7a7ff 100%);
  --accent-soft: rgba(99, 91, 255, 0.12);
  --accent-soft-2: rgba(99, 91, 255, 0.20);
  --glow: rgba(99, 91, 255, 0.35);
  --focus: #4b43e6;

  /* the traffic light: the line, and only the line */
  --quiet: #10b981;
  --quiet-ink: #065f46;
  --quiet-soft: rgba(16, 185, 129, 0.14);
  --moderate: #f59e0b;
  --moderate-ink: #7c4a03;
  --moderate-soft: rgba(245, 158, 11, 0.16);
  --heavy: #f43f5e;
  --heavy-ink: #9f1239;
  --heavy-soft: rgba(244, 63, 94, 0.14);
  --closed: #64748b;
  --closed-ink: #334155;
  --closed-soft: rgba(100, 116, 139, 0.14);

  /* status */
  --warn: #c77d00;
  --danger: #d8432f;
  --danger-soft: rgba(216, 67, 47, 0.12);
  --meter-track: rgba(16, 16, 54, 0.08);
  --bar-usual: rgba(99, 91, 255, 0.16);

  /* shape and depth */
  --radius-xs: 10px;
  --radius-s: 14px;
  --radius-m: 20px;
  --radius-l: 28px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 16, 54, 0.06), 0 8px 24px rgba(30, 20, 90, 0.08);
  --shadow-2: 0 20px 50px rgba(30, 20, 90, 0.16);
  --shadow-glow: 0 0 0 4px var(--accent-soft), 0 12px 30px var(--glow);

  /* the stage behind the hero: a soft Stripe-style mesh */
  --stage-bg:
    radial-gradient(60% 50% at 10% 0%, rgba(99, 91, 255, 0.22) 0%, rgba(99, 91, 255, 0) 60%),
    radial-gradient(50% 45% at 90% 10%, rgba(255, 128, 196, 0.18) 0%, rgba(255, 128, 196, 0) 60%),
    radial-gradient(60% 50% at 70% 100%, rgba(72, 203, 255, 0.16) 0%, rgba(72, 203, 255, 0) 60%),
    linear-gradient(180deg, #fbfbfe 0%, #f7f7fc 100%);
}

/* ---------- Night: ink field, lighter violet, paper text ---------- */
[data-theme="night"] {
  color-scheme: dark;

  --bg: #0b0b1f;
  --bg-2: #11112b;
  --bg-elev: #171736;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --surface-solid: #1b1b3d;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --glass-blur: 18px;

  --text: #f3f3fb;
  --text-2: #b8b8d4;
  --text-3: #9090b4; /* 5.4:1 on --bg */

  --accent: #7c75ff;
  --accent-2: #a39dff;
  --accent-deep: #635bff;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #635bff 0%, #8f88ff 55%, #c9bfff 100%);
  --accent-soft: rgba(124, 117, 255, 0.16);
  --accent-soft-2: rgba(124, 117, 255, 0.26);
  --glow: rgba(124, 117, 255, 0.40);
  --focus: #c9bfff;

  --quiet: #34d399;
  --quiet-ink: #a7f3d0;
  --quiet-soft: rgba(52, 211, 153, 0.16);
  --moderate: #fbbf24;
  --moderate-ink: #fde68a;
  --moderate-soft: rgba(251, 191, 36, 0.16);
  --heavy: #fb7185;
  --heavy-ink: #fecdd3;
  --heavy-soft: rgba(251, 113, 133, 0.16);
  --closed: #94a3b8;
  --closed-ink: #cbd5e1;
  --closed-soft: rgba(148, 163, 184, 0.16);

  --warn: #ffb547;
  --danger: #ff6f5b;
  --danger-soft: rgba(255, 111, 91, 0.16);
  --meter-track: rgba(255, 255, 255, 0.10);
  --bar-usual: rgba(124, 117, 255, 0.22);

  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 24px 70px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 4px var(--accent-soft), 0 12px 36px var(--glow);

  --stage-bg:
    radial-gradient(60% 50% at 10% 0%, rgba(99, 91, 255, 0.35) 0%, rgba(99, 91, 255, 0) 60%),
    radial-gradient(50% 45% at 90% 10%, rgba(255, 128, 196, 0.16) 0%, rgba(255, 128, 196, 0) 60%),
    radial-gradient(60% 50% at 70% 100%, rgba(72, 203, 255, 0.14) 0%, rgba(72, 203, 255, 0) 60%),
    linear-gradient(180deg, #0f0f2a 0%, #0b0b1f 100%);
}

/* Motion contract: one easing family everywhere (shared with the family). */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-med: 320ms;
  --dur-slow: 640ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-med: 0ms;
    --dur-slow: 0ms;
  }
}
