/* SYVAL splash + monogramme animé — partagé par index.html (boot) et app-syval-mark (accueil) */
:root {
  --syval-orange: #f08418;
  --syval-blue: #2d62ac;
  --syval-halo: rgba(45, 98, 172, 0.55);
  --syval-dot: #2d62ac;
}

html[data-syval-theme="dark"] #syval-splash,
#syval-splash[data-theme="dark"],
.dark .syval-mark-stage,
.dark-theme .syval-mark-stage {
  --syval-halo: rgba(45, 98, 172, 0.7);
  --syval-dot: #7aa0d6;
}

/* ----- Overlay de démarrage ----- */
#syval-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #f5f7fa;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
html[data-syval-theme="dark"] #syval-splash,
#syval-splash[data-theme="dark"] {
  background: #0a0d10;
}
#syval-splash.syval-splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#syval-splash .syval-mark-stage {
  width: min(320px, 72vw);
}

/* ----- Monogramme ----- */
.syval-mark-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.syval-halo {
  position: absolute;
  left: 50%;
  top: 62%;
  width: 108%;
  height: 72%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at 50% 40%, var(--syval-halo) 0%, transparent 70%);
  filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.syval-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.syval-mark-stage .sy { opacity: 0; transform: translateX(-22px); }
.syval-mark-stage .al { opacity: 0; transform: translateX(22px); }
.syval-mark-stage image.check { opacity: 1; }

.syval-check-stroke {
  fill: none;
  stroke: #fff;
  stroke-width: 320;
  stroke-linecap: round;
  stroke-linejoin: miter;
  stroke-miterlimit: 12;
}

.syval-mark { transform-origin: 50% 52%; transform-box: fill-box; }

.syval-mark-stage.playing .sy {
  animation: syval-fade-in-sy 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.syval-mark-stage.playing .al {
  animation: syval-fade-in-al 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.syval-mark-stage.playing .syval-check-stroke {
  animation: syval-draw-check 0.8s cubic-bezier(0.55, 0.05, 0.25, 1) 0.35s forwards;
}
.syval-mark-stage.playing .syval-mark {
  animation: syval-pulse 0.35s ease-in-out 1.15s both;
}
.syval-mark-stage.playing .syval-halo,
.syval-mark-stage.settled .syval-halo {
  animation: syval-breathe 2.6s ease-in-out 1.45s infinite;
}
.syval-mark-stage.settled .syval-halo {
  animation-delay: 0s;
}
.syval-mark-stage.show-dots.playing .syval-dots {
  animation: syval-dots-in 0.35s ease-out 1.45s both;
}
.syval-mark-stage.show-dots.playing .syval-dots span {
  animation: syval-dot-pulse 1.15s ease-in-out 1.45s infinite;
}
.syval-mark-stage.show-dots.playing .syval-dots span:nth-child(2) { animation-delay: 1.60s; }
.syval-mark-stage.show-dots.playing .syval-dots span:nth-child(3) { animation-delay: 1.75s; }

/* État final (après le boot, ou prefers-reduced-motion) */
.syval-mark-stage.settled .sy,
.syval-mark-stage.settled .al {
  opacity: 1;
  transform: none;
}
.syval-mark-stage.settled .syval-check-stroke {
  stroke-dashoffset: 0;
}

@keyframes syval-fade-in-sy {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes syval-fade-in-al {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes syval-draw-check {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
@keyframes syval-pulse {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes syval-breathe {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.94); }
  50%      { opacity: 0.9; transform: translate(-50%, -50%) scale(1.12); }
}
@keyframes syval-dots-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes syval-dot-pulse {
  0%, 100% { opacity: 0.28; transform: scale(0.75); }
  50%      { opacity: 0.95; transform: scale(1); }
}

.syval-dots {
  z-index: 1;
  display: none;
  gap: 0.42rem;
  margin-top: 1.35rem;
  opacity: 0;
  height: 0.55rem;
  align-items: center;
  justify-content: center;
}
.syval-mark-stage.show-dots .syval-dots { display: flex; }
.syval-dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--syval-dot);
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .syval-mark-stage.playing .sy,
  .syval-mark-stage.playing .al,
  .syval-mark-stage.settled .sy,
  .syval-mark-stage.settled .al {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .syval-mark-stage.playing .syval-check-stroke,
  .syval-mark-stage.settled .syval-check-stroke {
    animation: none !important;
    stroke-dashoffset: 0;
  }
  .syval-mark-stage.playing .syval-mark { animation: none !important; transform: none; }
  .syval-mark-stage.playing .syval-halo,
  .syval-mark-stage.settled .syval-halo {
    animation: none !important;
    opacity: 0.5;
    transform: translate(-50%, -50%);
  }
  .syval-mark-stage.playing .syval-dots,
  .syval-mark-stage.playing .syval-dots span {
    animation: none !important;
    opacity: 0.7;
    transform: none;
  }
  #syval-splash { transition: none; }
}
