/* ---------- Sigrix Refined Design System — Light home page ----------
 * Lifted from Sigrix_new/Sigrix Home - Light.html. Light variant only;
 * dark variant will be ported in a follow-up. All rules are scoped under
 * `.sx` / `.sx-*` so they cannot bleed into other pages. */

.sx {
  /* refined palette — Light defaults */
  --sx-bg: #FAFAFB;
  --sx-bg-2: #F4F5F8;
  --sx-surface: #FFFFFF;
  --sx-surface-2: #F7F8FB;
  --sx-line: #E6E8EE;
  --sx-line-2: #D6D9E1;
  --sx-text: #0E1320;
  --sx-text-2: #4B5263;
  --sx-text-3: #7A8294;
  --sx-mute: #B7BCC8;

  --sx-brand: #2A33C4;
  --sx-brand-2: #1A1F6B;
  --sx-brand-3: #3D4DFF;
  --sx-brand-ink: #FFFFFF;
  --sx-accent: #14B8A6;
  --sx-warn: #C77800;
  --sx-danger: #DC2C50;
  --sx-ok: #1F9D55;

  --sx-countdown-font: 'Space Grotesk', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --sx-font-display: 'Geist', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --sx-font-body: 'Geist', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --sx-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --sx-r-sm: 6px;
  --sx-r-md: 10px;
  --sx-r-lg: 14px;
  --sx-r-xl: 20px;

  --sx-shadow-1: 0 1px 0 rgba(255,255,255,0.03) inset, 0 1px 2px rgba(0,0,0,0.4);
  --sx-shadow-2: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.6);

  --sx-1: 4px; --sx-2: 8px; --sx-3: 12px; --sx-4: 16px;
  --sx-5: 20px; --sx-6: 24px; --sx-8: 32px; --sx-10: 40px;
  --sx-12: 48px; --sx-16: 64px; --sx-20: 80px;
}

