@import url('../assets/fonts/fonts.css');

:root {
  --ink: #000;
  --paper: #f0ece4;
  --paper-70: rgba(240,236,228,.70);
  --paper-45: rgba(240,236,228,.45);
  --paper-28: rgba(240,236,228,.28);
  --line: rgba(240,236,228,.12);
  --brass: #b9975b;
  --accent: #b9975b;
  --display: 'Cormorant Garamond', 'Times New Roman', Times, serif;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--paper);
  font-family: var(--ui);
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--brass); outline-offset: 3px; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: .32em;
  text-transform: uppercase; color: var(--paper-28); margin: 0;
}

kbd {
  display: inline-grid; place-content: center;
  min-width: 26px; height: 24px; padding: 0 .5rem;
  border: 1px solid var(--line); border-radius: 2px;
  font-family: var(--ui); font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--paper-70);
  background: rgba(255,255,255,.03);
}

.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none;
  opacity: .026;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(5) infinite;
}
@keyframes grain {
  0%,100%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)}
  40%{transform:translate(2%,-2%)} 60%{transform:translate(-2%,-3%)} 80%{transform:translate(3%,1%)}
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ══════════════ Loader ══════════════ */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: grid; place-content: center;
  transition: opacity .9s var(--ease), visibility .9s;
}
#loader.done { opacity: 0; visibility: hidden; }
.ld-inner { display: grid; justify-items: center; gap: 1.9rem; }
.ld-mark { font-size: 11px; letter-spacing: .58em; text-indent: .58em; color: var(--paper-45); margin: 0; }
.ld-bar { width: min(260px, 52vw); height: 1px; background: rgba(240,236,228,.12); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width .4s var(--ease); }
.ld-status { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--paper-28); margin: 0; }

/* ══════════════ Entry ══════════════ */
#entry {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-content: center;
  padding: 2rem;
  background: radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,.55), rgba(0,0,0,.93));
  backdrop-filter: blur(3px);
  animation: fadeIn .9s var(--ease) both;
}
#entry[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.entry-card { max-width: 460px; text-align: center; }
.entry-card h1 {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(2.8rem, 9vw, 4.6rem); line-height: 1;
  letter-spacing: -.02em; margin: 1.1rem 0 0;
}
.entry-lede {
  font-size: 14px; line-height: 1.8; color: var(--paper-45);
  margin: 1.1rem 0 2.2rem; max-width: 34ch; margin-inline: auto;
}
.keys { display: grid; gap: .7rem; margin-bottom: 2.4rem; justify-items: center; }
.keys[hidden] { display: none; }
.keys > div { display: flex; align-items: center; gap: .45rem; }
.keys span { font-size: 11px; letter-spacing: .1em; color: var(--paper-45); margin-left: .5rem; }

.btn-enter {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: 1.05rem 2.6rem;
  border: 1px solid rgba(185,151,91,.45); border-radius: 1px;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass);
  position: relative; overflow: hidden;
  transition: color .5s var(--ease), border-color .5s var(--ease);
}
.btn-enter span { position: relative; z-index: 1; }
.btn-enter::before {
  content: ''; position: absolute; inset: 0; background: var(--brass);
  transform: translateY(101%); transition: transform .55s var(--ease-out);
}
.btn-enter:hover { color: #000; border-color: var(--brass); }
.btn-enter:hover::before { transform: translateY(0); }
.btn-enter .arw { transition: transform .5s var(--ease-out); }
.btn-enter:hover .arw { transform: translateX(4px); }

.btn-tour {
  display: block; margin: 1.3rem auto 0;
  font-size: 11px; letter-spacing: .16em; color: var(--paper-28);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.btn-tour:hover { color: var(--paper-70); border-bottom-color: var(--line); }

/* ══════════════ HUD ══════════════ */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1rem, 2.4vw, 1.7rem) clamp(1rem, 3vw, 2.2rem);
  pointer-events: none;
  animation: fadeIn 1.2s var(--ease) both;
}
.hud[hidden] { display: none; }
.hud > * { pointer-events: auto; }
.hud-back {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-45);
  transition: color .4s var(--ease);
}
.hud-back:hover { color: var(--paper); }
.hud-back .arw { transition: transform .4s var(--ease-out); }
.hud-back:hover .arw { transform: translateX(-4px); }

