:root {
  color-scheme: dark;
  --rose: #f2a7c3;
  --ink: #f6e7ee;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(115vmax 85vmax at 50% 34%, #2c1932 0%, #1a0f22 36%, #0b0712 68%, #050409 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Halo très doux derrière le bouquet. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(58vmax 58vmax at 50% 44%, rgba(255, 170, 205, 0.075), transparent 62%);
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s ease;
  touch-action: manipulation;
}

#scene.is-ready {
  opacity: 1;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(130% 100% at 50% 45%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

.masthead {
  position: fixed;
  z-index: 4;
  top: calc(env(safe-area-inset-top, 0px) + 22px);
  left: calc(env(safe-area-inset-left, 0px) + 24px);
  pointer-events: none;
  user-select: none;
}

.masthead h1 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 1.25vw, 18px);
  letter-spacing: 0.06em;
  color: rgba(255, 221, 236, 0.72);
  text-shadow: 0 0 22px rgba(242, 167, 195, 0.28);
}

.masthead p {
  margin: 7px 0 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 221, 236, 0.52);
  transition: opacity 1.2s ease;
}

.masthead p.is-hidden {
  opacity: 0;
}

.controls {
  position: fixed;
  z-index: 5;
  right: calc(env(safe-area-inset-right, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  gap: 10px;
}

.btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 232, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: #f7dbe7;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 214, 232, 0.32);
}

.btn:focus-visible {
  outline: 1px solid rgba(255, 214, 232, 0.6);
  outline-offset: 3px;
}

.btn:active {
  transform: scale(0.94);
}

.btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn .ico-off {
  display: none;
}

.btn.is-off .ico-on {
  display: none;
}

.btn.is-off .ico-off {
  display: block;
}

/* Tant que le son n'a pas démarré, le bouton respire doucement. */
.btn.is-idle {
  animation: breathe 3.4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 167, 195, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(242, 167, 195, 0.08);
  }
}

.noscript {
  position: fixed;
  inset: auto 0 50% 0;
  z-index: 6;
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 221, 236, 0.7);
}

@media (max-width: 520px) {
  .masthead {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: calc(env(safe-area-inset-left, 0px) + 18px);
  }

  .btn {
    width: 38px;
    height: 38px;
  }

  .btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #scene {
    transition-duration: 0.01s;
  }

  .btn.is-idle {
    animation: none;
  }
}
