:root {
  --void: #03040a;
  --text: #f3f6ff;
  --muted: rgba(214, 222, 255, 0.72);
  --cyan: #3cf0ff;
  --violet: #8b6cff;
  --magenta: #ff4fd8;
  --display: "Syne", "Noto Sans KR", system-ui, sans-serif;
  --kr: "Noto Sans KR", system-ui, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --track: 0.18em;
}

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

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--void);
  color: var(--text);
  font-family: var(--kr);
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--void);
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.no-webgl #world { visibility: hidden; }

.fallback-glow {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 34% at 50% 54%, rgba(60, 240, 255, 0.2), transparent 58%),
    radial-gradient(ellipse 36% 28% at 50% 46%, rgba(139, 108, 255, 0.22), transparent 52%),
    radial-gradient(circle at 50% 50%, rgba(255, 79, 216, 0.08), transparent 40%);
}

.no-webgl .fallback-glow { display: block; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 32%, rgba(3, 4, 10, 0.62) 76%, rgba(3, 4, 10, 0.92) 100%),
    linear-gradient(180deg, rgba(3, 4, 10, 0.28) 0%, transparent 18%, transparent 78%, rgba(3, 4, 10, 0.5) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
}

.iris {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: #000;
  opacity: 1;
}

.is-ready .iris {
  animation: irisOut 1.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.boot-pulse {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 7;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan), 0 0 48px rgba(139, 108, 255, 0.7);
  transform: translate(-50%, -50%);
  animation: bootPulse 1.15s ease-in-out infinite;
}

.is-ready .boot-pulse {
  animation: none;
  opacity: 0;
  visibility: hidden;
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem 1.25rem 6.5rem;
  pointer-events: none;
  will-change: transform;
}

.hud::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vw, 980px);
  height: min(42vh, 320px);
  transform: translate(-50%, -48%);
  background: radial-gradient(ellipse at center, rgba(3, 4, 10, 0.82) 0%, rgba(3, 4, 10, 0.4) 46%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.mark {
  width: clamp(52px, 8vw, 78px);
  height: clamp(52px, 8vw, 78px);
  margin-bottom: clamp(1rem, 2.4vh, 1.6rem);
  filter: drop-shadow(0 0 14px rgba(60, 240, 255, 0.35));
  opacity: 0;
  transform: translateY(10px) scale(0.92);
}

.seal { width: 100%; height: 100%; display: block; }

.seal .ring {
  fill: none;
  opacity: 0.82;
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
}

.seal .eq { opacity: 0; transform: translate(48px, 48px) scale(0.86); transform-origin: 0 0; }

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 6.2vw + 0.35rem, 6.15rem);
  letter-spacing: var(--track);
  padding-left: var(--track);
  line-height: 0.95;
  color: var(--text);
  text-shadow:
    0 0 28px rgba(3, 4, 10, 0.95),
    0 8px 40px rgba(3, 4, 10, 0.7),
    0 0 48px rgba(60, 240, 255, 0.18);
  opacity: 0;
  transform: translateY(18px);
  filter: blur(5px);
}

.w2 { color: var(--cyan); }

.tagline {
  margin: 1.15rem 0 0;
  max-width: min(92vw, 38rem);
  font-weight: 400;
  font-size: clamp(0.8rem, 2.7vw, 1.12rem);
  letter-spacing: 0.18em;
  line-height: 1.7;
  color: rgba(240, 244, 255, 0.95);
  text-shadow:
    0 0 8px #03040a,
    0 1px 2px #03040a,
    0 4px 22px #03040a,
    0 8px 36px rgba(3, 4, 10, 0.95);
  text-wrap: balance;
  opacity: 0;
  transform: translateY(12px);
}

.support {
  margin: 0.72rem 0 0;
  font-family: var(--mono);
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
  letter-spacing: 0.46em;
  padding-left: 0.46em;
  color: rgba(90, 244, 255, 0.92);
  text-shadow:
    0 0 10px #03040a,
    0 2px 16px #03040a,
    0 0 22px rgba(60, 240, 255, 0.25);
  opacity: 0;
  transform: translateY(10px);
}

.rule {
  width: min(240px, 42vw);
  height: 1px;
  margin-top: 1.35rem;
  background: linear-gradient(90deg, transparent, rgba(60, 240, 255, 0.85), rgba(139, 108, 255, 0.9), transparent);
  transform: scaleX(0);
  opacity: 0;
  transform-origin: center;
}

.cta {
  position: absolute;
  left: 50%;
  bottom: max(1.35rem, calc(env(safe-area-inset-bottom) + 0.85rem));
  z-index: 5;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(198, 210, 238, 0.62);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  opacity: 0;
  transition: color 0.35s ease, text-shadow 0.35s ease, opacity 0.6s ease;
}

