:root {
  --night:  #140c12;
  --velvet: #1f121b;
  --bone:   #f1e6ea;
  --rose:   #d79aac;
  --garnet: #7a2238;
  --smoke:  #8a7a86;
  --hair:   rgba(241, 230, 234, 0.16);

  --display: "UnifrakturMaguntia", "Old English Text MT", serif;
  --body: "IM Fell English", "Iowan Old Style", Georgia, serif;

  --mx: 50vw;      /* pointer, for parallax and the glow */
  --my: 40vh;
  --rx: -9999px;   /* pointer, for the hidden picture (off screen until the mouse moves) */
  --ry: -9999px;
  --rr: 0px;       /* reveal radius, grows in when the pointer moves, fades out when it stops */
  --pulse: 0;      /* 0..1, set every frame while the song plays */
}

* { box-sizing: border-box; }
html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.25rem;
  line-height: 1.5;
  background: var(--night);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--garnet); color: var(--bone); }

/* ───────── background layers ───────── */

#smoke {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(40px) saturate(1.2);
}

/* The hidden picture: fully dark until the pointer moves over it */
.reveal {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  filter: contrast(1.05) brightness(1.05);
  -webkit-mask-image: radial-gradient(circle var(--rr) at var(--rx) var(--ry), #000 0%, #000 55%, rgba(0,0,0,.6) 75%, transparent 100%);
          mask-image: radial-gradient(circle var(--rr) at var(--rx) var(--ry), #000 0%, #000 55%, rgba(0,0,0,.6) 75%, transparent 100%);
}
.reveal[hidden] { display: none; }
/* a rose rim around the lens */
.lens {
  position: fixed;
  left: var(--rx);
  top: var(--ry);
  z-index: 0;
  width: calc(var(--rr) * 1.7);
  height: calc(var(--rr) * 1.7);
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(215,154,172,.35), 0 0 50px rgba(122,34,56,.35);
  border: 1px solid rgba(215,154,172,.35);
}
.lens[hidden] { display: none; }

.ghost {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}
.ghost span {
  font-family: var(--display);
  font-size: min(30vw, 62vh);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(241,230,234,.12);
  background: linear-gradient(100deg, transparent 35%, rgba(215,154,172,.3) 50%, transparent 65%) 0 0 / 300% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  transform: translate(calc((var(--mx) - 50vw) * -0.025), calc((var(--my) - 50vh) * -0.025));
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -20% 0; } }

.halo {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(150vh, 140vw);
  height: min(150vh, 140vw);
  z-index: 0;
  pointer-events: none;
  translate: -50% -50%;
  opacity: calc(.3 + var(--pulse) * .3);
}
.halo svg { width: 100%; height: 100%; scale: calc(1 + var(--pulse) * .015); }

#drift { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.spot {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(480px circle at var(--mx) var(--my), rgba(215,154,172,.11), transparent 70%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(8,4,7,.75) 100%);
}

/* ───────── frame and rails ───────── */

