/* Xitoring splash screen — "Stillness"
   Scoped under .splash-screen so nothing leaks into the app. */

body {
  margin: 0;
  padding: 0;
}

:root {
  --splash-cyan: #0cb4c9;
  --splash-cyan-soft: rgba(12, 180, 201, 0.35);
  --splash-cyan-veil: rgba(12, 180, 201, 0.10);
  /* Dark defaults — overridden by [data-theme="light"] below. */
  --splash-bg: #0e1014;
  --splash-fg-1: #ffffff;
  --splash-fg-2: rgba(255, 255, 255, 0.50);
  --splash-fg-3: rgba(255, 255, 255, 0.28);
  --splash-line: rgba(255, 255, 255, 0.08);
  --splash-vignette-c: rgba(0, 0, 0, 0.30);
}

[data-theme="light"] {
  --splash-bg: #fbfcfd;
  --splash-fg-1: #0f1115;
  --splash-fg-2: rgba(20, 30, 40, 0.50);
  --splash-fg-3: rgba(20, 30, 40, 0.32);
  --splash-line: rgba(20, 30, 40, 0.10);
  --splash-vignette-c: rgba(20, 30, 40, 0.05);
}

[data-theme="dark"] {
  --splash-bg: #0e1014;
  --splash-fg-1: #ffffff;
  --splash-fg-2: rgba(255, 255, 255, 0.50);
  --splash-fg-3: rgba(255, 255, 255, 0.28);
  --splash-line: rgba(255, 255, 255, 0.08);
  --splash-vignette-c: rgba(0, 0, 0, 0.30);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--splash-bg);
  color: var(--splash-fg-1);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  transition: opacity 0.4s ease, visibility 0s 0s;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}

/* Soft cyan halo behind the mark */
.splash-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  height: 560px;
  transform: translate(-50%, -54%);
  background: radial-gradient(circle, var(--splash-cyan-veil) 0%, transparent 62%);
  pointer-events: none;
  opacity: 0;
  animation: splash-halo-in 1.4s 0.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes splash-halo-in {
  to { opacity: 1; }
}

/* Edge vignette */
.splash-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, var(--splash-vignette-c) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Centered stack */
.splash-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  z-index: 5;
}

/* Brand mark */
.splash-brand {
  width: 92px;
  height: 92px;
  color: var(--splash-cyan);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  animation:
    splash-brand-in 0.85s 0.12s cubic-bezier(0.22, 0.85, 0.30, 1) forwards,
    splash-brand-breathe 6s 1.4s infinite ease-in-out;
}

.splash-brand svg {
  width: 100%;
  height: 100%;
  display: block;
}

.splash-brand svg path,
.splash-brand svg g {
  fill: currentColor;
}

@keyframes splash-brand-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes splash-brand-breathe {
  0%, 100% { filter: drop-shadow(0 0 14px var(--splash-cyan-soft)); }
  50%      { filter: drop-shadow(0 0 24px var(--splash-cyan-soft)) drop-shadow(0 0 6px var(--splash-cyan-veil)); }
}

/* Wordmark */
.splash-wordmark {
  font-family: 'Manrope', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.48em;
  padding-left: 0.48em;
  color: var(--splash-fg-1);
  opacity: 0;
  transform: translateY(4px);
  user-select: none;
  animation: splash-fade-up 0.6s 0.45s cubic-bezier(0.22, 0.85, 0.30, 1) forwards;
}

@keyframes splash-fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Thin shimmer line — the only constantly-moving element */
.splash-shimmer {
  position: relative;
  width: 104px;
  height: 1.5px;
  background: var(--splash-line);
  border-radius: 999px;
  overflow: hidden;
  opacity: 0;
  animation: splash-fade-up 0.6s 0.75s cubic-bezier(0.22, 0.85, 0.30, 1) forwards;
}

.splash-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -45%;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent 0%, var(--splash-cyan) 50%, transparent 100%);
  box-shadow: 0 0 8px var(--splash-cyan-soft);
  animation: splash-slide 3.6s 1.1s infinite cubic-bezier(0.42, 0, 0.58, 1);
}

@keyframes splash-slide {
  0%   { left: -45%;  opacity: 0; }
  4%   { opacity: 1; }
  36%  { left: 100%;  opacity: 1; }
  42%  { left: 100%;  opacity: 0; }
  100% { left: -45%;  opacity: 0; }
}

/* Tagline (one phrase per page load, picked by inline script) */
.splash-tagline {
  margin-top: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--splash-fg-2);
  opacity: 0;
  min-height: 1.4em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  animation: splash-tagline-in 0.7s 1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes splash-tagline-in {
  from { opacity: 0; }
  to   { opacity: 0.72; }
}

/* Bottom branding signature */
.splash-signature {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--splash-fg-3);
  opacity: 0;
  z-index: 6;
  white-space: nowrap;
  animation: splash-fade-in 1s 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.splash-signature-sep {
  display: inline-block;
  margin: 0 10px;
  opacity: 0.6;
}

@keyframes splash-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Bottom rescue link — appears only after 5s */
.splash-rescue {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--splash-fg-2);
  letter-spacing: 0.04em;
  opacity: 0;
  z-index: 6;
  cursor: pointer;
  animation: splash-rescue-in 0.5s 5s forwards;
}

.splash-rescue-link {
  color: var(--splash-cyan);
  text-decoration: underline;
}

@keyframes splash-rescue-in {
  to { opacity: 0.6; }
}

/* Reduced-motion users get the static composition */
@media (prefers-reduced-motion: reduce) {
  .splash-screen *,
  .splash-screen *::before,
  .splash-screen *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .splash-screen .splash-tagline { opacity: 0.72; }
  .splash-screen .splash-signature { opacity: 1; }
  .splash-screen .splash-halo { opacity: 1; }
  .splash-screen .splash-brand,
  .splash-screen .splash-wordmark,
  .splash-screen .splash-shimmer { opacity: 1; transform: none; }
}