.cta:hover,
.cta:focus-visible {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(60, 240, 255, 0.55);
  outline: none;
}

.is-ready .mark {
  animation: rise 0.9s 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.is-ready .seal .ring.r1 { animation: drawRing 1.25s 0.38s ease forwards; }
.is-ready .seal .ring.r2 { animation: drawRing 1.15s 0.5s ease forwards; }
.is-ready .seal .ring.r3 { animation: drawRing 1.05s 0.62s ease forwards; }
.is-ready .seal .eq { animation: eqIn 0.7s 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.is-ready .wordmark {
  animation: titleIn 1.15s 0.78s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.is-ready .tagline {
  animation: fadeUp 0.85s 1.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.is-ready .support {
  animation: fadeUp 0.8s 1.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.is-ready .rule {
  animation: ruleIn 0.9s 1.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.is-ready .cta {
  animation: ctaIn 0.8s 1.85s ease forwards;
}

@keyframes irisOut {
  to { opacity: 0; }
}

@keyframes bootPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.82); opacity: 0.55; }
  50% { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawRing {
  to { stroke-dashoffset: 0; }
}

@keyframes eqIn {
  to { opacity: 1; transform: translate(48px, 48px) scale(1); }
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(5px);
    letter-spacing: 0.4em;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    letter-spacing: var(--track);
  }
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ruleIn {
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes ctaIn {
  to { opacity: 1; }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: var(--void);
  font-family: var(--display);
  letter-spacing: 0.18em;
}

.noscript a { color: var(--cyan); }

@media (max-width: 640px) {
  :root { --track: 0.08em; }
  .tagline {
    letter-spacing: 0.08em;
    font-size: clamp(0.78rem, 3.5vw, 0.95rem);
  }
  .support {
    letter-spacing: 0.24em;
    padding-left: 0.24em;
  }
  .wordmark {
    font-size: clamp(1.55rem, 7.4vw, 2.35rem);
    letter-spacing: 0.08em;
    padding-left: 0.08em;
  }
  .hud { padding-inline: 1rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hud { padding: 1.2rem 1rem 3.2rem; }
  .mark { width: 40px; height: 40px; margin-bottom: 0.45rem; }
  .wordmark { font-size: clamp(1.5rem, 8vh, 2.6rem); }
  .tagline { margin-top: 0.45rem; font-size: 0.78rem; }
  .support { margin-top: 0.35rem; }
  .rule { margin-top: 0.55rem; }
  .cta { bottom: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-pulse { animation: none; opacity: 0.001; }
  .iris { opacity: 0; animation: none; }
  .is-ready .iris,
  .is-ready .mark,
  .is-ready .seal .ring,
  .is-ready .seal .eq,
  .is-ready .wordmark,
  .is-ready .tagline,
  .is-ready .support,
  .is-ready .rule,
  .is-ready .cta {
    animation: none;
  }
  .mark,
  .wordmark,
  .tagline,
  .support,
  .rule,
  .cta {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .seal .ring { stroke-dashoffset: 0; }
  .seal .eq { opacity: 1; transform: translate(48px, 48px) scale(1); }
  .grain { opacity: 0.03; }
}


/* === Official RammSound hex logo lockup === */
.brand-lockup {
  position: relative;
  display: grid;
  place-items: center;
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  margin: 0 auto 1.25rem;
  transform: translateZ(0) scale(0.92);
  opacity: 0;
  filter: blur(10px);
  animation: brandIn 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.brand-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(60, 240, 255, 0.55), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(0, 180, 220, 0.35), transparent 60%);
  filter: blur(28px);
  opacity: 0.9;
  animation: glowPulse 4.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.brand-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  filter:
    drop-shadow(0 18px 40px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 28px rgba(60, 240, 255, 0.28));
  transform: perspective(900px) rotateX(8deg) rotateY(-6deg);
  transition: transform 0.45s ease;
}
.brand-lockup:hover .brand-logo {
  transform: perspective(900px) rotateX(4deg) rotateY(0deg) scale(1.03);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
@keyframes brandIn {
  to { opacity: 1; filter: blur(0); transform: translateZ(0) scale(1); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.05); }
}
@media (max-width: 480px) {
  .brand-lockup { width: min(68vw, 240px); height: min(68vw, 240px); margin-bottom: 0.9rem; }
  .brand-logo { transform: perspective(700px) rotateX(5deg) rotateY(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-lockup { animation: none; opacity: 1; filter: none; transform: none; }
  .brand-glow { animation: none; }
  .brand-logo { transform: none; transition: none; }
}