.frame { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.frame .c {
  position: absolute;
  width: clamp(64px, 10vw, 150px);
  height: clamp(64px, 10vw, 150px);
  color: var(--bone);
  opacity: .85;
  filter: drop-shadow(0 0 3px rgba(215,154,172,.7));
}
.frame .tl { top: 10px; left: 10px; }
.frame .tr { top: 10px; right: 10px; transform: scaleX(-1); }
.frame .bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.frame .br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

.rail {
  position: absolute;
  top: 50%;
  margin: 0;
  font-style: italic;
  font-size: .95rem;
  letter-spacing: .12em;
  color: var(--smoke);
  white-space: nowrap;
  writing-mode: vertical-rl;
}
.rail.left  { left: 34px;  transform: translateY(-50%) rotate(180deg); }
.rail.right { right: 34px; transform: translateY(-50%); }
.rail b { font-weight: 400; color: var(--rose); }

/* ───────── sigil ───────── */

.sigil { display: block; width: 100%; height: 100%; overflow: visible; color: var(--bone);
  filter: drop-shadow(0 0 4px rgba(241,230,234,.75)) drop-shadow(0 0 calc(22px + var(--pulse) * 20px) rgba(215,154,172,.55)); }
.sigil .moon { fill: var(--rose); }
.sigil .progress { fill: none; stroke: var(--rose); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .6s linear;
  filter: drop-shadow(0 0 4px var(--rose)); }
.sigil .track { fill: none; stroke: var(--hair); stroke-width: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── gate ───────── */

.gate {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border: 0;
  background: rgba(20,12,18,.35);
  color: var(--bone);
  font: inherit;
  cursor: pointer;
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
}
.gate-sigil { width: 210px; height: 248px; animation: breathe 4.5s ease-in-out infinite; }
.gate-text {
  font-style: italic;
  font-size: 1.5rem;
  letter-spacing: .08em;
  text-shadow: 0 0 1px rgba(241,230,234,.9), 0 0 16px rgba(215,154,172,.5), 0 0 48px rgba(122,34,56,.7);
  animation: flicker 5s linear infinite;
}
.gate:hover .gate-text, .gate:focus-visible .gate-text { color: var(--rose); }
.gate:focus-visible { outline: none; }
.gate:focus-visible .gate-sigil { filter: drop-shadow(0 0 18px var(--rose)); }
.gate.leaving { opacity: 0; transform: scale(1.25); filter: blur(8px); pointer-events: none; }

.shock {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  box-shadow: 0 0 30px var(--rose), inset 0 0 30px var(--rose);
  opacity: 0;
  pointer-events: none;
}
.shock.go { animation: shock 1.3s cubic-bezier(.1,.6,.2,1) forwards; }
@keyframes shock { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(10); } }

@keyframes breathe { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .4; } 94% { opacity: 1; } 96% { opacity: .6; } 97% { opacity: 1; } }

/* ───────── page ───────── */

.page {
  position: relative;
  z-index: 2;
  width: min(100%, 40rem);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) 28px 110px;
}
.page[hidden] { display: none; }

.head { text-align: center; margin-bottom: 44px; }
.portrait {
  position: relative;
  width: 168px;
  height: 198px;
  margin: 0 auto 10px;
  transform: translate(calc((var(--mx) - 50vw) * .012), calc((var(--my) - 50vh) * .012)) scale(calc(1 + var(--pulse) * .03));
}
.avatar {
  position: absolute;
  left: 50%;
  top: 57.5%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
}
.has-avatar .portrait .moon { opacity: 0; }

h1 {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 15vw, 7.5rem);
  line-height: .95;
  text-shadow:
    0 0 1px rgba(241,230,234,.9),
    0 0 calc(14px + var(--pulse) * 14px) rgba(215,154,172,.55),
    0 0 calc(44px + var(--pulse) * 40px) rgba(122,34,56,.8);
}
h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--rose);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
h1:hover::after { opacity: .55; transform: translate(4px, -2px); }
.tagline { margin: 12px 0 0; color: var(--smoke); font-style: italic; }
.tagline:empty { display: none; }

/* rows: links and prices share one look */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.rows > li + li { border-top: 1px solid var(--hair); }

.row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 6px;
  color: var(--bone);
  text-decoration: none;
  overflow: hidden;
}
.row .k { position: relative; font-size: 1.6rem; white-space: nowrap; }
.row .leader { position: relative; flex: 1; min-width: 24px; border-bottom: 1px dotted var(--smoke); transform: translateY(-6px); opacity: .7; }
.row .v { position: relative; color: var(--smoke); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.live {
  position: relative;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  font-style: italic;
  color: var(--rose);
  white-space: nowrap;
}
.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7be0a0;
  animation: ping 2s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(123,224,160,.6); } 100% { box-shadow: 0 0 0 9px rgba(123,224,160,0); } }

