/* Wonder Maker — opening journey */
:root {
  --night: #04040a;
  --paper: #efe8dc;
  --dim: #a8a196;
  --muted: #6f6a63;
  --gold: #d9b46f;
  --line: rgba(239, 232, 220, .16);
  --serif: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  --serif-kr: "Noto Serif KR", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--paper); font: 300 16px/1.6 var(--serif); background: var(--night); overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.65) 100%); }
.track { height: 1100vh; }

/* top bar */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 20px var(--pad); }
.brand { font: 400 21px/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.bar-actions { display: flex; align-items: center; gap: 10px; }
.vol { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 14px 4px 4px; background: rgba(4,4,10,.35); backdrop-filter: blur(8px); }
.vol .snd { border: 0; background: none; padding: 8px 10px; backdrop-filter: none; }
.vol input[type=range] { -webkit-appearance: none; appearance: none; width: 78px; height: 18px; background: none; cursor: pointer; }
.vol input[type=range]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, var(--gold) var(--v, 70%), rgba(239,232,220,.22) var(--v, 70%)); }
.vol input[type=range]::-moz-range-track { height: 1px; background: rgba(239,232,220,.22); }
.vol input[type=range]::-moz-range-progress { height: 1px; background: var(--gold); }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); margin-top: -4px; border: 0; }
.vol input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 0; }
.snd, .skip {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px; background: rgba(4,4,10,.35); backdrop-filter: blur(8px);
  transition: border-color .3s, background .3s;
}
.snd:hover, .skip:hover { border-color: var(--gold); }
.snd b { font-weight: 400; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.eq i { width: 2px; height: 3px; background: var(--dim); transition: background .3s; }
.snd[aria-pressed="true"] .eq i { background: var(--gold); animation: eq 1s ease-in-out infinite; }
.snd[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.3s; }
.snd[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.6s; }
.snd[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%,100% { height: 3px } 50% { height: 10px } }

/* chapter rail */
.rail { position: fixed; right: calc(var(--pad) - 2px); top: 50%; translate: 0 -50%; z-index: 15; height: 34vh; }
.rail-line { display: block; width: 1px; height: 100%; background: rgba(239,232,220,.1); position: relative; }
.rail-line i { position: absolute; left: 0; top: 0; width: 1px; height: 0; background: linear-gradient(transparent, rgba(217,180,111,.7)); }
.rail-line b { position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* story beats */
.story { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.beat {
  position: absolute; left: 50%; top: 50%; width: min(92vw, 900px); translate: -50% -50%; text-align: center;
  opacity: 0; will-change: opacity, transform, filter;
}
.beat .ch { color: var(--gold); margin: 0 0 22px; }
.beat--low { top: auto; bottom: 7vh; translate: -50% 0; }
.beat--low h2 { font-size: clamp(26px, 3.4vw, 46px); }
.beat--low .ch { margin-bottom: 12px; }
.beat--low .kr { margin-top: 10px; }
.beat h2 { margin: 0; font: 300 italic clamp(30px, 4.4vw, 60px)/1.15 var(--serif); letter-spacing: -.01em; text-shadow: 0 2px 24px rgba(0,0,0,.85), 0 0 60px rgba(0,0,0,.6); }
.beat h2 em { font-style: italic; color: var(--paper); }
.beat h2 { font-style: normal; }
.beat .kr { margin: 22px 0 0; font: 300 clamp(13px, 1.2vw, 16px)/1.7 var(--serif-kr); color: var(--dim); letter-spacing: .04em; text-shadow: 0 1px 12px rgba(0,0,0,.9); }

/* arrival */
.final {
  position: fixed; inset: 0; z-index: 12; display: grid; place-content: center; justify-items: center; text-align: center; gap: 0;
  opacity: 0; pointer-events: none; transition: opacity 1.2s var(--ease);
}
.final.on { opacity: 1; pointer-events: auto; }
.final-mark {
  width: clamp(80px, 10vw, 120px); aspect-ratio: 1; margin-bottom: 30px; background: var(--gold);
  -webkit-mask: url("assets/site/emblem-mark.png") center / contain no-repeat; mask: url("assets/site/emblem-mark.png") center / contain no-repeat;
  filter: drop-shadow(0 0 24px rgba(217,180,111,.55));
}
.final-kicker { color: var(--gold); margin: 0; }
.final h1 { margin: 0; font: 400 clamp(44px, 6vw, 88px)/1 var(--serif); letter-spacing: .01em; }
.final-sub { color: var(--dim); margin: 16px 0 0; font-size: 9px; }
.enter {
  margin-top: 36px; display: inline-flex; gap: 14px; align-items: center; text-decoration: none;
  font: 400 11px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; padding: 16px 30px; border-radius: 0;
  border: 1px solid rgba(217,180,111,.6); background: rgba(217,180,111,.06); color: var(--paper); transition: transform .4s var(--ease), box-shadow .4s, background .4s;
  box-shadow: 0 0 0 0 rgba(217,180,111,.5);
}
.enter:hover { background: rgba(217,180,111,.16); box-shadow: 0 0 30px rgba(217,180,111,.25); }
.again { margin-top: 18px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.again:hover { color: var(--paper); }

/* scroll cue */
.cue { position: fixed; left: 50%; bottom: 34px; translate: -50% 0; z-index: 11; display: grid; justify-items: center; gap: 14px; color: var(--dim); transition: opacity .8s; pointer-events: none; }
.cue i { width: 1px; height: 70px; background: linear-gradient(var(--gold), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1 } 60% { transform: scaleY(1); opacity: 1 } 100% { transform: scaleY(1); opacity: 0 } }

/* gate (loader + enter) */
.gate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--night);
  transition: opacity 1.4s var(--ease), visibility 1.4s;
}
.gate.gone { opacity: 0; visibility: hidden; }
.gate-mark {
  position: absolute; left: 50%; top: 50%; width: min(78vmin, 680px); aspect-ratio: 1; translate: -50% -50%;
  background: var(--gold); opacity: 0; transition: opacity 2.4s var(--ease), transform 2.4s var(--ease); transform: scale(1.06);
  -webkit-mask: url("assets/site/emblem-mark.png") center / contain no-repeat; mask: url("assets/site/emblem-mark.png") center / contain no-repeat;
}
.gate.ready .gate-mark { opacity: .07; transform: none; }
.gate-name { display: grid; gap: 10px; justify-items: center; position: relative; }
.gate-name span { font: 400 clamp(30px, 3.4vw, 44px)/1 var(--serif); letter-spacing: .01em; }
.gate-name small { font-size: 8px; color: var(--muted); letter-spacing: .4em; }
.gate-load { position: absolute; bottom: 10vh; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 14px; color: var(--muted); transition: opacity .6s; }
.gate-load i { display: block; width: 130px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.gate-load b { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(0); }
.gate-load span { min-width: 4ch; font-size: 9px; }
.gate.ready .gate-load { opacity: 0; }
.gate-enter {
  position: absolute; bottom: 9vh; left: 50%; translate: -50% 0; display: grid; justify-items: center; gap: 14px;
  opacity: 0; pointer-events: none; transition: opacity 1.2s .4s var(--ease);
}
.gate.ready .gate-enter { opacity: 1; pointer-events: auto; }
.btn-sound {
  font: 400 15px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; font-size: 11px;
  padding: 16px 28px; border: 1px solid rgba(217,180,111,.6); background: rgba(217,180,111,.06); color: var(--paper); cursor: pointer;
  transition: background .4s, box-shadow .4s;
}
.btn-sound:hover { background: rgba(217,180,111,.16); box-shadow: 0 0 30px rgba(217,180,111,.25); }
.btn-quiet { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.btn-quiet:hover { color: var(--paper); }
.gate-tip { color: var(--muted); font-size: 8px; margin: 6px 0 0; letter-spacing: .2em; }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

@media (max-width: 760px) {
  .brand { font-size: 18px; }
  .vol input[type=range] { width: 56px; }
  .snd, .skip { padding: 9px 12px; }
  .rail { right: 10px; }
  .rail ol { gap: 16px; }
  .beat { width: calc(100vw - 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .cue i, .snd .eq i { animation: none !important; }
}

/* the journey is a flight, not a page: hide the scrollbar */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
.gate-enter::after { content: ""; width: 1px; height: 46px; margin-top: 8px; background: linear-gradient(var(--gold), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }

/* ===== 3D world version ===== */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
#world { cursor: grab; touch-action: none; }
#world.drag { cursor: grabbing; }
#world.walk { cursor: crosshair; }
.fade { position: fixed; inset: 0; z-index: 9; pointer-events: none; background: #fffaf0; opacity: 0; transition: opacity 1.6s ease; }
.fade.on { opacity: .85; }
.hint {
  position: fixed; left: 50%; bottom: 30px; translate: -50% 0; z-index: 11; margin: 0; color: var(--dim);
  font-size: 9px; letter-spacing: .3em; text-align: center; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease;
}
.hint.on { opacity: .9; }
.rail { transition: opacity 1s; }
.rail.off { opacity: 0; }
@media (max-width: 760px) { .hint { white-space: normal; width: 86vw; line-height: 2; } }

.final-sub { color: var(--dim); margin: 18px 0 0; font-size: 9px; letter-spacing: .4em; }
.beat--low { top: auto !important; bottom: 12vh; translate: -50% 0 !important; }

/* the magic-wand sparkles that fall from the cursor */
.wand { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
