/* FrogStream — first-load splash
   Scoped to .splash-bg (wrapper inside #app) so these rules don't
   affect the mounted Blazor app after #app content is replaced. */

/* Tokens duplicated here because splash.css loads before site.css */
:root {
  --bg-deep: #100E0B;
  --text: #F6F1E9;
  --text-2: #C6BCAE;
  --muted: #8E8475;
  --green: #34B36B;
  --green-light: #3CC576;
  --green-deep: #1F8A4C;
  --track: rgba(255,255,255,.08);
  --ui: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html, body { margin: 0; height: 100%; background: var(--bg-deep); }

.splash-bg {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(620px 460px at 50% 38%, rgba(52,179,107,.16), transparent 64%),
    radial-gradient(900px 600px at 50% 120%, rgba(31,138,76,.10), transparent 70%),
    var(--bg-deep);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* faint background grid, masked to a soft vignette */
.splash-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(560px 420px at 50% 42%, #000 20%, transparent 78%);
  mask-image: radial-gradient(560px 420px at 50% 42%, #000 20%, transparent 78%);
  pointer-events: none;
}

.splash {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 24px;
  text-align: center;
  animation: splash-in .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes splash-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Logo ─────────────────────────────────────────────── */
.logo-stage {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
}
/* pulsing halo behind the tile */
.logo-stage::before {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 45%, rgba(60,197,118,.55), transparent 68%);
  filter: blur(14px);
  animation: halo 2.6s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { opacity: .5; transform: scale(.92); }
  50%      { opacity: .95; transform: scale(1.06); }
}

.logo-tile {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: block;
  box-shadow:
    0 18px 40px -14px rgba(31,138,76,.7),
    inset 0 0 0 1px rgba(255,255,255,.06);
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.015); }
}

/* flowing stream waves */
.wave { stroke-dasharray: 26 14; animation: flow 1.5s linear infinite; }
.wave.w2 { animation-duration: 2.1s; opacity: .55; }
@keyframes flow { to { stroke-dashoffset: -40; } }

/* occasional blink of the frog eyes */
.eye { transform-box: fill-box; transform-origin: center; animation: blink 4.2s ease-in-out infinite; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(.12); }
}

/* ── Wordmark ────────────────────────────────────────── */
.word {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
}
.word .frog { color: var(--green); }

/* ── Progress ────────────────────────────────────────── */
.progress {
  width: 240px;
  max-width: 72vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
/* real fill — driven by Blazor's boot variable (0 until set) */
.bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--blazor-load-percentage, 0) * 1%);
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-deep), var(--green-light));
  transition: width .35s cubic-bezier(.16,1,.3,1);
}
/* shimmer sweep — keeps the bar alive during JIT/init pauses */
.bar .shimmer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: sweep 1.25s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

.status {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--muted);
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.status .label { color: var(--text-2); }
/* live percentage from Blazor; falls back to a dot trail before boot starts */
.status .pct { color: var(--green); font-weight: 700; }
.status .pct::after { content: var(--blazor-load-percentage-text, "··"); }

.tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: -8px;
}

@media (prefers-reduced-motion: reduce) {
  .logo-tile, .logo-stage::before, .wave, .eye, .splash { animation: none !important; }
  .bar .shimmer { animation: none; opacity: .35; }
}
