/* splat.ai shared design tokens + nav/footer shell.
   Mirrors the Claude Design prototype (Monitoring.dc.html / Nav.dc.html / Footer.dc.html). */

/* Q3 — metric-matched fallbacks so the webfont swap doesn't reflow (values
   approximate the loaded faces; tuned by eye against Arial/Courier New) */
@font-face {
  font-family: 'Space Grotesk Fallback';
  src: local('Arial');
  size-adjust: 105%; ascent-override: 93%; descent-override: 27%; line-gap-override: 0%;
}
@font-face {
  font-family: 'IBM Plex Sans Fallback';
  src: local('Arial');
  size-adjust: 102%; ascent-override: 100%; descent-override: 27%; line-gap-override: 0%;
}
@font-face {
  font-family: 'IBM Plex Mono Fallback';
  src: local('Courier New');
  size-adjust: 100%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%;
}

:root {
  --bg: #0a0b10;
  --panel: #12141b;
  --panel-active: #171a24;
  --panel-deep: #0d0e14;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f6;
  --muted: rgba(244, 244, 246, 0.55);
  --faint: rgba(244, 244, 246, 0.45);
  --accent: #ff6b4a;
  --accent-hover: #ff8a6e;
  --blue: #5b8cff;
  --blue-hover: #7da3ff;
  --green: #4ade80;
  --font-head: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  --font-body: 'IBM Plex Sans', 'IBM Plex Sans Fallback', sans-serif;
  --font-mono: 'IBM Plex Mono', 'IBM Plex Mono Fallback', ui-monospace, monospace;
  /* motion tokens */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 350ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-pop: cubic-bezier(0.2, 0.7, 0.3, 1.3); /* movement with overshoot */
}

::selection { background: var(--accent); color: var(--bg); }

/* G5 — cross-document crossfade on same-origin navigations (progressive) */
@view-transition { navigation: auto; }

/* Q5 — themed scrollbars on a near-black UI */
:root { scrollbar-color: #2a2e3d var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2e3d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #363b4d; }

/* Q10 — inputs ease their focus border everywhere */
input, textarea, select { transition: border-color 0.15s ease; }

/* Q7 — thumbnails fade in over their gradient placeholders once loaded */
img.sa-fade { opacity: 0; transition: opacity 0.3s ease; }
img.sa-fade.on { opacity: 1; }

@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes menuOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-5px); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

/* G3 — popover/menu exit: add .closing, hide after 130ms (see saMenu in nav.js) */
.sa-create-menu.closing, .sa-account-pop.closing, .sa-drawer.closing, .share-pop.closing {
  animation: menuOut 130ms ease both;
}

/* G2 — shared button motion. Per-page rules must NOT redeclare `transition`
   on these classes (theme.css loads first and would lose the cascade). */
.sa-create-btn, .btn-solid, .btn-ghost, .btn-go, .btn-plain, .go, .cta, .publish, .bar-btn {
  transition: transform var(--dur-base) var(--ease-pop), box-shadow var(--dur-base) ease,
    background 150ms ease, border-color 150ms ease, color 150ms ease, filter 150ms ease;
}
.sa-create-btn:hover, .btn-solid:hover, .btn-ghost:hover, .btn-go:hover, .btn-plain:hover,
.go:hover, .cta:hover, .publish:hover, .bar-btn:hover { transform: translateY(-1px); }
/* accent-filled buttons get a soft neutral lift on hover, not a glow */
.btn-solid:hover, .btn-go:hover, .go:hover, .cta:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.sa-create-btn:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.sa-create-btn.glow:hover { box-shadow: 0 0 0 2px rgba(255, 107, 74, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3); }
/* full-size CTAs lift a touch more */
.hero-ctas .btn-solid:hover, .hero-ctas .btn-ghost:hover,
.cta-band .btn-solid:hover, .cta-band .btn-ghost:hover, .cta:hover { transform: translateY(-2px); }
.hero-ctas .btn-solid:hover, .cta-band .btn-solid:hover, .cta:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38); }
.sa-create-btn:active, .btn-solid:active, .btn-ghost:active, .btn-go:active, .btn-plain:active,
.go:active, .cta:active, .publish:active, .bar-btn:active { transform: translateY(0) scale(0.97); }
.sa-create-btn:focus-visible, .btn-solid:focus-visible, .btn-go:focus-visible,
.go:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 107, 74, 0.6);
}
.btn-ghost:focus-visible, .btn-plain:focus-visible, .publish:focus-visible, .bar-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(91, 140, 255, 0.55);
}

