:root {
  --blue: #025cf3;
  --blue-bright: #0a66ff;
  --blue-deep: #0140b8;
  --blue-night: #012f8a;
  --ink: #ffffff;
  --ink-quiet: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.72);
  --veil: rgba(255, 255, 255, 0.14);
  --font: "Unbounded", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background-color: var(--blue);
  background-image: radial-gradient(120% 95% at 50% 40%, var(--blue-bright) 0%, var(--blue) 40%, var(--blue-deep) 78%, var(--blue-night) 100%);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--blue);
}

.brand {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}

.gl-ready .scene {
  opacity: 1;
}

/* Sans WebGL (ou sans JS), le titre reste la page. */
.title {
  margin: 0;
  padding-inline: var(--gutter);
  font-size: clamp(2.75rem, 11vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-align: center;
}

.title span {
  display: block;
}

.gl-ready .title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 var(--gutter) max(20px, env(safe-area-inset-bottom));
}

.hint {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-quiet);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: right;
}

.toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.toggle:hover {
  border-color: var(--ink);
  background-color: var(--veil);
}

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

.toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.toggle[data-state="playing"] [data-icon="play"],
.toggle[data-state="paused"] [data-icon="pause"] {
  display: none;
}

/* Le bouton n'a de sens qu'une fois la scène 3D en route. */
html:not(.gl-ready) .bar {
  visibility: hidden;
}
