/* ---------- Splash (index.html) ----------
   Shown from the first paint until the app is on screen: a CV sheet that writes itself, a real progress bar
   (Blazor sets --blazor-load-percentage while it downloads) and short tips. app.js fades it out. */

.splash {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, #3d5d6d 0%, #23343f 55%, #1a2730 100%);
  color: #dbe4ea;
  font-family: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  transition: opacity 380ms cubic-bezier(.2, .8, .2, 1), transform 380ms cubic-bezier(.2, .8, .2, 1);
}
.splash.splash-out { opacity: 0; transform: scale(1.02); pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(320px, 100%); }

.splash-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 26px; letter-spacing: .05em; color: #fff; }
.splash-logo { background: #4f7385; border-radius: 9px; padding: 2px 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }

/* The sheet: A4 proportions, a coloured side column like the default design. */
.splash-paper {
  position: relative; width: 180px; aspect-ratio: 210 / 297; display: grid; grid-template-columns: 34% 1fr;
  background: #fff; border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .2);
  animation: sp-float 4.8s ease-in-out infinite;
}
.sp-side { background: #7895a3; border-radius: 6px 0 0 6px; padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.sp-main { padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.splash-paper i {
  display: block; height: 4px; border-radius: 2px; background: #dfe5ea; transform-origin: left center;
  animation: sp-write .6s var(--d, 0s) cubic-bezier(.3, .7, .2, 1) both;
}
.sp-side i { background: rgba(255, 255, 255, .55); }
.splash-paper i.short { width: 62%; }
.sp-photo { width: 34px; height: 34px !important; border-radius: 6px !important; background: rgba(255, 255, 255, .7) !important; margin: 0 auto 6px; animation-name: sp-pop !important; }
.sp-side i.chip { width: 70%; height: 6px; border-radius: 3px; }
.sp-name { height: 8px !important; width: 78%; background: #2e4d5c !important; }
.sp-title { width: 50%; background: #9ab0bb !important; margin-bottom: 4px; }
.sp-head { width: 40%; height: 5px !important; background: #3d6274 !important; margin-top: 6px; }

.sp-badge {
  position: absolute; right: -10px; bottom: 14px; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; background: #1d7a45; color: #fff; font-size: 11px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  animation: sp-badge .5s 1.9s cubic-bezier(.3, 1.4, .5, 1) both;
}

/* Real progress: Blazor's download share, then the last stretch (data) once app.js marks it. */
.splash-progress { width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.splash-progress span {
  display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8cc4ff, #ffffff);
  width: max(6%, calc(var(--blazor-load-percentage, 0%) * .85));
  transition: width 300ms ease;
}
.splash.splash-data .splash-progress span { width: 94%; transition-duration: 1.6s; }
.splash.splash-out .splash-progress span { width: 100%; }

.splash-tip { margin: 0; min-height: 3em; text-align: center; font-size: 14px; line-height: 1.5; color: #c4d2da; transition: opacity 250ms ease; }
.splash-tip.fade { opacity: 0; }

@keyframes sp-write { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sp-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sp-badge { from { transform: scale(.5) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
/* After the sheet is written: a soft light sweeps across it while the app finishes loading. */
.splash-paper::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(140, 196, 255, .22) 50%, transparent 62%);
  background-size: 250% 100%; background-position: 130% 0;
  animation: sp-shine 2.2s 2.4s ease-in-out infinite;
}
@keyframes sp-shine { from { background-position: 130% 0; } to { background-position: -30% 0; } }@keyframes sp-float { 50% { transform: translateY(-5px); } }

/* "Reduce motion": a finished sheet, no movement. */
@media (prefers-reduced-motion: reduce) {
  .splash-paper, .splash-paper i, .sp-badge, .splash-paper::after { animation: none !important; }
  .splash-paper i { transform: none; opacity: 1; }
  .splash, .splash-tip, .splash-progress span { transition: none; }
}