.sx, .sx * { box-sizing: border-box; }
.sx {
  font-family: var(--sx-font-body);
  color: var(--sx-text);
  background: var(--sx-bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  line-height: 1.5;
  min-height: 100%;
}
.sx a { color: inherit; text-decoration: none; }
.sx h1, .sx h2, .sx h3, .sx h4, .sx h5 { font-family: var(--sx-font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
.sx p { margin: 0; }
.sx :where(button) { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; padding: 0; }

/* ---------- Buttons ---------- */
.sx-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; min-height: 0; padding: 0 16px;
  border-radius: var(--sx-r-md);
  font-size: 14px; font-weight: 500;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.005em;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  white-space: nowrap;
  text-decoration: none;
}
/* Bump specificity (0,2,0) so .sx-btn wins over base.css `button { min-height: 38px }`
 * (0,1,0) and base.css ghost-button rules. */
button.sx-btn { min-height: 0; font-weight: 500; text-transform: none; letter-spacing: -0.005em; box-shadow: none; border: 0; }
button.sx-btn--primary { font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 0 0 1px rgba(26,31,107,0.6), 0 1px 2px rgba(26,31,107,0.30); }
button.sx-btn--secondary { box-shadow: 0 0 0 1px var(--sx-line) inset; }
.sx-btn:active { transform: translateY(1px); }
.sx-btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.sx-btn--sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: var(--sx-r-sm); }

.sx-btn--primary {
  background: linear-gradient(135deg, #3D4DFF 0%, #1A1F6B 100%);
  color: var(--sx-brand-ink);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 0 0 1px rgba(26,31,107,0.6), 0 1px 2px rgba(26,31,107,0.30);
}
.sx-btn--primary:hover { background: var(--sx-brand-2); }

.sx-btn--secondary {
  background: var(--sx-surface);
  color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-btn--secondary:hover { background: var(--sx-surface-2); box-shadow: 0 0 0 1px var(--sx-line-2) inset; }

.sx-btn--ghost {
  background: transparent;
  color: var(--sx-text-2);
}
.sx-btn--ghost:hover { background: var(--sx-surface); color: var(--sx-text); }

.sx-btn--link {
  height: auto; padding: 0; color: var(--sx-text-2);
  font-weight: 500;
}
.sx-btn--link:hover { color: var(--sx-text); }

/* Bump specificity (0,2,0) so anchor-buttons beat the `.sx a { color: inherit }`
 * reset (0,1,1) and pick up their declared colors instead of inheriting
 * the page text color. */
a.sx-btn--primary, button.sx-btn--primary { color: var(--sx-brand-ink); }
a.sx-btn--secondary, button.sx-btn--secondary { color: var(--sx-text); }
a.sx-btn--ghost, button.sx-btn--ghost { color: var(--sx-text-2); }
a.sx-btn--ghost:hover, button.sx-btn--ghost:hover { color: var(--sx-text); }
a.sx-btn--link, button.sx-btn--link { color: var(--sx-text-2); }
a.sx-btn--link:hover, button.sx-btn--link:hover { color: var(--sx-text); }

/* ---------- Chips / Tags ---------- */
.sx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 4px;
  background: var(--sx-surface-2);
  color: var(--sx-text-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-chip--type-prompt    { color: #1A1F6B; box-shadow: 0 0 0 1px rgba(61,77,255,0.30) inset; background: rgba(61,77,255,0.07); }
.sx-chip--type-persona   { color: #92400E; box-shadow: 0 0 0 1px rgba(199,120,0,0.25) inset; background: rgba(245,180,84,0.10); }
.sx-chip--type-agent     { color: #0F766E; box-shadow: 0 0 0 1px rgba(20,184,166,0.30) inset; background: rgba(20,184,166,0.08); }
.sx-chip--type-assistant { color: #6D28D9; box-shadow: 0 0 0 1px rgba(140,90,255,0.30) inset; background: rgba(140,90,255,0.08); }
.sx-chip--type-product   { color: #B91C5C; box-shadow: 0 0 0 1px rgba(220,44,80,0.25) inset; background: rgba(220,44,80,0.06); }

.sx-chip--soft {
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--sx-text-3);
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-chip--ok { color: #166534; box-shadow: 0 0 0 1px rgba(31,157,85,0.3) inset; background: rgba(31,157,85,0.08); }

/* Token-weight chip — relative per-run consumption signal sourced from
   the platform's compile-time estimate. Bolt-color encodes the bucket. */
.sx-chip--tokens {
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--sx-text-2);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sx-chip--tokens svg { flex-shrink: 0; opacity: 0.85; }
.sx-chip--tokens-low  { color: var(--sx-text-2); }
.sx-chip--tokens-low  svg { color: #7CE3D4; opacity: 1; }
.sx-chip--tokens-med  svg { color: #F5B454; opacity: 1; }
.sx-chip--tokens-high svg { color: #F47B7B; opacity: 1; }
.sx-chip--tokens-high { color: var(--sx-text); }

.sx-price {
  font-family: var(--sx-font-mono);
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--sx-text);
}

/* ---------- Eyebrow / micro labels ---------- */
.sx-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  font-weight: 600;
}

/* ---------- Cards ---------- */
.sx-card {
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
  display: flex; flex-direction: column;
  height: 100%;
}
.sx-card-body { flex: 1; display: flex; flex-direction: column; padding: 14px 16px 16px; }
.sx-card-foot { margin-top: auto; }
.sx-card:hover {
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 12px 30px -16px rgba(14,19,32,0.18);
}

/* ---------- Layout helpers ---------- */
.sx-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sx-row { display: flex; align-items: center; gap: 12px; }
.sx-stack { display: flex; flex-direction: column; }
.sx-divider { height: 1px; background: var(--sx-line); }

/* ---------- Nav ---------- */
.sx-nav {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--sx-line);
}
.sx-nav-inner {
  height: 60px;
  display: flex; align-items: center; gap: 24px;
}
.sx-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-family: var(--sx-font-display); font-size: 16px; letter-spacing: -0.02em; color: var(--sx-text); }
.sx-logo-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #3D4DFF 0%, #1A1F6B 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-weight: 700; font-size: 12px;
}
.sx-nav-links { display: flex; gap: 4px; margin-left: 12px; }
.sx-nav-link {
  height: 32px; padding: 0 12px; border-radius: 8px;
  display: inline-flex; align-items: center;
  font-size: 14px; color: var(--sx-text-2); font-weight: 500;
}
.sx-nav-link:hover { background: var(--sx-surface); color: var(--sx-text); }
.sx-nav-link[aria-current], .sx-nav-link.is-active { color: var(--sx-text); background: var(--sx-surface); }
.sx-search {
  flex: 1; max-width: 360px;
  height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-3); font-size: 13px;
  position: relative;
}
.sx-search:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
/* Specificity (0,3,1) so this beats the inline base.html
 * `.global-search input[type="search"]` rule (0,2,1) that would
 * otherwise re-pill the input inside the new flat search shell. */
.sx-search input[type="search"].sx-search-input {
  flex: 1; min-width: 0;
  height: 100%;
  min-height: 0;
  width: auto;
  border: 0; background: transparent; outline: none;
  color: var(--sx-text); font-size: 13px;
  font-family: inherit;
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.sx-search input[type="search"].sx-search-input::placeholder { color: var(--sx-text-3); }
.sx-search-icon { width: 14px; height: 14px; color: var(--sx-text-3); flex-shrink: 0; }
.sx-kbd {
  font-family: var(--sx-font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--sx-bg-2);
  color: var(--sx-text-3);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- Theme toggle ---------- */
.sx-theme-toggle {
  position: relative;
  width: 56px; height: 30px;
  /* base.css applies `button { min-height: 44px }` (mobile tap target)
   * and `button { min-height: 38px }`. Override both so the pill stays
   * 30 px tall — otherwise the absolute-positioned thumb (top:3px,
   * height:24px) sits off-center. */
  min-height: 0;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--sx-bg-2);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  cursor: pointer;
  padding: 0;
  display: inline-flex; align-items: center;
  transition: background 160ms ease, box-shadow 160ms ease;
  border: 0;
}
.sx-theme-toggle:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.sx-theme-toggle:focus-visible { outline: 2px solid var(--sx-brand); outline-offset: 2px; }
.sx-theme-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 1px 2px rgba(0,0,0,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sx-text);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), background 160ms ease;
}
[data-theme="light"] .sx-theme-toggle-thumb { transform: translateX(26px); }
.sx-theme-toggle-icon { width: 14px; height: 14px; display: block; }
.sx-theme-toggle-track-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  color: var(--sx-text-2);
  opacity: 0.55;
  pointer-events: none;
}
.sx-theme-toggle-track-icon--moon { left: 9px; }
.sx-theme-toggle-track-icon--sun  { right: 9px; }
[data-theme="dark"]  .sx-theme-toggle-track-icon--moon { opacity: 0; }
[data-theme="light"] .sx-theme-toggle-track-icon--sun  { opacity: 0; }
.sx-theme-toggle-thumb-icon--moon { display: none; }
[data-theme="dark"] .sx-theme-toggle-thumb-icon--sun  { display: none; }
[data-theme="dark"] .sx-theme-toggle-thumb-icon--moon { display: block; }

/* ---------- Section header ---------- */
.sx-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 24px;
}
.sx-section-head h2 {
  font-size: 28px; font-weight: 600;
  margin-top: 10px;
}
.sx-section-head .sub {
  color: var(--sx-text-2); font-size: 15px; margin-top: 6px;
}

/* ---------- Full-bleed hero breakout ----------
 * Every page's `{% block content %}` is rendered inside
 * `<div class="container">` (base.html), which base.css clamps to
 * `max-width: 1200px`. The Sigrix_new mocks render the hero gradient
 * + grid edge-to-edge of the viewport, so the section needs to break
 * out of that 1200px box. Negative side margins let the section span
 * full viewport width while the inner `.sx-container` keeps content
 * centered at 1200px. `body.{home-page,sx-shell,hub-page}` declare
 * `overflow-x: clip` (below) so the breakout doesn't introduce a
 * horizontal scrollbar. */
.sx-hero,
.mp-hero,
.hub-hero,
.mp-toolbar {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---------- Hero ---------- */
.sx-hero {
  position: relative;
  padding: 96px 0 72px;
  overflow: hidden;
}
.sx-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 400px at 20% 0%, rgba(26,31,107,0.14), transparent 60%),
    radial-gradient(700px 360px at 90% 20%, rgba(61,77,255,0.10), transparent 60%);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.sx-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(14,19,32,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,19,32,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(700px 380px at 50% 0%, black, transparent 70%);
  pointer-events: none;
}
.sx-hero h1 {
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 18ch;
}
.sx-hero h1 .accent { color: var(--sx-text-2); }
.sx-hero .lede {
  margin-top: 20px; font-size: 18px; color: var(--sx-text-2); max-width: 60ch;
}
.sx-hero-actions { margin-top: 28px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sx-hero-quicklinks { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.sx-quicklink {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  font-size: 13px; color: var(--sx-text-2);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-quicklink:hover { color: var(--sx-text); box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.sx-quicklink .dot { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, #3D4DFF 0%, #1A1F6B 100%); }

/* hero meta strip */
.sx-hero-strip {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 18px 0;
  border-top: 1px solid var(--sx-line);
  border-bottom: 1px solid var(--sx-line);
}
.sx-hero-strip > div { padding: 0 24px; border-left: 1px solid var(--sx-line); }
.sx-hero-strip > div:first-child { border-left: 0; padding-left: 0; }
.sx-hero-strip .label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sx-text-3); }
.sx-hero-strip .val { font-family: var(--sx-font-display); font-size: 20px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; }

/* ---------- Listing cards ---------- */
.sx-listing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.sx-card-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #EEF1F8 0%, #F7F8FB 100%);
  position: relative;
  overflow: hidden;
}
.sx-card-cover-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sx-font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: rgba(14,19,32,0.55);
  text-align: center;
  padding: 20px;
}
.sx-card-cover-art svg { width: 100%; height: 100%; display: block; }
.sx-card-cover-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(14,19,32,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,19,32,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
}
.sx-card-cover img.sx-card-cover-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.sx-card-cover-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.sx-card-cover-tag {
  position: absolute; top: 10px; left: 10px;
}
.sx-card-cover-tag .sx-chip {
  background: rgba(255,255,255,0.92);
  color: var(--sx-text);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.10) inset, 0 1px 2px rgba(0,0,0,0.06);
}
/* Color dot before the type label */
.sx-card-cover-tag .sx-chip::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
  flex-shrink: 0;
}
.sx-card-cover-tag .sx-chip--type-prompt::before    { background: #3D4DFF; }
.sx-card-cover-tag .sx-chip--type-persona::before   { background: #F5B454; }
.sx-card-cover-tag .sx-chip--type-agent::before     { background: #7CE3D4; }
.sx-card-cover-tag .sx-chip--type-assistant::before { background: #B48CFF; }
.sx-card-cover-tag .sx-chip--type-product::before   { background: #F47B7B; }
.sx-card-cover-price {
  position: absolute; top: 10px; right: 10px;
  height: 22px; padding: 0 8px;
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 4px;
  font-family: var(--sx-font-mono);
  font-size: 11px;
  color: var(--sx-text);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.10) inset, 0 1px 2px rgba(0,0,0,0.06);
}
.sx-card-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  min-height: 22px; /* reserve 1 chip row so cards align even when category missing */
  margin-bottom: 8px;
}
.sx-card-title {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--sx-text); margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(15px * 1.35 * 2);
  line-height: 1.35;
}
.sx-card-desc {
  font-size: 13px; color: var(--sx-text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(13px * 1.5 * 2);
}
.sx-card-foot {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--sx-line);
  display: flex; flex-direction: column; gap: 10px;
}
.sx-card-foot-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  min-height: 22px;
}
.sx-card-foot-credit {
  display: flex; align-items: center; justify-content: space-between;
}
.sx-author { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sx-text-2); min-width: 0; }
.sx-author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #E6E8EE, #FFFFFF);
  box-shadow: 0 0 0 1px var(--sx-line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--sx-text-2); font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.sx-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-stats { display: inline-flex; gap: 10px; font-size: 12px; color: var(--sx-text-3); font-variant-numeric: tabular-nums; }
.sx-stats span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- How it works ---------- */
.sx-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sx-step { padding: 24px; border-radius: var(--sx-r-lg); background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset; }
.sx-step-num { font-family: var(--sx-font-mono); font-size: 12px; color: var(--sx-text-3); }
.sx-step h3 { font-size: 18px; margin-top: 12px; font-weight: 600; }
.sx-step p { color: var(--sx-text-2); font-size: 14px; margin-top: 6px; }

/* ---------- Founding panel ---------- */
.sx-founding {
  position: relative;
  padding: 32px;
  border-radius: var(--sx-r-xl);
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(26,31,107,0.14), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(26,31,107,0.10), transparent 60%),
    var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  overflow: hidden;
}
.sx-founding h2 { font-size: 28px; font-weight: 600; max-width: 14ch; }
.sx-founding ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.sx-founding li { font-size: 14px; color: var(--sx-text-2); display: flex; gap: 10px; }
.sx-founding li b { color: var(--sx-text); font-weight: 600; }
.sx-founding li::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, #1A1F6B 0%, #3D4DFF 100%);
  margin-top: 4px;
}
.sx-counter { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 20px; }
.sx-counter-cell {
  padding: 12px;
  background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border-radius: var(--sx-r-md);
  text-align: center;
}
.sx-counter-cell .num {
  font-family: var(--sx-countdown-font);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: transparent;
  background: linear-gradient(135deg, #3D4DFF 0%, #1A1F6B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
.sx-counter-cell .lbl { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-text-3); margin-top: 8px; }
.sx-seats {
  margin-top: 16px; padding: 14px; border-radius: var(--sx-r-md); background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.sx-seats-bar { height: 6px; border-radius: 3px; background: var(--sx-line); margin-top: 10px; overflow: hidden; }
.sx-seats-bar > div { height: 100%; background: linear-gradient(90deg, #1A1F6B, #3D4DFF); }
.sx-live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31,157,85,0.08);
  color: var(--sx-ok);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 0 0 1px rgba(31,157,85,0.3) inset;
}
.sx-live-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sx-ok);
  box-shadow: 0 0 0 4px rgba(31,157,85,0.25);
}

/* ---------- Updates section ---------- */
.sx-updates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sx-update-card {
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  padding: 24px;
  display: flex; flex-direction: column;
  transition: box-shadow 160ms ease, background 160ms ease;
}
.sx-update-card:hover {
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 12px 30px -16px rgba(14,19,32,0.18);
}
.sx-update-date {
  font-family: var(--sx-font-mono);
  font-size: 11px;
  color: var(--sx-text-3);
  letter-spacing: 0;
  text-transform: none;
}
.sx-update-card h3 { font-size: 17px; font-weight: 600; margin-top: 10px; letter-spacing: -0.01em; }
.sx-update-card p { font-size: 14px; color: var(--sx-text-2); margin-top: 8px; line-height: 1.55; }
.sx-update-link { margin-top: 16px; font-size: 13px; color: var(--sx-brand-2); font-weight: 500; }

/* ---------- CTA strip ---------- */
.sx-cta-strip {
  padding: 56px 48px;
  border-radius: var(--sx-r-xl);
  background: radial-gradient(800px 300px at 100% 50%, rgba(91,124,255,0.12), transparent 60%), var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
}
.sx-cta-strip h2 { font-size: 32px; font-weight: 600; }
.sx-cta-strip p { color: var(--sx-text-2); margin-top: 10px; font-size: 16px; }
.sx-cta-strip-actions { display: flex; gap: 10px; }

/* ---------- Footer ---------- */
.sx-footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--sx-line);
  margin-top: 80px;
}
.sx-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; }
.sx-footer h4 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-text-3); font-weight: 600; margin-bottom: 14px; }
.sx-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sx-footer a { color: var(--sx-text-2); font-size: 14px; }
.sx-footer a:hover { color: var(--sx-text); }
.sx-footer-bottom {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--sx-line);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--sx-text-3); font-size: 12px;
  flex-wrap: wrap; gap: 12px;
}
.sx-footer-bottom code { font-family: var(--sx-font-mono); font-size: 12px; }