.hud-tools { display: flex; gap: .55rem; }
.hud-btn {
  padding: .52rem .95rem;
  border: 1px solid var(--line); border-radius: 1px;
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-45);
  background: rgba(0,0,0,.35); backdrop-filter: blur(8px);
  transition: color .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.hud-btn:hover { color: var(--paper); border-color: var(--paper-28); }
.hud-btn[aria-pressed="true"] { color: #000; background: var(--brass); border-color: var(--brass); }

/* ══════════════ Plan ══════════════ */
.map {
  position: fixed; z-index: 40;
  right: clamp(1rem, 3vw, 2.2rem);
  top: clamp(4.2rem, 9vh, 5.6rem);
  width: clamp(150px, 15vw, 210px);
  padding: .55rem;
  border: 1px solid var(--line); border-radius: 2px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(8px);
  pointer-events: none;
  animation: fadeIn 1.4s var(--ease) both;
}
.map[hidden] { display: none; }
.map svg { display: block; width: 100%; height: auto; }
.m-room { fill: rgba(240,236,228,.035); stroke: rgba(240,236,228,.26); stroke-width: .22; }
.m-work { fill: rgba(240,236,228,.55); }
.m-work.near { fill: var(--brass); }
.m-you  { fill: var(--brass); }
.m-cone { fill: rgba(185,151,91,.42); }

/* ══════════════ Plaque ══════════════ */
.plaque {
  position: fixed; z-index: 40;
  left: clamp(1rem, 3vw, 2.2rem);
  bottom: clamp(1.2rem, 4vh, 2.4rem);
  max-width: min(330px, 74vw);
  padding: 1.15rem 1.35rem 1.2rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.42));
  backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(14px);
  transition: opacity .55s var(--ease), transform .55s var(--ease-out);
}
.plaque[hidden] { display: none; }
.plaque.show { opacity: 1; transform: none; }
.pl-n { margin: 0; font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.plaque h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.15;
  margin: .5rem 0 .45rem; letter-spacing: -.01em;
}
.pl-meta { margin: 0; font-size: 11px; letter-spacing: .1em; color: var(--paper-45); }
.pl-cue { margin: .9rem 0 0; font-size: 10px; letter-spacing: .14em; color: var(--paper-28); display: flex; align-items: center; gap: .5rem; }
.touch-mode .pl-cue kbd { display: none; }

/* ══════════════ Reticle & hint ══════════════ */
.reticle {
  position: fixed; z-index: 35; left: 50%; top: 50%;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: rgba(240,236,228,.34);
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s var(--ease);
  pointer-events: none;
}
.reticle[hidden] { display: none; }
.reticle.hot {
  width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  background: transparent; border: 1px solid var(--accent);
}

.hint {
  position: fixed; z-index: 40; left: 50%; bottom: clamp(1.4rem, 5vh, 3rem);
  transform: translateX(-50%);
  margin: 0; font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--paper-28); pointer-events: none; text-align: center;
  transition: opacity .6s var(--ease);
}
.hint[hidden] { display: none; }

/* ══════════════ Transition curtain ══════════════ */
.fade {
  position: fixed; inset: 0; z-index: 80;
  background: #000;
  opacity: 0; visibility: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
  pointer-events: none;
}
.fade.on { opacity: 1; visibility: visible; }

/* ══════════════ The album world ══════════════ */
.world {
  position: fixed; inset: 0; z-index: 45;
  display: none;
  pointer-events: none;
}
body.in-world .world { display: block; }
body.in-world .hud-tools,
body.in-world .plaque,
body.in-world .hint,
body.in-world .map,
body.in-world .touch { display: none !important; }
body.in-world .hud-back { opacity: 0; pointer-events: none; }

