/* ==========================================================================
   SignalBX website — production polish layer (loaded last on every page)
   Visual only. Prefixed with `html` so it wins over page stylesheets.
   ========================================================================== */

html { background: var(--c-bg); }
html body {
  color: var(--c-text);
  background: var(--c-surface);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html h1, html h2, html h3 { color: var(--c-text); text-wrap: balance; }
html h1 { letter-spacing: var(--tracking-tighter); }
html h2 { letter-spacing: -0.03em; }
html h3 { letter-spacing: var(--tracking-snug); }
html p { text-wrap: pretty; }
html ::selection { color: var(--c-text); background: color-mix(in srgb, var(--c-primary) 26%, transparent); }

/* ---------- Focus ---------- */
html :focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; }
html summary:focus-visible { border-radius: var(--r-xs); }
html .skip-link { border-radius: var(--r-sm); color: var(--c-on-action); background: var(--c-action); box-shadow: var(--shadow-lg); }

/* ---------- Motion primitives ---------- */
html a, html button, html summary, html input, html select, html textarea {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: var(--dur-fast);
  transition-timing-function: var(--ease-out);
}
@keyframes sbx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sbx-float { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-2%, 3%, 0) scale(1.06); } }
@keyframes sbx-border-spin { to { --sbx-angle: 360deg; } }
@keyframes sbx-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-accent) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@property --sbx-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- Header: frosted pill ---------- */
html .header-inner.nav-pill,
html .site-header .header-inner {
  border-color: color-mix(in srgb, var(--c-border) 80%, transparent);
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: var(--shadow-md);
}
html .brand, html .brand span { color: var(--c-text); font-weight: 700; letter-spacing: var(--tracking-tight); }
html .site-nav a { color: var(--c-text-secondary); border-radius: var(--r-full); }
html .site-nav a:hover { color: var(--c-text); background: var(--c-surface-muted); }
html .nav-menu summary { border-radius: var(--r-sm); color: var(--c-text); }
html .nav-menu[open] nav { border-color: var(--c-border); background: var(--c-surface-raised); box-shadow: var(--shadow-lg); animation: sbx-rise var(--dur-base) var(--ease-out); }

/* ---------- Buttons ---------- */
html .button, html .home-button, html .wb-button {
  font-weight: 600;
  letter-spacing: -0.005em;
  -webkit-user-select: none;
  user-select: none;
}
html .button-primary, html .home-button-primary, html .wb-button-primary {
  color: var(--c-on-action);
  border-color: var(--c-action);
  background: var(--c-action);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), var(--shadow-sm);
}
html .button-primary:hover, html .home-button-primary:hover, html .wb-button-primary:hover {
  color: var(--c-on-action);
  border-color: var(--c-action-hover);
  background: var(--c-action-hover);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 10px 24px -10px var(--c-glow-primary), var(--shadow-md);
  transform: translateY(-1px);
}
html .button-quiet, html .header-actions .button-quiet, html .home-button-secondary, html .wb-button-secondary {
  color: var(--c-text);
  border-color: var(--c-border-strong);
  background: var(--c-surface);
  box-shadow: var(--shadow-xs);
}
html .button-quiet:hover, html .home-button-secondary:hover, html .wb-button-secondary:hover {
  border-color: var(--c-text-subtle);
  background: var(--c-surface-sunken);
  transform: translateY(-1px);
}
html .button:active, html .home-button:active, html .wb-button:active { transform: translateY(0) scale(.98); }
html .button:focus-visible, html .home-button:focus-visible, html .wb-button:focus-visible { outline: none; box-shadow: var(--ring); }
html .home-button span, html .wb-button span { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
html .home-button:hover span, html .wb-button:hover span { transform: translateX(3px); }

/* ---------- Kickers ---------- */
html .section-kicker { color: var(--c-text-muted); letter-spacing: 0; }
html .kicker-icon { color: var(--c-accent-ink); background: var(--c-accent); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); }

/* ==========================================================================
   Signature moment #1 — hero aurora
   A slow, blurred brand-light field fills the hero's open right side.
   ========================================================================== */