/* ---- nav (injected by nav.js) ---- */
.sa-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 clamp(16px, 3vw, 32px); height: 52px; flex: none;
  background: rgba(13, 14, 20, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
}
.sa-nav-left { display: flex; align-items: center; gap: 22px; min-height: 52px; }
.sa-nav-right { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.sa-nav-sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.1); display: inline-block; }
.sa-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.sa-logo span {
  font-family: var(--font-head); font-weight: 600; font-size: 15.5px;
  letter-spacing: -0.02em; color: var(--text);
}
.sa-nav-links { display: flex; align-items: center; gap: 20px; }
.sa-nav-link {
  display: flex; align-items: center; gap: 7px; text-decoration: none;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: rgba(244, 244, 246, 0.6);
  transition: color 0.15s ease; padding: 4px 0; white-space: nowrap;
}
.sa-nav-link:hover { color: var(--text); }
.sa-nav-link .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); display: inline-block;
  transition: background 0.15s ease;
}
.sa-nav-link.active { color: var(--text); }
.sa-nav-link.active .dot { background: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
.sa-nav-link.soon, .sa-auth-link.soon { opacity: 0.45; cursor: default; }
.sa-nav-link.soon:hover { color: rgba(244, 244, 246, 0.52); }
.sa-auth-link { text-decoration: none; font-size: 13px; color: var(--muted); transition: color 0.15s ease; }
.sa-auth-link:hover { color: var(--text); }
.sa-auth-link.soon:hover { color: var(--muted); }

/* hamburger + drawer (mobile nav) */
.sa-burger {
  display: none; cursor: pointer; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; background: transparent; border: none;
  color: var(--text); border-radius: 5px;
}
.sa-burger:hover { background: rgba(255, 255, 255, 0.06); }
.sa-drawer {
  display: none; position: fixed; top: 52px; left: 0; right: 0; z-index: 49;
  background: rgba(13, 14, 20, 0.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px clamp(16px, 3vw, 32px) 16px;
  flex-direction: column; gap: 2px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  animation: menuIn 0.16s ease;
  overscroll-behavior: contain;
}
.sa-drawer .sa-nav-link { padding: 11px 4px; font-size: 14px; }
.sa-drawer .divider { height: 1px; background: var(--border); margin: 8px 0; }
.sa-drawer .sa-auth-link { padding: 11px 4px; display: block; }
.sa-drawer.open { display: flex; }

@media (max-width: 760px) {
  .sa-nav { gap: 10px; }
  .sa-nav-left { gap: 12px; }
  .sa-nav-left .sa-nav-sep { display: none; }
  .sa-nav-left .sa-nav-links { display: none; }
  .sa-nav-right .sa-auth-link { display: none; }
  .sa-nav-right .sa-account-wrap { display: none; }
  .sa-burger { display: flex; }
}

/* Create dropdown */
.sa-create-wrap { position: relative; }
.sa-create-btn {
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; background: var(--accent); color: var(--bg);
  border: none; border-radius: 3px; font-size: 13px; font-weight: 600;
  font-family: var(--font-body);
  width: auto;
}
.sa-create-btn:hover { filter: brightness(1.08); }
.sa-create-btn.glow { box-shadow: 0 0 0 2px rgba(255, 107, 74, 0.35); }
.sa-create-btn svg { transition: transform 0.18s ease; }
.sa-create-btn.open svg { transform: rotate(180deg); }
.sa-create-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 268px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 6px; z-index: 60;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.16s ease;
  overscroll-behavior: contain;
}
.sa-create-menu .group {
  font-size: 11px; font-weight: 600;
  color: rgba(244, 244, 246, 0.45); padding: 8px 10px 6px;
}
.sa-create-menu .divider { height: 1px; background: var(--border); margin: 6px 10px; }
.sa-create-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px;
  border-radius: 6px; text-decoration: none; transition: background 0.13s ease;
}
.sa-create-item:hover { background: #1c1f2a; }
.sa-create-item svg { flex: none; margin-top: 1px; }
.sa-create-item .t { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); }
.sa-create-item .d { display: block; font-size: 11.5px; color: rgba(244, 244, 246, 0.5); margin-top: 1px; }
.sa-create-item.soon { opacity: 0.45; cursor: default; }
.sa-create-item.soon:hover { background: none; }

/* J1 — nav job tray (injected by nav.js while jobs run) */
.sa-tray-wrap { position: relative; display: inline-flex; }
.sa-tray-chip {
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  background: rgba(91, 140, 255, 0.08); border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 999px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--blue-hover); font-variant-numeric: tabular-nums; width: auto;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.15s ease;
}
.sa-tray-chip:active { transform: scale(0.96); }
.sa-tray-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
  animation: pulse 1.4s ease-in-out infinite; transition: background 0.3s ease; }
.sa-tray-chip.done { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.45);
  color: var(--green); }