.wr-close {
  position: fixed; z-index: 3;
  top: clamp(1rem, 2.4vw, 1.7rem); left: clamp(1rem, 3vw, 2.2rem);
  display: inline-flex; align-items: center; gap: .6rem;
  pointer-events: auto;
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--paper-45);
  opacity: 0; transform: translateX(-8px);
  transition: color .4s var(--ease), opacity .7s var(--ease) .35s, transform .7s var(--ease-out) .35s;
}
.world.reveal .wr-close { opacity: 1; transform: none; }
.wr-close:hover { color: var(--paper); }
.wr-close .arw { transition: transform .4s var(--ease-out); }
.wr-close:hover .arw { transform: translateX(-4px); }

/* the copy sits in the right half; the record floats in the left */
.wr-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(46vw, 620px);
  display: flex;
  padding: clamp(4.5rem, 9vh, 7rem) clamp(1.6rem, 3.2vw, 3.4rem) 0 0;
  pointer-events: none;
}
/* a soft falloff so the copy never has to fight the room behind it */
.wr-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 0 -14vw;
  background: linear-gradient(90deg, transparent, rgba(3,3,6,.62) 34%, rgba(3,3,6,.88) 62%);
  pointer-events: none;
}
.wr-scroll { position: relative; z-index: 1; }
.wr-scroll {
  pointer-events: auto;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 5rem;
  padding-right: .9rem;
  scrollbar-width: thin;
  /* bottom fade only — a top fade would swallow the eyebrow */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5rem), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5rem), transparent 100%);
}
.wr-scroll::-webkit-scrollbar { width: 3px; }
.wr-scroll::-webkit-scrollbar-thumb { background: rgba(240,236,228,.16); }

/* everything in the panel drifts up on arrival, in sequence */
.wr-scroll > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .85s var(--ease-out), transform .95s var(--ease-out);
}
.world.reveal .wr-scroll > * { opacity: 1; transform: none; }
.world.reveal .wr-scroll > :nth-child(1) { transition-delay: .05s }
.world.reveal .wr-scroll > :nth-child(2) { transition-delay: .13s }
.world.reveal .wr-scroll > :nth-child(3) { transition-delay: .21s }
.world.reveal .wr-scroll > :nth-child(4) { transition-delay: .29s }
.world.reveal .wr-scroll > :nth-child(5) { transition-delay: .36s }
.world.reveal .wr-scroll > :nth-child(6) { transition-delay: .42s }
.world.reveal .wr-scroll > :nth-child(7) { transition-delay: .48s }
.world.reveal .wr-scroll > :nth-child(n+8) { transition-delay: .54s }

.wr-eyebrow {
  display: flex; align-items: center; gap: .9rem; margin: 0 0 1.1rem;
  font-size: 9.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--paper-28);
}
.wr-eyebrow .n { color: var(--accent); font-variant-numeric: tabular-nums; }
.wr-eyebrow .sep { width: 26px; height: 1px; background: var(--line); }

.wr-title {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(2.2rem, 4.4vw, 3.9rem); line-height: .98;
  letter-spacing: -.025em; margin: 0;
}
.wr-tag {
  font-family: var(--display); font-style: italic; font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.42rem); line-height: 1.45;
  color: var(--accent); margin: 1rem 0 0; max-width: 30ch;
}
.wr-body { font-size: 13.5px; line-height: 1.92; color: var(--paper-45); margin: 1.6rem 0 0; }
.wr-body em { font-style: italic; color: var(--paper-70); }

.wr-facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.15rem 1.5rem;
  margin: 1.9rem 0 0; padding: 1.5rem 0; border-block: 1px solid rgba(240,236,228,.08);
}
.wr-facts dt { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--paper-28); }
.wr-facts dd { margin: .38rem 0 0; font-size: 13px; color: var(--paper-70); }

.wr-peaks { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.4rem 0 0; }
.wr-peak {
  padding: .36rem .66rem; border: 1px solid var(--line); border-radius: 1px;
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-28);
}
.wr-peak b { color: var(--accent); font-weight: 500; font-size: 11px; }

.wr-note {
  font-size: 12px; line-height: 1.8; color: var(--paper-28);
  border-left: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-left: 1rem; margin: 1.6rem 0 0;
}
.wr-note em { font-style: italic; color: var(--paper-45); }

