/* DazzWorld: Beyond the Veil. Darkness is the primary design element. */
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  --void: #030407;
  --obsidian: #07080d;
  --silver: #d8dbe5;
  --ash: #9ea3b4;
  --violet: #8c7fd9;
  --lit: 0;               /* 0..1, how close the visitor's light is to the brand (set by veil.js) */
  --serif: "Cormorant", "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--void);
  color: var(--silver);
  font-family: var(--serif);
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* The living scene. Hidden until veil.js confirms WebGL works. */
#veil { position: fixed; inset: 0; width: 100%; height: 100%; display: none; touch-action: none; }
.gl #veil { display: block; }

/* Without WebGL (or JavaScript): still, layered mist. */
.mist-fallback {
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 38% at 50% 46%, rgba(120, 112, 190, .10), transparent 70%),
    radial-gradient(45% 30% at 22% 60%, rgba(150, 160, 190, .07), transparent 70%),
    radial-gradient(50% 30% at 78% 40%, rgba(110, 120, 170, .06), transparent 70%),
    radial-gradient(120% 60% at 50% 115%, rgba(40, 46, 70, .55), transparent 60%),
    linear-gradient(180deg, #030407 0%, #06070c 55%, #0a0c14 100%);
}
.gl .mist-fallback { display: none; }

.stage {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: 1fr auto; justify-items: center;
  padding: max(6vh, env(safe-area-inset-top)) 1.5rem max(7vh, env(safe-area-inset-bottom));
  pointer-events: none;   /* the visitor's light passes through to the scene */
}
.brand { align-self: center; text-align: center; translate: 0 2vh; }

.emblem {
  width: clamp(44px, 6vw, 64px); height: auto; display: block; margin: 0 auto 1.4rem;
  fill: none; stroke: var(--silver); stroke-width: 1.4; stroke-linecap: round;
  opacity: calc(.55 + var(--lit) * .45);
  filter: drop-shadow(0 0 calc(4px + var(--lit) * 10px) rgba(160, 150, 230, calc(.25 + var(--lit) * .35)));
}
.emblem circle, .emblem path { stroke-dasharray: 130; stroke-dashoffset: 130; animation: draw 2.6s cubic-bezier(.6, 0, .2, 1) 1.1s forwards; }
.emblem .orbit { stroke-width: .9; stroke-opacity: .55; stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw 3.2s cubic-bezier(.6, 0, .2, 1) 1.6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.wordmark {
  margin: 0; font-weight: 300; line-height: 1;
  font-size: clamp(3.1rem, 10.5vw, 8.4rem);
  letter-spacing: .06em; margin-right: -.06em;
  color: rgba(216, 219, 229, calc(.78 + var(--lit) * .22));
  text-shadow: 0 0 calc(18px + var(--lit) * 30px) rgba(150, 140, 225, calc(.18 + var(--lit) * .3));
  mix-blend-mode: screen;
}
.wordmark i { font-style: normal; display: inline-block; opacity: 0; filter: blur(14px); animation: emerge 2.4s cubic-bezier(.2, .6, .2, 1) forwards; }
.wordmark i:nth-child(1) { animation-delay: 2.0s; }
.wordmark i:nth-child(2) { animation-delay: 2.32s; }
.wordmark i:nth-child(3) { animation-delay: 2.14s; }
.wordmark i:nth-child(4) { animation-delay: 2.46s; }
.wordmark i:nth-child(5) { animation-delay: 2.06s; }
.wordmark i:nth-child(6) { animation-delay: 2.38s; }
.wordmark i:nth-child(7) { animation-delay: 2.2s; }
.wordmark i:nth-child(8) { animation-delay: 2.52s; }
.wordmark i:nth-child(9) { animation-delay: 2.26s; }
@keyframes emerge { 0% { opacity: 0; filter: blur(14px); transform: translateY(.06em); } 60% { opacity: .9; } 100% { opacity: 1; filter: blur(0); transform: none; } }
.wordmark.small { font-size: clamp(2.2rem, 6vw, 4rem); }

.tagline {
  margin: 1.6rem 0 0; font-style: italic;
  font-size: clamp(1.08rem, 2.1vw, 1.45rem); letter-spacing: .03em;
  color: var(--ash);
  opacity: 0; animation: rise 2.4s ease 3.7s forwards;
}
@keyframes rise { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }

/* The gateway: a slender lit arch rather than a button. Always visible after the opening. */
.gate {
  pointer-events: auto;
  display: grid; justify-items: center; gap: .9rem;
  color: var(--silver); text-decoration: none;
  padding: .75rem 1.5rem; border-radius: 999px;
  opacity: 0; animation: rise 2s ease 4.4s forwards;
  -webkit-tap-highlight-color: transparent;
}
.arch {
  position: relative; display: block; width: 34px; height: 56px;
  border: 1px solid rgba(216, 219, 229, .55); border-bottom-color: rgba(216, 219, 229, .12);
  border-radius: 17px 17px 2px 2px;
  box-shadow: 0 0 18px rgba(150, 140, 225, .18), inset 0 0 12px rgba(150, 140, 225, .10);
  transition: border-color .6s ease, box-shadow .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
  overflow: hidden;
}
.arch .glow {
  position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 100%, rgba(220, 222, 240, .55), rgba(150, 140, 225, .18) 55%, transparent 80%);
  opacity: .35; transform: translateY(30%);
  animation: breathe 5.5s ease-in-out infinite;
  transition: opacity .8s ease, transform .8s ease;
}
@keyframes breathe { 50% { opacity: .55; } }
.label { font-style: italic; font-size: 1.3rem; letter-spacing: .14em; margin-right: -.14em; color: rgba(216, 219, 229, .86); transition: color .6s ease, letter-spacing .8s ease; }
.gate:hover .arch, .gate:focus-visible .arch {
  border-color: rgba(230, 232, 245, .9);
  box-shadow: 0 0 34px rgba(160, 150, 235, .42), 0 0 90px rgba(150, 140, 225, .16), inset 0 0 18px rgba(200, 200, 240, .28);
  transform: scale(1.06);
}
.gate:hover .glow, .gate:focus-visible .glow { opacity: 1; transform: none; }
.gate:hover .label, .gate:focus-visible .label { color: #fff; letter-spacing: .2em; }
.gate:focus { outline: none; }
.gate:focus-visible { outline: 1px solid rgba(230, 232, 245, .75); outline-offset: 4px; }

/* Crossing: the brand dissolves while the scene opens the portal. */
.crossing .brand, .crossing .gate { transition: opacity 1s ease, filter 1s ease; opacity: 0 !important; filter: blur(8px); }

@media (prefers-reduced-motion: reduce) {
  .emblem circle, .emblem path, .emblem .orbit { animation: none; stroke-dashoffset: 0; }
  .wordmark i, .tagline, .gate { animation: none; opacity: 1; filter: none; }
  .arch .glow { animation: none; }
  .arch, .glow, .label { transition: none; }
}
@media (max-height: 520px) { .emblem { display: none; } .tagline { margin-top: 1rem; } }