/* Social row — sits under the brand description in column 1 of the footer grid */
.sx-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.sx-social a {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sx-text-3);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.sx-social a:hover {
  color: var(--sx-brand-ink);
  background: var(--sx-brand);
  box-shadow: 0 0 0 1px rgba(91, 124, 255, 0.6) inset, 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
}
.sx-social a:focus-visible {
  outline: 2px solid var(--sx-brand);
  outline-offset: 2px;
}
.sx-social svg { width: 15px; height: 15px; display: block; }
.sx[data-theme="light"] .sx-social a {
  background: var(--sx-surface);
  color: var(--sx-text-2);
}
.sx[data-theme="light"] .sx-social a:hover {
  color: var(--sx-brand-ink);
  background: var(--sx-brand);
}

/* ---------- FAQ section overrides (keeps current accordion markup so faq.js stays wired) ---------- */
.sx .faq-section { margin-top: 96px; }
.sx .faq-section .page-shell { padding: 0; }
.sx .faq-accordion {
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  overflow: hidden;
}
.sx .faq-item { border-bottom: 1px solid var(--sx-line); }
.sx .faq-item:last-child { border-bottom: 0; }
.sx .faq-question {
  width: 100%; text-align: left;
  padding: 18px 20px;
  background: transparent; border: 0;
  color: var(--sx-text);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.sx .faq-question:hover { background: var(--sx-surface-2); }
.sx .faq-answer {
  padding: 0 20px 18px;
  color: var(--sx-text-2);
  font-size: 14px; line-height: 1.6;
}
.sx .faq-answer p { margin: 0; }
.sx .quiet-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--sx-text-2);
  font-size: 13px;
}
.sx .quiet-link:hover { color: var(--sx-text); }

