/* GENERATED by brand/sync-brand.ps1 (tokens.css + splash/splash.css) - do not edit. */
/* Circuit design tokens. Palette and motion come from tokens.json (kit block below, generated); app aliases are edited here. */

/* BEGIN kit-tokens (generated from tokens.json by sync-brand.ps1 - edit tokens.json, not this block) */
:root {
  --circuit-navy-950: #040E24;
  --circuit-navy-900: #06142A;
  --circuit-navy-800: #0B2343;
  --circuit-blue-700: #0752A0;
  --circuit-blue-500: #1689E8;
  --circuit-blue-400: #32B3FF;
  --circuit-cyan-400: #45D9F4;
  --circuit-cyan-200: #8DEBFA;
  --circuit-white-ice: #F5F8FF;
  --circuit-text-muted: #A9C6DF;
  --circuit-background: #040E24;
  --circuit-surface: #06142A;
  --circuit-surface-raised: #0B2343;
  --circuit-primary: #1689E8;
  --circuit-primary-hover: #32B3FF;
  --circuit-highlight: #45D9F4;
  --circuit-text: #F5F8FF;
  --circuit-text-secondary: #A9C6DF;
  --circuit-border: #23405E;
  --circuit-motion-logo-enter: 700ms;
  --circuit-motion-glow-pulse: 3600ms;
  --circuit-motion-orbit-rotation: 45000ms;
  --circuit-motion-particle-drift: 8000ms;
  --circuit-motion-screen-exit: 350ms;
}
/* END kit-tokens */

/* App tokens: the names the apps, homepage and backend use, mapped onto the kit palette. */
:root {
  /* Brand */
  --navy: var(--circuit-navy-950);
  --navy-light: var(--circuit-navy-800);
  --navy-dark: var(--circuit-navy-900);
  --primary: var(--circuit-primary);
  --accent: var(--circuit-primary);
  --accent-dark: var(--circuit-blue-700);
  --accent-hover: var(--circuit-primary-hover);
  --highlight: var(--circuit-highlight);

  /* Surfaces */
  --bg: #f0f0f0;
  --bg-subtle: #f7f8fa;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --white: #ffffff;
  --border: #d4d4d4;
  --border-light: #e8e8e8;

  /* Text */
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;

  /* Status / palette */
  --green: #28a745;
  --orange: #fd7e14;
  --yellow: #ffc107;
  --red: #e74c3c;
  --grey: #6c757d;
  --purple: #9b59b6;
  --blue: var(--accent);
  --gold: #f39c12;

  /* Shape */
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);

  /* Login / splash backdrop */
  --brand-gradient: linear-gradient(135deg, var(--circuit-blue-700) 20%, var(--circuit-navy-800) 60%, var(--circuit-navy-950) 100%);

  /* Top bar across all apps */
  --topbar-gradient: linear-gradient(90deg, var(--circuit-blue-700) 0%, var(--circuit-navy-800) 55%, var(--circuit-navy-950) 100%);
}

/* Installed-app splash. Needs brand/tokens.css loaded first (sync-brand.ps1 prepends it). */

#brand-splash {
  --bs-logo: min(36vw, 170px);
  --bs-wave: 12000ms;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color: var(--circuit-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* Same flat color as the manifest background, so the OS launch screen hands off without a visible change. */
  background: var(--circuit-background);
}

#brand-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, var(--circuit-navy-800) 0%, var(--circuit-navy-900) 45%, var(--circuit-navy-950) 100%);
  animation: bs-fade var(--circuit-motion-logo-enter) ease-out both;
}

/* Shown only when launched as an installed app (or forced with ?splash=1). */
@media (display-mode: standalone), (display-mode: fullscreen) {
  #brand-splash { display: flex; }
  html { background: var(--circuit-background); }
}
html.bs-on #brand-splash { display: flex; }
#brand-splash [hidden] { display: none !important; }

#brand-splash.bs-exit {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--circuit-motion-screen-exit) ease-out;
}

.bs-center {
  position: relative;
  width: var(--bs-logo);
  z-index: 2;
}

.bs-halo {
  position: absolute;
  top: calc(var(--bs-logo) * 256 / 240 / 2);
  left: 50%;
  width: calc(var(--bs-logo) * 2.6);
  height: calc(var(--bs-logo) * 2.6);
  margin: calc(var(--bs-logo) * -1.3) 0 0 calc(var(--bs-logo) * -1.3);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--circuit-cyan-400) 30%, transparent) 0%, transparent 65%);
  animation: bs-glow var(--circuit-motion-glow-pulse) ease-in-out infinite;
}

/* Visible from the first frame (no fade-in) so it lines up with the OS launch-screen icon. */
.bs-logo {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

.bs-wordmark {
  position: absolute;
  top: 100%;
  left: -100%;
  right: -100%;
  margin-top: 20px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--circuit-white-ice);
  animation: bs-enter var(--circuit-motion-logo-enter) cubic-bezier(0.16, 1, 0.3, 1) 150ms both;
}
.bs-wordmark span {
  font-weight: 500;
  color: var(--circuit-text-muted);
}

.bs-orbit {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(120vw, 680px);
  height: min(120vw, 680px);
  opacity: 0.55;
  animation: bs-spin var(--circuit-motion-orbit-rotation) linear infinite;
}
.bs-orbit ellipse { fill: none; stroke: var(--circuit-blue-700); stroke-width: 0.6; }
.bs-orbit .bs-dot { fill: var(--circuit-cyan-400); }

.bs-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--circuit-cyan-200);
  opacity: 0.2;
  animation: bs-drift var(--circuit-motion-particle-drift) ease-in-out var(--d) infinite;
}

.bs-waves {
  position: absolute;
  left: -20%;
  bottom: 0;
  width: 140%;
  height: 26vh;
  animation: bs-wave var(--bs-wave) ease-in-out infinite alternate;
}
.bs-wave-fill { fill: color-mix(in srgb, var(--circuit-blue-700) 22%, transparent); }
.bs-wave-line { fill: none; stroke: var(--circuit-cyan-400); stroke-width: 1.5; opacity: 0.45; vector-effect: non-scaling-stroke; }
.bs-wave-line--2 { stroke: var(--circuit-blue-500); opacity: 0.35; }

.bs-env {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px);
  right: calc(env(safe-area-inset-right) + 16px);
  z-index: 3;
  padding: 4px 10px;
  border: 1px solid var(--circuit-cyan-400);
  border-radius: 12px;
  background: var(--circuit-surface-raised);
  color: var(--circuit-cyan-200);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bs-stall {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 32px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.bs-stall p { margin: 0; color: var(--circuit-text-secondary); font-size: 0.95rem; }
.bs-retry {
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--circuit-primary);
  color: var(--circuit-white-ice);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bs-retry:hover { background: var(--circuit-primary-hover); }

@keyframes bs-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bs-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bs-glow {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@keyframes bs-spin {
  to { transform: rotate(360deg); }
}
@keyframes bs-drift {
  0%, 100% { opacity: 0.15; transform: translate3d(0, 0, 0); }
  50%      { opacity: 0.8;  transform: translate3d(6px, -14px, 0); }
}
@keyframes bs-wave {
  from { transform: translate3d(-5%, 0, 0); }
  to   { transform: translate3d(5%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .bs-orbit, .bs-particle, .bs-waves, .bs-halo, .bs-wordmark, #brand-splash::before { animation: none; }
  .bs-particle { opacity: 0.4; }
  #brand-splash.bs-exit { transition-duration: 120ms; }
}