.links .row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(122,34,56,.6), rgba(122,34,56,0) 85%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.links .row::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rose);
  box-shadow: 0 0 12px var(--rose);
  transform: scaleY(0);
  transition: transform .35s ease;
}
.links .row { transition: color .25s ease, padding .35s cubic-bezier(.2,.7,.2,1); }
.links .row:hover, .links .row:focus-visible { padding-left: 24px; outline: none; }
.links .row:hover::before, .links .row:focus-visible::before { transform: scaleX(1); }
.links .row:hover::after, .links .row:focus-visible::after { transform: scaleY(1); }
.links .row:hover .k, .links .row:focus-visible .k { text-shadow: 0 0 12px rgba(215,154,172,.8); }
.links .row:hover .leader, .links .row:focus-visible .leader { border-bottom-style: solid; border-color: var(--rose); opacity: 1; }
.links .row:hover .v, .links .row:focus-visible .v { color: var(--rose); }
.links .row:focus-visible .k { text-decoration: underline; text-underline-offset: 6px; }

/* sections */
.sec { margin-top: 56px; }
.sec[hidden] { display: none; }
.sec-title { margin: 0 0 14px; text-align: center; font-weight: 400; font-style: italic; font-size: 1.6rem; color: var(--rose); }
.menu .row .v { color: var(--bone); font-style: normal; }

/* ───────── song: a record on a deck ───────── */

.song { margin-top: 56px; text-align: center; }
.song[hidden] { display: none; }
.record {
  position: relative;
  width: min(300px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 26px;
}
.disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--night) 0 3.5%, transparent 4%),
    conic-gradient(from 0deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,.09) 40deg, rgba(255,255,255,0) 80deg, rgba(255,255,255,0) 180deg, rgba(255,255,255,.07) 220deg, rgba(255,255,255,0) 260deg),
    repeating-radial-gradient(circle, #0c070b 0 2px, #191017 2px 3px);
  box-shadow:
    0 0 0 1px var(--hair),
    0 18px 60px rgba(0,0,0,.7),
    0 0 calc(30px + var(--pulse) * 60px) rgba(215,154,172,calc(.15 + var(--pulse) * .35));
  animation: spin 3.6s linear infinite paused;
}
.playing .disc { animation-play-state: running; }
.disc img {
  position: absolute;
  inset: 30%;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  object-fit: cover;
  -webkit-mask: radial-gradient(circle, transparent 0 9%, #000 10%);
          mask: radial-gradient(circle, transparent 0 9%, #000 10%);
}
.disc img:not([src]), .disc img[src=""] { visibility: hidden; }
.arm {
  position: absolute;
  right: -6%;
  top: -4%;
  z-index: 1;
  width: 14%;
  height: 62%;
  transform-origin: 50% 8%;
  transform: rotate(-4deg);
  transition: transform 1.2s cubic-bezier(.3,.7,.2,1);
}
.arm::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a2a35, #120b10);
  box-shadow: 0 0 0 1px var(--hair), 0 4px 10px rgba(0,0,0,.6);
}
.arm::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 3px;
  height: calc(100% - 14px);
  margin-left: -1.5px;
  border-radius: 2px;
  background: linear-gradient(var(--bone), var(--smoke));
  box-shadow: 0 0 6px rgba(215,154,172,.4);
}
.playing .arm { transform: rotate(22deg); }

.song-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
  text-shadow: 0 0 1px rgba(241,230,234,.9), 0 0 18px rgba(215,154,172,.55);
}
.song-artist { margin: 6px 0 14px; color: var(--smoke); font-style: italic; }
.song-artist:empty { display: none; }
.song-bar { height: 2px; background: var(--hair); margin: 14px auto 16px; max-width: 360px; }
.song-bar i { display: block; height: 100%; width: 0; background: var(--rose); box-shadow: 0 0 10px var(--rose); transition: width .6s linear; }
.song-embed { max-width: 360px; margin: 0 auto; }
.song-embed iframe { display: block; border: 0; border-radius: 10px; }