.sa-tray-chip.done .dot { background: var(--green); animation: none; }
.sa-tray-pop {
  position: absolute; top: calc(100% + 10px); right: 0; width: 280px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 14px; z-index: 70; animation: menuIn 0.16s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.55);
}
.sa-tray-pop.closing { animation: menuOut 130ms ease both; }
.sa-tray-pop .k { font-size: 11px; font-weight: 600;
  color: rgba(244, 244, 246, 0.45); margin-bottom: 10px; }
.sa-tray-job { display: flex; gap: 12px; align-items: center; text-decoration: none;
  color: var(--text); padding: 6px 0; }
.sa-tray-job .th { width: 38px; height: 30px; border-radius: 4px; flex: none; background: #181b24; }
.sa-tray-job .bd { flex: 1; min-width: 0; }
.sa-tray-job .nm { font-size: 12.5px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.sa-tray-job .stg { font-family: var(--font-mono); font-size: 10px; color: rgba(244, 244, 246, 0.4);
  margin-top: 2px; font-variant-numeric: tabular-nums; }
.sa-tray-job .bar { height: 3px; background: rgba(255, 255, 255, 0.07); border-radius: 2px;
  overflow: hidden; margin-top: 6px; }
.sa-tray-job .bar div { height: 100%; background: var(--blue); border-radius: 2px;
  transition: width 0.4s linear, background 0.3s ease; }
.sa-tray-open { display: flex; justify-content: center; margin-top: 12px; padding: 8px;
  background: var(--accent); color: var(--bg); border-radius: 4px; font-size: 12.5px;
  font-weight: 600; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease; }
.sa-tray-open:hover { background: var(--accent-hover); transform: translateY(-1px); }
.sa-tray-open:active { transform: scale(0.97); }

/* Account chip + popover (injected by nav.js when logged in) */
.sa-account-wrap { position: relative; display: inline-flex; }
.sa-account-chip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 4px 0; font: inherit; font-size: 13px;
  color: rgba(244, 244, 246, 0.85);
}
.sa-account-chip:hover { color: var(--text); }
.sa-account-chip svg { transition: transform 0.18s ease; }
.sa-account-chip[aria-expanded="true"] svg { transform: rotate(180deg); }
.sa-account-pop {
  position: absolute; top: calc(100% + 12px); right: 0; width: 252px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 12px; z-index: 60;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: menuIn 0.16s ease; font-family: var(--font-body);
  overscroll-behavior: contain;
}
.sa-account-pop .who { font-size: 12px; color: var(--muted); line-height: 1.5; word-break: break-all; }
.sa-account-pop .who b { color: var(--text); font-weight: 500; }
.sa-account-pop .who .adm {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--blue); text-transform: uppercase; margin-left: 4px;
}
.sa-account-pop .divider { height: 1px; background: var(--border); margin: 10px -2px; }
.sa-account-pop .group {
  font-size: 11px; font-weight: 600;
  color: rgba(244, 244, 246, 0.45); margin-bottom: 8px;
}
.sa-pass-form { display: flex; flex-direction: column; gap: 8px; }
.sa-pass-form input {
  width: 100%; background: var(--panel-deep); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 8px 10px; font-family: var(--font-body); font-size: 13px;
}
.sa-pass-form input:focus { outline: none; border-color: rgba(91, 140, 255, 0.55); }
.sa-pass-form input::placeholder { color: var(--faint); }
.sa-pass-form button {
  cursor: pointer; padding: 8px 12px; background: var(--accent); color: var(--bg);
  border: none; border-radius: 4px; font-family: var(--font-body);
  font-size: 12.5px; font-weight: 600; transition: filter 0.15s ease;
}
.sa-pass-form button:hover { filter: brightness(1.08); }
.sa-pass-form button:disabled { opacity: 0.55; cursor: default; }
.sa-drawer-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  text-align: left; width: 100%;
}

/* ---- footer (injected by nav.js when data-footer) ---- */
.sa-footer {
  padding: 40px clamp(20px, 4vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--border); font-family: var(--font-body); background: var(--bg);
}
.sa-footer .brand { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sa-footer .brand b { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--text); }
.sa-footer .brand small { font-size: 13px; color: rgba(244, 244, 246, 0.4); margin-left: 6px; }
.sa-footer .links { display: flex; gap: 22px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.sa-footer .links a { color: var(--muted); text-decoration: none; }
.sa-footer .links a:hover { color: var(--text); }
.sa-footer .links .copy { font-family: var(--font-mono); color: rgba(244, 244, 246, 0.3); }

@media (max-width: 640px) {
  .sa-footer { padding: 28px clamp(16px, 4vw, 56px); }
  .sa-create-menu { width: min(268px, calc(100vw - 32px)); }
}

/* ---- shared page bits ---- */
.eyebrow {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
}
.mono-label {
  font-size: 12px; font-weight: 500;
  color: var(--muted);
}

/* G6 — reduced motion: collapse all animation to a single instant frame.
   Entrance keyframes use fill modes, so content lands in its final visible state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