html .home-hero { position: relative; isolation: isolate; overflow: hidden; }
html .home-hero::before,
html .home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
}
html .home-hero::before {
  width: min(620px, 60vw);
  aspect-ratio: 1;
  top: -18%;
  right: -8%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--p-blue-400) 55%, transparent), transparent 62%);
  opacity: .55;
  animation: sbx-float 16s var(--ease-in-out) infinite;
}
html .home-hero::after {
  width: min(460px, 48vw);
  aspect-ratio: 1;
  bottom: -30%;
  right: 14%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--p-mint-400) 50%, transparent), color-mix(in srgb, var(--p-lime-400) 22%, transparent) 45%, transparent 66%);
  opacity: .5;
  animation: sbx-float 20s var(--ease-in-out) infinite reverse;
}
html .home-hero-copy > * { animation: sbx-rise .6s var(--ease-out) both; }
html .home-hero-copy > *:nth-child(2) { animation-delay: 60ms; }
html .home-hero-copy > *:nth-child(3) { animation-delay: 120ms; }
html .home-hero-copy > *:nth-child(4) { animation-delay: 180ms; }
html .home-hero .kicker-icon { animation: sbx-pulse 2.8s ease-in-out infinite; }
html .home-hero h1 { color: var(--c-text); }
html .home-hero-lede { color: var(--c-text-secondary); }

/* ==========================================================================
   Signature moment #2 — gradient edge on the primary product card
   ========================================================================== */
html .product-feature:first-of-type .product-art,
html #product .product-art {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--c-surface), var(--c-surface)) padding-box,
    conic-gradient(from var(--sbx-angle), var(--p-blue-400), var(--p-mint-400), var(--p-lime-400), var(--c-border) 40%, var(--c-border) 70%, var(--p-blue-400)) border-box;
  box-shadow: 0 30px 60px -30px var(--c-glow-primary), 0 18px 36px -24px var(--c-glow-mint);
  animation: sbx-border-spin 10s linear infinite;
}

/* Product mock cards lift subtly */
html .product-art { border-color: var(--c-border); background: var(--c-surface); transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out); }
html .product-art:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* ---------- Feature cards ("Learn more" grid) ---------- */
html .system-grid > * { transition: background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
html .system-grid > *:hover { background: var(--c-surface-sunken); }
html .system-grid a { color: var(--c-text); font-weight: 600; }
html .system-grid a:hover { color: var(--c-primary); }
html .system-grid a span { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
html .system-grid a:hover span { transform: translateX(3px); }

/* ---------- FAQ ---------- */
html .faq-list summary { color: var(--c-text); border-radius: var(--r-xs); }
html .faq-list summary:hover { color: var(--c-primary); }
html .faq-list summary::after { transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast); }
html .faq-list details[open] summary::after { color: var(--c-primary); transform: rotate(180deg); }
html .faq-list details[open] p { animation: sbx-rise var(--dur-slow) var(--ease-out); }
html .faq-list details p { color: var(--c-text-secondary); }

/* ---------- Tables / comparison ---------- */
html .detail-table code, html code { border-radius: var(--r-xs); }

/* ---------- Blog & legal ---------- */
html .legal-content a, html .blog-post a:not([class]), html .post-body a { color: var(--c-primary); text-underline-offset: 3px; }


/* ---------- Auth pages ---------- */
html .auth-page { font-family: var(--font-sans); }

/* ---------- Dark theme: keep intentionally dark sections distinct ---------- */
:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .closing-section { border-top: 1px solid var(--c-border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-footer { border-top: 1px solid var(--c-border); }
  :root:not([data-theme="light"]) .home-hero::before { opacity: .35; }
  :root:not([data-theme="light"]) .home-hero::after { opacity: .3; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html *, html *::before, html *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  html .home-hero::before, html .home-hero::after, html #product .product-art, html .product-feature:first-of-type .product-art { animation: none !important; }
}

/* ---------- Overflow fix: operations panel clipped between 760–980px ---------- */
@media (max-width: 980px) {
  html .operations-panel { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 980px) and (min-width: 761px) {
  html .workspace-app { grid-template-columns: 56px 132px minmax(0, 1fr); }
}

/* Comparison marks: legible glyphs on their discs */
html .check { color: var(--p-navy-900); }
html .cross { color: var(--c-text-muted); background: var(--c-surface-muted); }

/* Dark theme: lime-tinted selections become deep olive so nested text stays legible */
:root[data-theme="dark"] .conversation-list article.is-selected,
:root[data-theme="dark"] .inbox-list article.is-selected { background: var(--c-accent-soft); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .conversation-list article.is-selected,
  :root:not([data-theme="light"]) .inbox-list article.is-selected { background: var(--c-accent-soft); }
}