/* ---------- Mobile nav toggle (hamburger) ----------
 * Hidden on desktop, shown on mobile to reveal #mobile-nav-panel via the
 * shared base_bootstrap.js handler that listens for [data-action="header-toggle-nav"]. */
.sx-nav-toggle {
  display: none;
  width: 36px; height: 36px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--sx-r-md);
  background: var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text);
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.sx-nav-toggle:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; }
.sx-nav-toggle:focus-visible { outline: 2px solid var(--sx-brand); outline-offset: 2px; }
.sx-nav-toggle-icon { width: 20px; height: 20px; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sx-listing-grid { grid-template-columns: repeat(2, 1fr); }
  .sx-updates-grid { grid-template-columns: repeat(2, 1fr); }
  .sx-founding { grid-template-columns: 1fr; }
  .sx-hero h1 { font-size: 48px; }
  .sx-hero { padding: 64px 0 48px; }
  .sx-hero-strip { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .sx-hero-strip > div { padding: 0 16px; }
  .sx-hero-strip > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .sx-steps { grid-template-columns: 1fr; }
  .sx-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sx-listing-grid { grid-template-columns: 1fr; }
  .sx-updates-grid { grid-template-columns: 1fr; }
  .sx-hero h1 { font-size: 36px; }
  .sx-hero .lede { font-size: 16px; }
  .sx-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sx-cta-strip { padding: 32px 24px; }
  .sx-cta-strip h2 { font-size: 24px; }
  .sx-container { padding: 0 20px; }
  .sx-nav-links { display: none; }
  .sx-search { display: none; }
  .sx-nav-toggle { display: inline-flex; }
  .sx-footer-grid { grid-template-columns: 1fr; }
  .sx-hero-strip { grid-template-columns: 1fr; }
  .sx-hero-strip > div { border-left: 0; padding: 8px 0 !important; border-top: 1px solid var(--sx-line); }
  .sx-hero-strip > div:first-child { border-top: 0; }
}

/* ---------- Hide legacy chrome on Sigrix-shell pages (replaced by sx-nav and sx-footer) ---------- */
body.home-page > header.site-header,
body.home-page > footer.site-footer,
body.sx-shell > header.site-header,
body.sx-shell > footer.site-footer { display: none; }

/* ---------- Match the new background on every page that opts into the shell ---------- */
body.home-page,
body.sx-shell { background: var(--sx-bg, #FAFAFB); }

/* ---------- Sticky nav fix ----------
 * base.css sets `html, body { overflow-x: hidden; }` which makes <body>
 * its own scroll container and breaks `position: sticky` on body's
 * direct children (the nav never moves because body itself doesn't
 * scroll — the window does). `overflow-x: clip` keeps the same
 * horizontal-overflow guard without creating a scroll container, so
 * sticky resolves against the window scroll like the mock expects. */
html:has(body.home-page),
html:has(body.sx-shell),
html:has(body.hub-page),
body.home-page,
body.sx-shell,
body.hub-page { overflow-x: clip; }

/* ---------- "Owned" / "Creator" pill on listing cover ---------- */
.sx-card-cover-owned {
  position: absolute; bottom: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 4px;
  background: rgba(31,157,85,0.14);
  color: var(--sx-ok, #1F9D55);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(31,157,85,0.30) inset;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1;
}

/* ---------- Hide cards filtered out by marketplace.js ---------- */
.sx-card.is-hidden { display: none !important; }

/* ---------- Quick add-to-cart button on listing card cover ---------- */
.sx-card-cart {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.78);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 4px 10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease, color 180ms ease;
  z-index: 2;
}
.sx-card-cart:hover { background: var(--sx-brand, #5B7CFF); color: #fff; }
.sx-card-cart:focus-visible {
  outline: none;
  opacity: 1;
  transform: translateY(0);
  box-shadow:
    0 0 0 2px var(--sx-bg, #FFFFFF),
    0 0 0 4px var(--sx-brand, #5B7CFF);
}
.sx-card:hover .sx-card-cart,
.sx-card:focus-within .sx-card-cart {
  opacity: 1;
  transform: translateY(0);
}
.sx-card-cart .sx-card-cart-icon-added { display: none; }
.sx-card-cart.is-added,
.sx-card-cart[data-in-cart="true"] {
  opacity: 1;
  transform: translateY(0);
  background: #2EBD85;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 4px 10px rgba(46, 189, 133, 0.35);
}
.sx-card-cart.is-added .sx-card-cart-icon-default,
.sx-card-cart[data-in-cart="true"] .sx-card-cart-icon-default { display: none; }
.sx-card-cart.is-added .sx-card-cart-icon-added,
.sx-card-cart[data-in-cart="true"] .sx-card-cart-icon-added { display: inline-block; }
[data-theme="light"] .sx-card-cart {
  background: rgba(255, 255, 255, 0.95);
  color: var(--sx-text);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.10) inset,
    0 4px 10px rgba(14, 19, 32, 0.12);
}
[data-theme="light"] .sx-card-cart:hover { background: var(--sx-brand, #5B7CFF); color: #fff; }
@media (hover: none) {
  .sx-card-cart { opacity: 1; transform: none; }
}

/* ============================================================
 * Dark theme overrides
 * ----------------------------------------------------------------
 * `data-theme="dark"` is set on <html> by the theme-toggle script
 * (src/templates/base.html). `.sx` lives on <body>, so the selector
 * `[data-theme="dark"] .sx` matches the body and any descendant with
 * `.sx-*` classes. We redefine the design tokens for dark and patch
 * the handful of elements that hard-code light colors.
 * Mirrors Sigrix_new/Sigrix Home.html and Sigrix_new/styles.css.
 * ============================================================ */
[data-theme="dark"] .sx {
  --sx-bg: #0B0D12;
  --sx-bg-2: #0F1218;
  --sx-surface: #14181F;
  --sx-surface-2: #1A1F28;
  --sx-line: #232936;
  --sx-line-2: #2C3342;
  --sx-text: #E7EAF0;
  --sx-text-2: #AAB2C0;
  --sx-text-3: #6B7382;
  --sx-mute: #4A5161;

  --sx-brand: #3D4DFF;
  --sx-brand-2: #1A1F6B;
  --sx-brand-3: #6B78FF;
  --sx-brand-ink: #FFFFFF;
  --sx-accent: #7CE3D4;
  --sx-warn: #F5B454;
  --sx-danger: #F47B7B;
  --sx-ok: #6EE7A1;

  color-scheme: dark;
}

/* Primary button — brighter top stop so it lifts off the dark surface */
[data-theme="dark"] .sx-btn--primary,
[data-theme="dark"] button.sx-btn--primary {
  background: linear-gradient(135deg, #6B78FF 0%, #1A1F6B 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 0 0 1px rgba(91,124,255,0.55), 0 1px 2px rgba(0,0,0,0.4);
}
[data-theme="dark"] .sx-btn--primary:hover { background: linear-gradient(135deg, #8089FF 0%, #1A1F6B 100%); }

/* Type chips — restore the dark-on-color variants from the design system */
[data-theme="dark"] .sx-chip--type-prompt    { color: #B7D5FF; box-shadow: 0 0 0 1px rgba(91,124,255,0.35) inset; background: rgba(91,124,255,0.08); }
[data-theme="dark"] .sx-chip--type-persona   { color: #FFD3B7; box-shadow: 0 0 0 1px rgba(245,180,84,0.30) inset; background: rgba(245,180,84,0.08); }
[data-theme="dark"] .sx-chip--type-agent     { color: #C2F5E6; box-shadow: 0 0 0 1px rgba(124,227,212,0.30) inset; background: rgba(124,227,212,0.08); }
[data-theme="dark"] .sx-chip--type-assistant { color: #E2C7FF; box-shadow: 0 0 0 1px rgba(180,140,255,0.30) inset; background: rgba(180,140,255,0.08); }
[data-theme="dark"] .sx-chip--type-product   { color: #FFB7C5; box-shadow: 0 0 0 1px rgba(244,123,160,0.30) inset; background: rgba(244,123,160,0.06); }
[data-theme="dark"] .sx-chip--ok             { color: var(--sx-ok); box-shadow: 0 0 0 1px rgba(110,231,161,0.3) inset; background: rgba(110,231,161,0.06); }

/* Glass nav over dark backdrop */
[data-theme="dark"] .sx-nav { background: rgba(11,13,18,0.72); }
[data-theme="dark"] .sx-kbd { background: var(--sx-bg); }

/* Theme-toggle thumb sits on dark surface, needs darker shadow */
[data-theme="dark"] .sx-theme-toggle-thumb {
  box-shadow: 0 0 0 1px var(--sx-line) inset, 0 1px 2px rgba(0,0,0,0.4);
}

/* Hero glow + grid lines */
[data-theme="dark"] .sx-hero-bg {
  background:
    radial-gradient(900px 400px at 20% 0%, rgba(61,77,255,0.22), transparent 60%),
    radial-gradient(700px 360px at 90% 20%, rgba(26,31,107,0.30), transparent 60%);
}
[data-theme="dark"] .sx-hero-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* Listing-card cover: dark gradient with white art and white-on-glass tags */
[data-theme="dark"] .sx-card-cover {
  background: linear-gradient(135deg, #1B2230 0%, #131722 100%);
}
[data-theme="dark"] .sx-card-cover-art { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .sx-card-cover-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  mix-blend-mode: normal;
  opacity: 1;
}
[data-theme="dark"] .sx-card-cover-tag .sx-chip {
  background: rgba(11,13,18,0.72);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset, 0 1px 2px rgba(0,0,0,0.25);
}
[data-theme="dark"] .sx-card-cover-price {
  background: rgba(11,13,18,0.72);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset, 0 1px 2px rgba(0,0,0,0.25);
}
[data-theme="dark"] .sx-avatar {
  background: linear-gradient(135deg, #2C3342, #1A1F28);
  color: var(--sx-text-2);
}
[data-theme="dark"] .sx-card:hover {
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 12px 30px -16px rgba(0,0,0,0.7);
  background: var(--sx-surface-2);
}

/* Quicklink dot — keep the brand gradient (no override needed) */

/* Founding panel — boost the indigo glow to read on the dark surface */
[data-theme="dark"] .sx-founding {
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(61,77,255,0.22), transparent 60%),
    radial-gradient(400px 200px at 0% 100%, rgba(26,31,107,0.18), transparent 60%),
    var(--sx-surface);
}
[data-theme="dark"] .sx-counter-cell .num {
  background: linear-gradient(135deg, #6B78FF 0%, #3D4DFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Updates / CTA strip */
[data-theme="dark"] .sx-update-card:hover {
  box-shadow: 0 0 0 1px var(--sx-line-2) inset, 0 12px 30px -16px rgba(0,0,0,0.7);
}
[data-theme="dark"] .sx-update-link { color: var(--sx-brand-3); }
[data-theme="dark"] .sx-cta-strip {
  background: radial-gradient(800px 300px at 100% 50%, rgba(91,124,255,0.16), transparent 60%), var(--sx-surface);
}

/* Body background: home + sx-shell pages keep the dark canvas */
[data-theme="dark"] body.home-page,
[data-theme="dark"] body.sx-shell { background: #0B0D12; }