.wr-th {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin: 2.2rem 0 .2rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line);
  font-size: 9.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--paper-45);
}
.wr-th .hint { color: var(--paper-28); letter-spacing: .1em; text-transform: none; font-size: 10px; }

.wr-track {
  display: grid; grid-template-columns: 1.9rem 24px 1fr auto; gap: .75rem;
  align-items: center; width: 100%; text-align: left;
  padding: .68rem .2rem;
  border-bottom: 1px solid rgba(240,236,228,.05);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease-out), transform .7s var(--ease-out), background .3s var(--ease);
  transition-delay: calc(var(--i) * 22ms);
}
.wr-track.in { opacity: 1; transform: none; }
.wr-track.has-audio { cursor: pointer; }
.wr-track.has-audio:hover { background: rgba(240,236,228,.035); }
.wr-track .n { font-size: 9.5px; color: var(--paper-28); font-variant-numeric: tabular-nums; }
.wr-track .t { font-size: 13px; color: var(--paper-70); line-height: 1.35; }
.wr-track .d { font-size: 10.5px; color: var(--paper-28); font-variant-numeric: tabular-nums; }
.wr-track .pl {
  width: 22px; height: 22px; display: grid; place-content: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--paper-28);
  transition: all .3s var(--ease);
}
.wr-track.has-audio:hover .pl { border-color: var(--accent); color: var(--accent); }
.wr-track.playing .pl { background: var(--accent); border-color: var(--accent); color: #000; }
.wr-track.playing .t { color: var(--accent); }
.wr-track .pl svg { width: 8px; height: 8px; fill: currentColor; }
.wr-track:not(.has-audio) .pl { opacity: .18; }

.wr-bonus { margin: 1.2rem 0 0; font-size: 11.5px; line-height: 1.7; color: var(--paper-28); }

.wr-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 2.4rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.wr-nav button {
  display: flex; flex-direction: column; gap: .35rem; max-width: 46%;
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-28);
  transition: color .4s var(--ease);
}
.wr-nav button:last-child { text-align: right; align-items: flex-end; }
.wr-nav button:hover:not(:disabled) { color: var(--paper); }
.wr-nav button:disabled { opacity: .3; cursor: default; }
.wr-nav button .t {
  font-family: var(--display); font-size: 14px; letter-spacing: 0;
  text-transform: none; color: var(--paper-45); line-height: 1.25;
}
.wr-nav button:hover:not(:disabled) .t { color: var(--accent); }

.wr-full {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.8rem;
  padding: .85rem 1.5rem; border: 1px solid var(--line); border-radius: 1px;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--paper-45);
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.wr-full:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* narrow: the record sits above, the copy reads as a sheet below it */
@media (max-width: 999px) {
  .wr-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: 62svh;
    padding: 0;
    background: linear-gradient(to top, rgba(3,3,6,.97) 62%, rgba(3,3,6,.80) 88%, transparent);
  }
  .wr-scroll { padding: 2.4rem clamp(1.2rem, 5vw, 2rem) 4rem; }
  .wr-title { font-size: clamp(1.9rem, 7vw, 2.6rem); }
}

/* ══════════════ Touch ══════════════ */
.touch { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.touch[hidden] { display: none; }
.stick {
  position: absolute; left: 6vw; bottom: 8vh;
  width: 110px; height: 110px; border-radius: 50%;
  border: 1px solid rgba(240,236,228,.14);
  background: rgba(0,0,0,.22); backdrop-filter: blur(6px);
  pointer-events: auto; touch-action: none;
  display: grid; place-content: center;
  opacity: .55; transition: opacity .3s var(--ease);
}
.stick.active { opacity: .95; }
.stick i {
  display: block; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(240,236,228,.24);
  transition: transform .06s linear;
}

/* ══════════════ noscript ══════════════ */
.noscript {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: grid; place-content: center; text-align: center; padding: 2rem;
}
.noscript h1 { font-family: var(--display); font-weight: 300; font-size: 2rem; margin: 0 0 1rem; }
.noscript p { color: var(--paper-45); font-size: 14px; }
.noscript a { color: var(--brass); border-bottom: 1px solid currentColor; }

@media (max-width: 720px) {
  .map { display: none; }

}
