/* ============================================================================
   Ignite Retail Technology — Design System
   styles.css
   Two-tier tokens: fixed brand palette (--ig-*) -> semantic tokens (theme-swapped)
   Dark is the base; light overrides live under [data-theme="light"].
   ============================================================================ */

/* ---------- 1. Fixed brand palette (never theme-switched) ---------- */
:root {
  /* Primary */
  --ig-purple:        #5e398a;
  --ig-orange:        #fd8d1a;
  --ig-yellow:        #fedb00;
  /* Secondary */
  --ig-purple-light:  #a14aa0;
  --ig-mars:          #9e2b16;
  --ig-gold:          #d38210;

  /* Derived brand tints/shades for UI use */
  --ig-purple-700:    #4a2c6e;
  --ig-purple-300:    #b98fd6;
  --ig-orange-300:    #ffc082;
  --ig-orange-600:    #d9700f;

  /* Launch Trails palette (Mission Control) */
  --ig-violet:        #8b5cf6;
  --ig-lavender:      #a78bfa;
  --ig-lavender-2:    #c4b5fd;
  --ig-particle:      #f97316;

  /* Deep-space neutral ramp (dark surfaces, slight purple cast) */
  --ig-space-990:     #08060d;
  --ig-space-950:     #0b0812;
  --ig-space-900:     #120d1d;
  --ig-space-850:     #181125;
  --ig-space-800:     #1f172f;
  --ig-space-750:     #281d3c;
  --ig-space-700:     #33274b;
  --ig-space-600:     #493a63;

  /* Cool grays (light surfaces + text) */
  --ig-gray-50:       #f7f6fa;
  --ig-gray-100:      #efedf4;
  --ig-gray-200:      #e2dfea;
  --ig-gray-300:      #cbc6d6;
  --ig-gray-400:      #a49db4;
  --ig-gray-500:      #7b7389;
  --ig-gray-600:      #574f63;
  --ig-gray-700:      #3d3648;
  --ig-gray-900:      #1b1622;
  --ig-white:         #ffffff;

  /* Status hues */
  --ig-go:            #1f9d6b;   /* "all systems are GO" green */
  --ig-go-300:        #57d3a0;
  --ig-hold:          #e5a83b;   /* caution / hold */
  --ig-hold-300:      #f5c977;
  --ig-scrub:         #d1462f;   /* abort / scrub (uses Mars family) */
  --ig-scrub-300:     #f0836e;
  --ig-info:          var(--ig-purple-light);
  --ig-info-300:      #cf9bcd;

  /* Brand gradients */
  --grad-purple-space: linear-gradient(135deg, #a14aa0 0%, #5e398a 100%);
  --grad-sunshine:     linear-gradient(135deg, #fedb00 0%, #d38210 100%);
  --grad-firelight:    linear-gradient(135deg, #fd8d1a 0%, #9e2b16 100%);
  --grad-spark:        linear-gradient(120deg, #a14aa0 0%, #fd8d1a 55%, #fedb00 100%);
  --grad-ignite:       linear-gradient(135deg, #fd8d1a 0%, #d9700f 55%, #9e2b16 100%);
  --grad-nebula:       radial-gradient(1200px 600px at 78% -10%, rgba(253,141,26,.16), transparent 60%),
                       radial-gradient(900px 500px at 10% 10%, rgba(161,74,160,.20), transparent 60%);

  /* Typography */
  --font-display: "kallisto", "Segoe UI", system-ui, sans-serif;
  --font-alt:     "eurostile", "kallisto", system-ui, sans-serif;
  --font-body:    "kallisto", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --text-xs:  0.75rem;   --text-sm:  0.875rem; --text-base: 1rem;
  --text-lg:  1.125rem;  --text-xl:  1.375rem; --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;   --text-4xl: 3rem;     --text-5xl: 3.75rem;
  --text-6xl: 4.75rem;

  --leading-tight: 1.08; --leading-snug: 1.28; --leading-normal: 1.6;
  --tracking-tight: -0.02em; --tracking-kicker: 0.22em; --tracking-wide: 0.06em;

  /* Spacing (4px base) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;   --space-8: 3rem;    --space-10: 4rem;
  --space-12: 6rem;   --space-16: 8rem;
  --container: 1080px;

  /* Radius */
  --radius-xs: 6px; --radius-sm: 9px; --radius-md: 12px;
  --radius-lg: 16px; --radius-xl: 22px; --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur-fast: 120ms; --dur-base: 220ms; --dur-slow: 420ms;

  /* z-index */
  --z-star: 0; --z-base: 1; --z-nav: 50; --z-overlay: 80; --z-modal: 100; --z-toast: 120;
}

/* ---------- 2. Semantic tokens — DARK (base) ---------- */
:root {
  color-scheme: dark;
  --bg:          var(--ig-space-950);
  --bg-subtle:   var(--ig-space-990);
  --surface:     var(--ig-space-900);
  --surface-2:   var(--ig-space-850);
  --elevated:    var(--ig-space-800);
  --overlay:     rgba(8,6,13,.72);

  --border:        color-mix(in srgb, var(--ig-purple-light) 20%, transparent);
  --border-strong: color-mix(in srgb, var(--ig-purple-light) 34%, transparent);

  --text:        #ece8f2;
  --text-strong: #ffffff;
  --muted:       #b3a9c4;
  --dim:         #857a99;

  --accent:      var(--ig-orange);
  --accent-fg:   #ffb057;         /* text-safe orange on dark */
  --brand:       var(--ig-purple-light);
  --brand-fg:    var(--ig-purple-300);
  --ring:        color-mix(in srgb, var(--ig-orange) 55%, transparent);

  --glass-bg:     rgba(31,23,47,.55);
  --glass-border: rgba(183,169,196,.16);
  --code-bg:      #0d0a15;
  --code-border:  rgba(183,169,196,.14);

  --grad-text:   var(--grad-spark);

  --status-go:    var(--ig-go-300);
  --status-hold:  var(--ig-hold-300);
  --status-scrub: var(--ig-scrub-300);
  --status-info:  var(--ig-info-300);
  --tint-go:    color-mix(in srgb, var(--ig-go) 22%, transparent);
  --tint-hold:  color-mix(in srgb, var(--ig-hold) 22%, transparent);
  --tint-scrub: color-mix(in srgb, var(--ig-scrub) 22%, transparent);
  --tint-info:  color-mix(in srgb, var(--ig-info) 22%, transparent);
  --tint-accent:color-mix(in srgb, var(--ig-orange) 18%, transparent);

  --shadow-sm:  0 1px 2px rgba(6,4,10,.55);
  --shadow-md:  0 8px 22px rgba(6,4,10,.55);
  --shadow-lg:  0 20px 48px rgba(6,4,10,.6);
  --shadow-glow: 0 0 34px rgba(253,141,26,.30);
}

/* ---------- 3. Semantic tokens — LIGHT ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:          var(--ig-gray-50);
  --bg-subtle:   #f0eef5;
  --surface:     #ffffff;
  --surface-2:   #fbfafd;
  --elevated:    #ffffff;
  --overlay:     rgba(27,22,34,.4);

  --border:        rgba(27,22,34,.10);
  --border-strong: rgba(27,22,34,.18);

  --text:        #241d2f;
  --text-strong: #140f1c;
  --muted:       #5c5468;
  --dim:         #857d92;

  --accent:      #d9700f;          /* deeper orange reads better on white */
  --accent-fg:   #b85c08;
  --brand:       var(--ig-purple);
  --brand-fg:    #5e398a;
  --ring:        color-mix(in srgb, var(--ig-orange) 45%, white);

  --glass-bg:     rgba(255,255,255,.72);
  --glass-border: rgba(27,22,34,.08);
  --code-bg:      #1a1424;
  --code-border:  rgba(255,255,255,.08);

  --grad-text:   linear-gradient(120deg, #7b2f8f 0%, #d9700f 55%, #b8860b 100%);

  --status-go:    #157a52;
  --status-hold:  #b07d18;
  --status-scrub: #c23b28;
  --status-info:  #7b2f8f;
  --tint-go:    color-mix(in srgb, var(--ig-go) 14%, white);
  --tint-hold:  color-mix(in srgb, var(--ig-hold) 16%, white);
  --tint-scrub: color-mix(in srgb, var(--ig-scrub) 12%, white);
  --tint-info:  color-mix(in srgb, var(--ig-purple-light) 14%, white);
  --tint-accent:color-mix(in srgb, var(--ig-orange) 14%, white);

  --shadow-sm:  0 1px 2px rgba(27,22,34,.08);
  --shadow-md:  0 8px 22px rgba(27,22,34,.10);
  --shadow-lg:  0 20px 48px rgba(27,22,34,.14);
  --shadow-glow: 0 0 30px rgba(217,112,15,.22);
}

/* ---------- 4. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: var(--leading-normal);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.theme-transitioning * {
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease !important;
}
h1,h2,h3,h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0;
  font-weight: 700;
}
a { color: var(--accent-fg); text-decoration: none; }
p { margin: 0 0 var(--space-4); }
::selection { background: color-mix(in srgb, var(--ig-orange) 40%, transparent); color: var(--text-strong); }

.mono { font-family: var(--font-mono); }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- 5. Layout: fixed sidebar + main ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 248px;
  z-index: var(--z-nav);
  display: flex; flex-direction: column;
  padding: 22px 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.side-brand img { width: 30px; height: 30px; }
.side-brand .wm { display: flex; flex-direction: column; line-height: 1.05; }
.side-brand .wm b { font-family: var(--font-display); font-size: 15px; letter-spacing: .02em; color: var(--text-strong); }
.side-brand .wm span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-fg); }

.nav-group { margin-top: 14px; }
.nav-group > .ng-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--dim); padding: 0 8px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--muted); font-weight: 500;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.nav-link .n-num { font-family: var(--font-mono); font-size: 10px; color: var(--dim); min-width: 16px; }
.nav-link:hover { background: var(--tint-accent); color: var(--accent-fg); }
.nav-link.active { background: color-mix(in srgb, var(--ig-purple-light) 16%, transparent); color: var(--text-strong); }
.nav-link.active .n-num { color: var(--accent-fg); }
.side-foot { margin-top: auto; padding: 16px 8px 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); line-height: 1.7; }
.side-foot .go { color: var(--status-go); }

.theme-toggle {
  display: inline-grid; place-items: center; position: relative;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: border-color var(--dur-fast);
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; position: absolute; transition: opacity var(--dur-base), transform var(--dur-base); }
.theme-toggle .i-moon { opacity: 1; }
.theme-toggle .i-sun  { opacity: 0; transform: rotate(-90deg) scale(.6); }
:root[data-theme="light"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
:root[data-theme="light"] .theme-toggle .i-sun  { opacity: 1; transform: none; }

.main { margin-left: 248px; position: relative; z-index: 1; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 40px; }

/* ---------- 6. Section shell ---------- */
.section { padding: 84px 0; border-bottom: 1px solid var(--border); position: relative; }
.slabel {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-fg); margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.slabel::before { content:""; width: 22px; height: 1px; background: var(--accent); opacity: .6; }
.stitle { font-size: var(--text-3xl); margin-bottom: 14px; }
.sdesc { color: var(--muted); max-width: 60ch; font-size: var(--text-lg); margin-bottom: 8px; }
.block-h {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim);
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
  margin: 40px 0 20px;
}

/* ---------- 7. Grids ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.auto-fill { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- 8. Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
}
.card-2 { background: var(--surface-2); }
.card-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 14px;
}
.glass {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------- 9. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius-md);
  border: 0; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-fast), border-color var(--dur-fast);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad-ignite); color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 46px rgba(253,141,26,.42); }
.btn-secondary {
  background: var(--surface-2); color: var(--text-strong);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-fg); }
.btn-ghost { background: transparent; color: var(--accent-fg); }
.btn-ghost:hover { background: var(--tint-accent); }
.btn-danger { background: var(--ig-scrub); color: #fff; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(209,70,47,.4); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: var(--radius-lg); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-pill { border-radius: var(--radius-pill); }

/* ---------- 10. Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.input, .select, textarea.input {
  width: 100%; font-family: var(--font-body); font-size: 14px;
  padding: 10px 13px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder { color: var(--dim); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.select {
  appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
.check-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 14px; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

/* toggle switch */
.toggle {
  --w: 42px; --h: 24px; position: relative; width: var(--w); height: var(--h);
  border-radius: var(--radius-pill); background: var(--surface-2);
  border: 1px solid var(--border-strong); cursor: pointer; transition: background var(--dur-base);
}
.toggle::after {
  content:""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--muted); transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base);
}
.toggle.on { background: var(--grad-ignite); border-color: transparent; }
.toggle.on::after { transform: translateX(18px); background: #fff; }

/* ---------- 11. Badges, pills, alerts ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.accent { background: var(--tint-accent); color: var(--accent-fg); border-color: transparent; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600;
}
.pill::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.go    { color: var(--status-go);    background: var(--tint-go);    border: 1px solid color-mix(in srgb, var(--ig-go) 30%, transparent); }
.pill.hold  { color: var(--status-hold);  background: var(--tint-hold);  border: 1px solid color-mix(in srgb, var(--ig-hold) 30%, transparent); }
.pill.scrub { color: var(--status-scrub); background: var(--tint-scrub); border: 1px solid color-mix(in srgb, var(--ig-scrub) 30%, transparent); }
.pill.info  { color: var(--status-info);  background: var(--tint-info);  border: 1px solid color-mix(in srgb, var(--ig-info) 30%, transparent); }

.alert {
  display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 12px;
  font-size: 14px;
}
.alert .a-ico { font-family: var(--font-mono); font-weight: 700; }
.alert.go    { background: var(--tint-go);    border-color: color-mix(in srgb, var(--ig-go) 30%, transparent); }
.alert.hold  { background: var(--tint-hold);  border-color: color-mix(in srgb, var(--ig-hold) 30%, transparent); }
.alert.scrub { background: var(--tint-scrub); border-color: color-mix(in srgb, var(--ig-scrub) 30%, transparent); }
.alert.info  { background: var(--tint-info);  border-color: color-mix(in srgb, var(--ig-info) 30%, transparent); }
.alert b { color: var(--text-strong); }

/* ---------- 12. Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600;
  padding: 9px 14px; color: var(--muted); cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--dur-fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-fg); border-bottom-color: var(--accent); }

/* ---------- 13. Data table (calm core) ---------- */
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtable thead th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
}
.dtable tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.dtable tbody tr { transition: background var(--dur-fast); }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable .num { text-align: right; font-family: var(--font-mono); }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }

/* ---------- 14. Stat / KPI tiles ---------- */
.stat { padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.stat .s-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.stat .s-num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--text-strong); margin: 6px 0 2px; letter-spacing: -0.02em; }
.stat .s-delta { font-family: var(--font-mono); font-size: 12px; }
.stat .s-delta.up { color: var(--status-go); }
.stat .s-delta.down { color: var(--status-scrub); }