/* previews */
.previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 1px solid var(--hair); background: var(--velvet); overflow: hidden; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.7); transform: scale(1.15); transition: filter .5s ease; }
.tile span { position: absolute; inset: auto 0 10px; text-align: center; font: italic 1rem var(--body); color: var(--bone); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.tile:hover img, .tile:focus-visible img { filter: blur(8px) saturate(.9); }
.tile:focus-visible { outline: 1px solid var(--rose); outline-offset: 3px; }

/* footer */
.foot { margin-top: 64px; text-align: center; color: var(--smoke); font-size: 1rem; font-style: italic; }
.foot .mark { width: 120px; height: 20px; color: var(--rose); opacity: .8; }
.foot p { margin: 6px 0 0; }

/* sound toggle */
.sound {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(31,18,27,.85);
  color: var(--smoke);
  font: italic 1rem var(--body);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.sound[hidden] { display: none; }
.sound[aria-pressed="true"] { color: var(--rose); border-color: rgba(215,154,172,.5); }
.sound:focus-visible { outline: 1px solid var(--rose); outline-offset: 3px; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 30%; background: currentColor; }
.playing .eq i { animation: eq .9s ease-in-out infinite alternate; }
.playing .eq i:nth-child(2) { animation-delay: -.3s; }
.playing .eq i:nth-child(3) { animation-delay: -.6s; }
.playing .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }

/* picture viewer */
.viewer { max-width: min(92vw, 640px); max-height: 92vh; padding: 0; border: 1px solid var(--hair); background: var(--night); color: var(--bone); }
.viewer::backdrop { background: rgba(10,5,9,.85); backdrop-filter: blur(4px); }
.viewer img { display: block; max-width: 100%; max-height: 82vh; }
.viewer-close { display: block; width: 100%; padding: 12px; border: 0; border-top: 1px solid var(--hair); background: var(--velvet); color: var(--bone); font: italic 1.1rem var(--body); cursor: pointer; }
.viewer-close:hover, .viewer-close:focus-visible { color: var(--rose); outline: none; }

/* the arrival, after the gate */
.page.arriving .portrait { animation: settle 1.2s cubic-bezier(.2,.7,.2,1) both; }
.page.arriving h1 { animation: ink 1.5s ease .15s both; }
.page.arriving .links li { animation: slide .8s cubic-bezier(.2,.7,.2,1) both; }
.page.arriving .links li:nth-child(1) { animation-delay: .55s; }
.page.arriving .links li:nth-child(2) { animation-delay: .62s; }
.page.arriving .links li:nth-child(3) { animation-delay: .69s; }
.page.arriving .links li:nth-child(4) { animation-delay: .76s; }
.page.arriving .links li:nth-child(n+5) { animation-delay: .83s; }
.page.arriving .record { animation: drop 1.3s cubic-bezier(.2,.7,.2,1) .5s both; }
.page.arriving .song > :not(.record), .page.arriving .sec, .page.arriving .foot { animation: fade 1s ease .9s both; }

@keyframes settle { from { opacity: 0; transform: translateY(90px) scale(1.6); } to { opacity: 1; transform: none; } }
@keyframes ink    { from { opacity: 0; letter-spacing: .3em; filter: blur(8px); } to { opacity: 1; letter-spacing: 0; filter: none; } }
@keyframes slide  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes drop   { from { opacity: 0; transform: rotate(-120deg) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }

/* ───────── wide screens: two columns ───────── */

@media (min-width: 1100px) {
  .page {
    width: min(100%, 78rem);
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(60px, 7vw, 130px);
    align-items: center;
    align-content: center;
    padding: 80px 110px 60px;
  }
  .song { margin-top: 0; }
  .record { width: min(360px, 26vw); }
  .foot { grid-column: 1 / -1; margin-top: 40px; }
}

/* ───────── smaller screens ───────── */

@media (max-width: 900px) {
  .rail { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 1.15rem; }
  .row .k { font-size: 1.35rem; }
  .row { padding: 15px 4px; gap: 10px; }
  .live { font-size: .85rem; }
  .portrait { width: 130px; height: 153px; }
  .avatar { width: 74px; height: 74px; }
  .previews { grid-template-columns: repeat(2, 1fr); }
  .ghost span { font-size: 38vw; writing-mode: vertical-rl; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
