:root {
  color-scheme: dark;
  background: #981616;
  --scene-scale: 1;
}

* { box-sizing: border-box; }

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

.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #981616;
}

#atmosphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.brand {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(calc(580px * var(--scene-scale)), 84vw);
  aspect-ratio: 547.87 / 411.41;
  transform: translate(-50%, -50%);
  text-align: center;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center;
  filter: drop-shadow(0 0 9px #fff6d94d) drop-shadow(0 0 22px #fff0cc24);
  will-change: transform, opacity;
  animation: logo-arrive 4.2s cubic-bezier(0.12, 0.65, 0.2, 1) both,
    logo-reveal 0.45s linear both,
    logo-glow 5.5s ease-in-out 4.2s infinite;
}

@keyframes logo-arrive {
  from { transform: scale(6.5); }
  to { transform: scale(1); }
}

@keyframes logo-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes logo-glow {
  0%, 100% {
    filter: drop-shadow(0 0 9px #fff6d94d)
      drop-shadow(0 0 22px #fff0cc24);
  }
  50% {
    filter: drop-shadow(0 0 11px #fff8d980)
      drop-shadow(0 0 28px #ffdc7852);
  }
}

h1 {
  position: absolute;
  top: calc(100% + 4.8vh);
  left: 50%;
  width: max-content;
  max-width: 96vw;
  margin: 0;
  color: #e8d39a;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.7rem, 1.4vw, 1.7rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.035em;
  white-space: nowrap;
  text-shadow: 0 2px 14px #00000059;
  transform: translateX(-50%);
}

h1[hidden] { display: none; }
h1 span { display: inline-block; }
h1.entering span { animation: write-horizontal 1.8s steps(29, end) both; }

@keyframes write-horizontal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@media (max-width: 600px) {
  h1 {
    font-size: clamp(0.91rem, 2.99vw, 1.105rem);
    letter-spacing: 0.02em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo, h1.entering span { animation: none; }
}