/* ---------- 15. Swatches ---------- */
.sw {
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface); cursor: pointer; transition: transform var(--dur-fast), box-shadow var(--dur-base);
  position: relative;
}
.sw:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sw .sw-chip { height: 84px; }
.sw .sw-meta { padding: 10px 12px; }
.sw .sw-name { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.sw .sw-hex { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.sw .sw-tkn { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent-fg); }
.sw .sw-copied {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--overlay); color: var(--text-strong); font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .1em; opacity: 0; transition: opacity var(--dur-fast);
  pointer-events: none;
}
.sw.copied .sw-copied { opacity: 1; }

.grad-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); cursor: pointer; }
.grad-card:hover { box-shadow: var(--shadow-md); }
.grad-card .gc-chip { height: 108px; }
.grad-card .gc-meta { padding: 10px 12px; }
.grad-card .gc-name { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.grad-card .gc-css { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); word-break: break-all; }

/* ---------- 16. Specimens: spacing / radius / shadow / motion ---------- */
.scale-row { display: grid; grid-template-columns: 90px 60px 1fr; align-items: center; gap: 14px; padding: 7px 0; }
.scale-row .s-name { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.scale-row .s-val { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.scale-row .s-bar { height: 14px; border-radius: 4px; background: var(--grad-firelight); opacity: .8; }

.radii-box, .shadow-box, .motion-box {
  height: 96px; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: end center; padding: 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.shadow-box { background: var(--surface); border: none; }
.motion-box { cursor: pointer; place-items: center; position: relative; }
.motion-box .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--grad-ignite); transition: transform var(--dur-slow) var(--ease-out); }
.motion-box:hover .dot { transform: translateX(52px); }

/* ---------- 17. Code blocks ---------- */
.code {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius-md); overflow: hidden; margin: 8px 0 4px; position: relative;
}
.code .code-bar {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-bottom: 1px solid var(--code-border);
}
.code .code-bar .dotlight { width: 10px; height: 10px; border-radius: 50%; }
.code .code-bar .ttl { font-family: var(--font-mono); font-size: 11px; color: #9d92b0; margin-left: 6px; }
.code .copy-btn {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 4px 9px; border-radius: var(--radius-xs); cursor: pointer;
  background: rgba(255,255,255,.06); color: #cfc6de; border: 1px solid rgba(255,255,255,.1);
  transition: background var(--dur-fast);
}
.code .copy-btn:hover { background: rgba(253,141,26,.22); color: #ffb057; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: #d9d2e6; }
.code .ck { color: #c4b5fd; }  /* keys / props */
.code .cv { color: #ffb057; }  /* values */
.code .cs { color: #57d3a0; }  /* strings */
.code .cc { color: #6f6685; }  /* comments */
.code .cn { color: #fedb00; }  /* numbers */

/* ---------- 18. Empty state ---------- */
.empty {
  text-align: center; padding: 44px 24px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.empty .e-glyph { font-size: 34px; margin-bottom: 12px; }
.empty h4 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 40ch; margin: 0 auto 16px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--elevated) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite linear; border-radius: 6px; height: 12px; margin-bottom: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* avatars */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 14px; }

/* ---------- 19. Do / Don't ---------- */
.dodont { border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border); }
.dodont.do   { background: var(--tint-go);   border-color: color-mix(in srgb, var(--ig-go) 30%, transparent); }
.dodont.dont { background: var(--tint-scrub);border-color: color-mix(in srgb, var(--ig-scrub) 30%, transparent); }
.dodont h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dodont ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 13.5px; }
.dodont li { margin-bottom: 6px; }

/* ---------- 20. Starlight background ---------- */
.starfield {
  position: absolute; inset: 0; z-index: var(--z-star);
  overflow: hidden; pointer-events: none;
}
/* page-wide field sits behind all content (data always rides opaque surfaces) */
.starfield-global { position: fixed; inset: 0; z-index: 0; opacity: .72; }
.starfield svg { position: absolute; inset: -20%; width: 140%; height: 140%; }

/* Orbital drift — three layers rotate slowly at 180 / 300 / 420s, twinkle 3 / 5 / 7s. */
.star-layer { transform-origin: 50% 50%; animation: star-rotate 180s linear infinite; will-change: transform; }
.star-layer:nth-child(2) { animation-duration: 300s; }
.star-layer:nth-child(3) { animation-duration: 420s; animation-direction: reverse; }
.star-layer .tw { animation: twinkle 3s ease-in-out infinite; }
.star-layer:nth-child(2) .tw { animation-duration: 5s; animation-delay: 1s; }
.star-layer:nth-child(3) .tw { animation-duration: 7s; animation-delay: 2s; }
@keyframes star-rotate { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.ember { position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, #ffe1b0 0%, #fd8d1a 45%, rgba(253,141,26,0) 74%);
  box-shadow: 0 0 8px rgba(253,141,26,.55);
  animation: rise linear infinite; opacity: 0; }
@keyframes rise {
  0% { transform: translateY(0) scale(.7); opacity: 0; }
  12% { opacity: .9; }
  85% { opacity: .6; }
  100% { transform: translateY(-620px) scale(1.1); opacity: 0; }
}

/* Section 08 showcase — the full, livelier Starlight: rotation + brisk twinkle,
   denser stars, more embers. Only in the dedicated demo box, never page-wide. */
.starfield-showcase::after { content:""; position: absolute; inset: 0; background: var(--grad-nebula); pointer-events: none; }
.starfield-showcase .star-layer { transform-origin: 50% 50%; animation: star-rotate 140s linear infinite; }
.starfield-showcase .star-layer:nth-child(2) { animation-name: star-rotate; animation-duration: 200s; }
.starfield-showcase .star-layer:nth-child(3) { animation-name: star-rotate; animation-duration: 260s; animation-direction: reverse; }
.starfield-showcase .star-layer .tw { animation-duration: 3s; }
.starfield-showcase .star-layer:nth-child(2) .tw { animation-duration: 4s; animation-delay: .6s; }
.starfield-showcase .star-layer:nth-child(3) .tw { animation-duration: 5s; animation-delay: 1.2s; }

/* Starlight is dark-mode + motion-safe only, never over data.
   The page-wide field switches off in light mode; the dedicated demo box
   stays dark so the effect can still be shown. */
:root[data-theme="light"] .starfield-global { display: none; }
@media (prefers-reduced-motion: reduce) {
  .star-layer, .star-layer .tw, .ember { animation: none !important; }
  .ember { display: none; }
}
body.stars-paused .star-layer, body.stars-paused .ember { animation-play-state: paused; }

/* ---------- 21. Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 84px; background: transparent; }
.hero::before { content:""; position: absolute; inset: 0; background: var(--grad-nebula); pointer-events: none; z-index: 0; }
:root[data-theme="light"] .hero::before { opacity: .55; }
.hero .spark-intro {
  font-family: var(--font-body); font-size: 1.05rem; line-height: 1.55;
  color: var(--text); max-width: 52ch; margin: 0 0 20px; padding-left: 16px;
  border-left: 2px solid var(--accent);
}
.hero .spark-intro b { color: var(--accent-fg); }
.hero .wrap { position: relative; z-index: var(--z-base); }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-fg); display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px;
}
.hero .eyebrow .live { width: 7px; height: 7px; border-radius: 50%; background: var(--status-go); box-shadow: 0 0 0 0 rgba(31,157,107,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,107,.55); } 70% { box-shadow: 0 0 0 9px rgba(31,157,107,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,107,0); } }
.hero h1 { font-size: var(--text-6xl); max-width: 15ch; margin-bottom: 20px; }
.hero .lede { font-size: var(--text-xl); color: var(--muted); max-width: 54ch; margin-bottom: 30px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.hero .meta { display: flex; gap: 26px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.hero .meta b { color: var(--text); }

/* ---------- 22. Mission Control canvas (Launch Trails) ---------- */
.mc-canvas {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(139,92,246,.18), transparent 60%),
    linear-gradient(160deg, #140d22 0%, #0b0812 100%);
  border: 1px solid var(--border); min-height: 360px; padding: 0;
}
.mc-node {
  position: absolute; z-index: 3; width: 132px; padding: 11px 13px;
  background: rgba(31,23,47,.9); border: 1px solid rgba(167,139,250,.35);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}
.mc-node .mn-h { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ig-lavender); margin-bottom: 5px; }
.mc-node .mn-t { font-family: var(--font-display); font-size: 13px; color: #fff; font-weight: 600; }
.mc-node .mn-dot { width: 8px; height: 8px; border-radius: 50%; }
.mc-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.mc-badge { position: absolute; top: 14px; left: 16px; z-index: 4; }

/* ---------- 23. Login preview ---------- */
.login-preview {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  min-height: 300px; display: grid; place-items: center; padding: 30px;
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 300px at 75% 20%, rgba(253,141,26,.18), transparent 60%),
    linear-gradient(150deg, #a14aa0 0%, #5e398a 55%, #2a1f42 100%);
}
.login-card {
  width: 100%; max-width: 320px; padding: 26px; border-radius: var(--radius-lg);
  background: rgba(11,8,18,.66); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-lg);
}
.login-card h4 { color: #fff; margin-bottom: 4px; }
.login-card p { color: rgba(255,255,255,.7); font-size: 13px; margin-bottom: 18px; }
.login-card .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.login-card .input::placeholder { color: rgba(255,255,255,.5); }

/* ---------- 23b. Virtual receipt ---------- */
.receipt-stage {
  display: grid; place-items: center; padding: 30px 20px;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background:
    radial-gradient(420px 220px at 50% 0%, var(--tint-accent), transparent 70%),
    var(--surface-2);
}
.receipt {
  width: 100%; max-width: 336px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
}
.receipt .r-head { text-align: center; padding: 18px 20px 14px; border-bottom: 1px dashed var(--border-strong); }
.receipt .r-head img { height: 20px; margin-bottom: 10px; }
.receipt .r-store { font-family: var(--font-display); font-size: 15px; color: var(--text-strong); font-weight: 700; }
.receipt .r-meta { color: var(--dim); font-size: 11px; line-height: 1.65; margin-top: 5px; }
.receipt .r-body { padding: 14px 20px; }
.receipt .r-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.receipt .r-line .r-desc { color: var(--muted); }
.receipt .r-line .r-sublabel { color: var(--dim); font-size: 11px; padding: 0 0 4px; }
.receipt .r-rule { border-top: 1px dashed var(--border-strong); margin: 9px 0; }
.receipt .r-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 16px; color: var(--text-strong); padding-top: 2px; }
.receipt .r-pay { color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; }
.receipt .r-pay .ok { color: var(--status-go); }
.receipt .r-loyalty {
  margin: 0 20px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--tint-accent); border: 1px solid color-mix(in srgb, var(--ig-orange) 30%, transparent);
}
.receipt .r-loyalty .r-l-top { display: flex; align-items: center; gap: 7px; color: var(--accent-fg); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.receipt .r-loyalty .r-l-top img { height: 13px; }
.receipt .r-loyalty .r-l-pts { font-family: var(--font-display); font-size: 18px; color: var(--text-strong); margin: 4px 0 2px; }
.receipt .r-loyalty .r-l-sub { color: var(--muted); font-size: 11px; }
.receipt .r-foot { text-align: center; padding: 14px 20px 18px; color: var(--dim); font-size: 10.5px; letter-spacing: .04em; }
.meta-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.meta-row:last-of-type { border-bottom: none; }
.meta-row .m-k { color: var(--dim); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.meta-row .m-v { color: var(--text); }

/* ---------- 24. Logo / brand tiles ---------- */
.logo-tile {
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  display: grid; place-items: center; min-height: 150px; padding: 20px; position: relative;
}
.logo-tile.on-dark { background: linear-gradient(160deg, #1a1228, #0b0812); }
.logo-tile.on-light { background: #fff; }
.logo-tile.on-grad { background: var(--grad-purple-space); }
.logo-tile img { max-width: 78%; max-height: 90px; }
.logo-tile .lt-cap { position: absolute; bottom: 8px; left: 10px; font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,.55); letter-spacing: .08em; }
.logo-tile.on-light .lt-cap { color: var(--dim); }

/* vocabulary chips */
.vocab { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab span {
  font-family: var(--font-mono); font-size: 12px; padding: 5px 11px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.vocab span.hot { color: var(--accent-fg); border-color: color-mix(in srgb, var(--ig-orange) 34%, transparent); background: var(--tint-accent); }

/* footer */
.foot {
  position: relative; overflow: hidden; text-align: center; padding: 90px 0;
  background: transparent; border-top: 1px solid var(--border);
}
:root[data-theme="light"] .foot { background: linear-gradient(160deg, var(--surface-2), var(--bg)); }
.foot .wrap { position: relative; z-index: var(--z-base); }
.foot h2 { font-size: var(--text-4xl); color: var(--text-strong); margin-bottom: 14px; }
.foot p { color: var(--muted); max-width: 46ch; margin: 0 auto 26px; }
.foot .f-meta { margin-top: 34px; font-family: var(--font-mono); font-size: 11px; color: var(--dim); letter-spacing: .08em; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(30px);
  z-index: var(--z-toast); padding: 11px 18px; border-radius: var(--radius-md);
  background: var(--elevated); border: 1px solid var(--border-strong); color: var(--text-strong);
  font-family: var(--font-mono); font-size: 12.5px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .go { color: var(--status-go); }

/* helpers */
.stack-6 > * + * { margin-top: var(--space-6); }
.muted { color: var(--muted); }
.center { text-align: center; }
.hl { color: var(--accent-fg); }
hr.rule { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- 25. Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .sidebar {
    position: static; width: auto; flex-direction: row; align-items: center;
    overflow-x: auto; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border);
    gap: 4px; position: sticky; top: 0;
  }
  .side-brand { padding: 0 12px 0 0; border-right: 1px solid var(--border); }
  .nav-group { margin-top: 0; display: flex; align-items: center; }
  .nav-group > .ng-title, .side-foot { display: none; }
  .nav-link { white-space: nowrap; }
  .main { margin-left: 0; }
  .wrap { padding: 0 22px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: var(--text-4xl); }
}
@media (max-width: 640px) {
  .stitle { font-size: var(--text-2xl); }
  .hero { padding: 56px 0; }
  .scale-row { grid-template-columns: 76px 50px 1fr; }
}
