/* ============================================
   LARKIN EXPERIENCE — Rain on Glass
   Digital art installation for Faber & Faber
   ============================================ */

:root {
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --amber: rgba(210, 170, 110, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050507;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   PASSWORD GATE
   ============================================ */

#gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050507;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 2s ease;
}

#gate.dissolving {
  opacity: 0;
  pointer-events: none;
}

#gate-inner {
  text-align: center;
}

#gate-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(180, 165, 135, 0.5);
  letter-spacing: 0.18em;
  margin-bottom: 2.5rem;
  animation: gate-fade-in 3s ease forwards;
  opacity: 0;
}

#gate-input-wrap {
  animation: gate-fade-in 4s ease 1s forwards;
  opacity: 0;
}

#gate-input {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: rgba(200, 185, 155, 0.7);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(180, 165, 135, 0.15);
  padding: 0.5rem 0;
  width: 200px;
  text-align: center;
  letter-spacing: 0.12em;
  outline: none;
  transition: border-color 0.4s ease;
}

#gate-input::placeholder {
  color: rgba(180, 165, 135, 0.2);
  font-style: italic;
}

#gate-input:focus {
  border-bottom-color: rgba(180, 165, 135, 0.35);
}

#gate-error {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.8rem;
  color: rgba(180, 100, 80, 0.6);
  margin-top: 1rem;
  height: 1.2em;
  letter-spacing: 0.1em;
  transition: opacity 0.4s ease;
}

@keyframes gate-fade-in {
  to { opacity: 1; }
}

/* ---- Rain Canvas ---- */

#rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none;
  touch-action: none;
}

/* ---- Quotes (finger-writing in condensation) ---- */

#quote-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  padding: 2rem;
}

#quote-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 2.8vw, 1.75rem);
  line-height: 1.85;
  letter-spacing: 0.015em;
  white-space: pre-line;
  text-align: center;
  max-width: min(520px, 75vw);
  color: rgba(220, 210, 195, 0);
  transition: none;
}

#quote-text.visible {
  color: rgba(225, 215, 195, 0.82);
  text-shadow:
    0 0 25px rgba(210, 170, 110, 0.12),
    0 0 50px rgba(210, 170, 110, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

#quote-text.fading {
  transition: color 2.8s ease-out, text-shadow 2.8s ease-out;
  color: rgba(220, 210, 195, 0);
  text-shadow:
    0 0 25px rgba(210, 170, 110, 0),
    0 0 50px rgba(210, 170, 110, 0),
    0 1px 2px rgba(0, 0, 0, 0);
}

/* ---- Step Inside CTA ---- */

#step-inside {
  position: fixed;
  bottom: 11%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 3;
  cursor: pointer;
  pointer-events: auto;
}

#step-inside span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: rgba(180, 165, 135, 0);
  letter-spacing: 0.18em;
  animation: cta-appear 4s ease 0.5s forwards;
  transition: color 0.5s ease, letter-spacing 0.5s ease;
  padding: 1.2rem 2.5rem;
  display: inline-block;
  border-bottom: 1px solid rgba(180, 165, 135, 0);
}

#step-inside:hover span,
#step-inside:focus span {
  color: rgba(235, 220, 190, 0.88);
  letter-spacing: 0.24em;
  border-bottom-color: rgba(180, 165, 135, 0.2);
}

@keyframes cta-appear {
  to {
    color: rgba(180, 165, 135, 0.55);
    border-bottom-color: rgba(180, 165, 135, 0.1);
  }
}

.hidden {
  display: none !important;
}

/* ============================================
   TRANSITION OVERLAY
   ============================================ */

#transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #050507;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
}

#transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================
   ROOM PAGE
   ============================================ */

#room-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none;
  touch-action: none;
}

/* Dust particle overlay */
#dust-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ============================================
   TRACK ART — ghostly painting on the wall
   Appears when a track plays, lyrics float over it
   ============================================ */

/* ---- Painting — hangs on the wall in darkness ---- */
#track-art {
  position: fixed;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  /* Dark room feel — almost invisible until hover */
  border: 3px solid #1a1510;
  background: #0d0a07;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.85),
    0 6px 20px rgba(0, 0, 0, 0.8);
  filter: brightness(0.55) sepia(0.25);
  cursor: zoom-in;
  transform-origin: center center;
  /* Premium velvet rope transition — slow, deliberate, museum-grade */
  transition:
    opacity 3s ease,
    transform 2.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 2s ease,
    z-index 0s;
}

#track-art.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hover: reveal — leaning in with a candle, unhurried */
#track-art:hover {
  z-index: 100;
  transform: scale(3.2) translateY(30%);
  filter: brightness(0.95) sepia(0.05);
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(180, 150, 90, 0.08),
    0 0 120px rgba(180, 150, 90, 0.03);
  border-color: #2a2015;
  transition:
    transform 3s cubic-bezier(0.16, 1, 0.3, 1),
    filter 2.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 2.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 2.5s ease,
    z-index 0s;
}

#track-art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Custom cursor - warm light dot */
#room-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210,180,120,0.3) 0%, transparent 70%);
  pointer-events: none;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* Hotspot areas — breathing amber glow for discoverability */
.hotspot {
  position: fixed;
  z-index: 5;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  animation: hotspot-breathe 5s ease-in-out infinite;
}

/* Lamp sits above typewriter hotspot */
#hs-lamp { z-index: 7; }

@keyframes hotspot-breathe {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(191, 148, 63, 0)); }
  50% { filter: drop-shadow(0 0 10px rgba(191, 148, 63, 0.15)); }
}

.hotspot-label {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  color: rgba(200, 185, 155, 0);
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: color 0.5s ease, transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              text-shadow 0.5s ease, font-size 0.5s ease;
  pointer-events: none;
  /* Labels dissolve in after page load */
  animation: label-appear 4s ease 3s forwards;
}

.hotspot:hover .hotspot-label {
  color: rgba(235, 220, 190, 0.95);
  text-shadow:
    0 0 20px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(0, 0, 0, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.8);
  font-size: clamp(1.1rem, 1.7vw, 1.65rem);
}

.hotspot:hover {
  transform: translateY(-3px);
  animation: none;
  filter: drop-shadow(0 0 15px rgba(191, 148, 63, 0.25));
}

/* Labels appear as a whisper after the room settles */
@keyframes label-appear {
  to { color: rgba(200, 185, 155, 0.22); }
}

/* Track list overlay */
#tracklist {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 7, 0);
  pointer-events: none;
  transition: background 0.8s ease;
}

#tracklist.visible {
  background: rgba(5, 5, 7, 0.75);
  pointer-events: auto;
}

#tracklist-inner {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

#tracklist.visible #tracklist-inner {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0.15s,
    transform 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s;
}

#tracklist-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.75rem, 1.1vw, 1.1rem);
  color: rgba(180, 165, 135, 0.4);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.track-item {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  color: rgba(200, 185, 155, 0.45);
  padding: 0.7rem 2rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.3s ease, letter-spacing 0.3s ease;
  display: block;
}

.track-item:hover {
  color: rgba(235, 220, 190, 0.85);
  letter-spacing: 0.1em;
}

.track-interlude {
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  color: rgba(200, 185, 155, 0.28);
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(180, 165, 135, 0.08);
}

/* Locked tracks — teaser for premium */
.track-divider {
  width: 40px;
  height: 1px;
  background: rgba(180, 165, 135, 0.08);
  margin: 1.2rem auto;
}

.track-locked {
  color: rgba(200, 185, 155, 0.15);
  cursor: pointer;
  position: relative;
}

.track-locked::after {
  content: '';
  display: block;
  font-size: clamp(0.6rem, 0.9vw, 0.85rem);
  color: rgba(180, 165, 135, 0);
  letter-spacing: 0.15em;
  transition: color 0.4s ease;
  margin-top: -0.1rem;
}

.track-locked:hover {
  color: rgba(200, 185, 155, 0.28);
  letter-spacing: 0.06em;
}

.track-locked:hover::after {
  content: '— to be revealed';
  color: rgba(180, 165, 135, 0.2);
}

/* Sealed poems hint */
#tracklist-sealed-hint {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.7rem;
  color: rgba(180, 165, 135, 0.15);
  letter-spacing: 0.15em;
  margin-top: 1.8rem;
  cursor: pointer;
  transition: color 0.4s ease;
}

#tracklist-sealed-hint:hover {
  color: rgba(180, 165, 135, 0.4);
}

/* Premium overlay */
.premium-content {
  max-width: 440px;
}

.premium-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.65rem !important;
  color: rgba(180, 165, 135, 0.3) !important;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.5rem !important;
}

.premium-desc {
  font-size: 0.9rem !important;
  line-height: 1.9 !important;
}

.premium-tracks {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.8rem;
  color: rgba(200, 185, 155, 0.22);
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin: 1.5rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid rgba(180, 165, 135, 0.06);
  border-bottom: 1px solid rgba(180, 165, 135, 0.06);
}

.premium-price {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.8rem;
  color: rgba(220, 200, 160, 0.7);
  letter-spacing: 0.02em;
  margin: 1.5rem 0 0.3rem;
}

.premium-price-note {
  display: block;
  font-size: 0.7rem;
  color: rgba(180, 165, 135, 0.3);
  letter-spacing: 0.15em;
  margin-top: 0.3rem;
}

.premium-cta {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: rgba(210, 190, 150, 0.7);
  letter-spacing: 0.12em;
  padding: 0.9rem 2.8rem;
  margin: 1.8rem 0 1rem;
  border: 1px solid rgba(180, 165, 135, 0.2);
  cursor: pointer;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease, letter-spacing 0.4s ease;
}

.premium-cta:hover {
  color: rgba(235, 220, 190, 0.9);
  border-color: rgba(180, 165, 135, 0.4);
  background: rgba(180, 165, 135, 0.05);
  letter-spacing: 0.16em;
}

.premium-note {
  font-size: 0.7rem !important;
  color: rgba(180, 165, 135, 0.18) !important;
  letter-spacing: 0.06em;
}

#tracklist-close {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.2vw, 1.15rem);
  color: rgba(180, 165, 135, 0.3);
  letter-spacing: 0.15em;
  margin-top: 2.5rem;
  cursor: pointer;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid rgba(180, 165, 135, 0.08);
}

#tracklist-close:hover {
  color: rgba(180, 165, 135, 0.65);
  letter-spacing: 0.2em;
  border-bottom-color: rgba(180, 165, 135, 0.15);
}

/* About / Credits overlay */
.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 7, 0);
  pointer-events: none;
  transition: background 0.8s ease;
}

.info-overlay.visible {
  background: rgba(5, 5, 7, 0.8);
  pointer-events: auto;
}

.info-content {
  max-width: 500px;
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.info-overlay.visible .info-content {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0.15s,
    transform 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s;
}

.info-content h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  color: rgba(200, 185, 155, 0.7);
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
}

.info-content p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  color: rgba(200, 185, 155, 0.45);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.info-close {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.2vw, 1.15rem);
  color: rgba(180, 165, 135, 0.3);
  letter-spacing: 0.15em;
  margin-top: 2rem;
  cursor: pointer;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid rgba(180, 165, 135, 0.08);
}

.info-close:hover {
  color: rgba(180, 165, 135, 0.65);
  letter-spacing: 0.2em;
  border-bottom-color: rgba(180, 165, 135, 0.15);
}

/* ============================================
   BIOGRAPHY — the life
   ============================================ */

#about-overlay {
  overflow-y: auto;
  align-items: flex-start;
  scrollbar-width: none;
}

#about-overlay::-webkit-scrollbar {
  display: none;
}

.bio-wrap {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 2rem;
}

.bio-inner {
  max-width: 520px;
  text-align: center;
}

/* Staggered reveal — opens slow, closes fast */
.bio-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

#about-overlay.visible .bio-reveal {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1s ease var(--d, 0s),
    transform 1s ease var(--d, 0s);
}

/* Portrait — framed painting */
.portrait-frame {
  display: inline-block;
  padding: 6px;
  border: 1px solid rgba(160, 140, 100, 0.12);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(180, 150, 90, 0.06),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2.5rem;
}

#about-overlay.visible .portrait-frame {
  animation: portrait-float 8s ease-in-out 1.5s infinite;
}

.portrait-img {
  display: block;
  width: 180px;
  height: auto;
  filter: sepia(0.15) saturate(0.8) brightness(0.85) contrast(1.05);
  opacity: 0.88;
}

@keyframes portrait-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(0.3deg); }
  50% { transform: translateY(-8px) rotate(0deg); }
  75% { transform: translateY(-5px) rotate(-0.3deg); }
}

/* Title */
.bio-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: rgba(200, 185, 155, 0.7);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.bio-dates {
  font-size: 0.7em;
  color: rgba(180, 165, 135, 0.3);
  letter-spacing: 0.08em;
}

/* Hook — the opening line, more visual weight */
.bio-hook {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: rgba(220, 205, 175, 0.65);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(180, 165, 135, 0.08);
}

/* Body paragraphs — left-aligned, generous whitespace */
.bio-body {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.88rem, 1.4vw, 0.95rem);
  color: rgba(200, 185, 155, 0.42);
  line-height: 2;
  margin-bottom: 1.8rem;
  text-align: left;
}

/* Pull quote — offset, italic */
.bio-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: rgba(200, 185, 155, 0.25);
  line-height: 1.8;
  margin: 2.5rem 0 1rem;
  padding: 1.5rem 2rem;
  border-left: 1px solid rgba(180, 165, 135, 0.1);
  text-align: left;
}

@media (max-width: 600px) {
  .portrait-img {
    width: 140px;
  }
  .bio-inner {
    max-width: 320px;
  }
  .bio-body {
    text-align: center;
  }
  .bio-quote {
    border-left: none;
    text-align: center;
    padding: 1rem 0;
  }
}

/* Sound toggle */
#sound-toggle {
  position: fixed;
  bottom: 1.8rem;
  right: 2.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.1vw, 1.1rem);
  color: rgba(180, 165, 135, 0.35);
  letter-spacing: 0.15em;
  cursor: pointer;
  z-index: 15;
  transition: color 0.4s ease, opacity 0.4s ease;
  user-select: none;
  padding: 0.6rem 1rem;
}

#sound-toggle:hover {
  color: rgba(180, 165, 135, 0.7);
}

#sound-toggle.playing {
  color: rgba(180, 165, 135, 0.45);
}

#sound-toggle.playing::after {
  content: ' ·';
  animation: sound-pulse 3.5s ease-in-out infinite;
}

#sound-toggle.playing:hover {
  color: rgba(180, 165, 135, 0.7);
}

@keyframes sound-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Step outside — persistent retreat action, bottom left */
#back-to-rain {
  position: fixed;
  bottom: 1.8rem;
  left: 2.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.8rem, 1.1vw, 1.1rem);
  color: rgba(180, 165, 135, 0.25);
  letter-spacing: 0.15em;
  cursor: pointer;
  z-index: 10;
  transition: color 0.4s ease, letter-spacing 0.4s ease;
  padding: 0.6rem 1rem;
}

#back-to-rain:hover {
  color: rgba(180, 165, 135, 0.6);
  letter-spacing: 0.2em;
}

/* ============================================
   DIEGETIC AUDIO PLAYER — floats near the vinyl
   3D perspective as if it's a label card on the desk
   ============================================ */

#player {
  position: fixed;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  perspective: 600px;
  transition: opacity 1.8s ease;
}

#player.visible {
  opacity: 1;
  pointer-events: auto;
}

#player-inner {
  /* Stuck to the front face of the crate — top tilts away from viewer */
  transform: perspective(600px) rotateX(-8deg) rotateY(-2deg);
  transform-origin: center bottom;
  padding: 1.1rem 1.6rem;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(
    160deg,
    rgba(45, 38, 26, 0.65) 0%,
    rgba(30, 24, 16, 0.45) 100%
  );
  border: 1px solid rgba(180, 165, 135, 0.12);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.6);
  min-width: 180px;
  backdrop-filter: blur(1px);
  /* Silky lift transition */
  transition:
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Hover: lifts off the crate toward the viewer */
#player-inner:hover {
  transform: perspective(600px) rotateX(-2deg) translateZ(25px);
  background: linear-gradient(
    160deg,
    rgba(50, 42, 28, 0.8) 0%,
    rgba(35, 28, 18, 0.6) 100%
  );
  border-color: rgba(180, 165, 135, 0.22);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.3),
    0 12px 35px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(180, 150, 90, 0.04);
}

#player-inner:hover #player-track {
  color: rgba(200, 185, 155, 0.8);
}

#player-inner:hover #player-pause {
  color: rgba(200, 185, 155, 0.55);
}

#player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

#player-track {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  color: rgba(200, 185, 155, 0.5);
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.4s ease;
}

#player-pause {
  font-size: 0.6rem;
  color: rgba(200, 185, 155, 0.25);
  letter-spacing: -2px;
  flex-shrink: 0;
  padding: 0.3rem;
  transition: color 0.3s ease;
  cursor: pointer;
}

#player-pause:hover {
  color: rgba(200, 185, 155, 0.7);
}

/* Playing state: show pause icon */
#player.paused #player-pause {
  letter-spacing: 0;
  font-size: 0.7rem;
}

#player-progress-wrap {
  width: 100%;
  height: 1px;
  background: rgba(180, 165, 135, 0.08);
  position: relative;
  overflow: hidden;
}

#player-progress {
  height: 100%;
  width: 0%;
  background: rgba(200, 175, 120, 0.4);
  box-shadow: 0 0 8px rgba(200, 175, 120, 0.25);
  transition: width 0.3s linear;
}

#player.paused #player-progress {
  opacity: 0.4;
}

#player-time {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.65rem, 1vw, 0.78rem);
  color: rgba(180, 165, 135, 0.22);
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  #quote-text {
    font-size: clamp(1rem, 4.5vw, 1.3rem);
    line-height: 1.75;
    max-width: 88vw;
  }

  #step-inside {
    bottom: 7%;
  }

  #step-inside span {
    font-size: 0.95rem;
    padding: 1rem 2rem;
  }

  .track-item {
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
  }
}

@media (max-height: 500px) {
  #quote-text {
    font-size: 1rem;
  }
}

/* ============================================
   USER MESSAGES
   ============================================ */

#user-message {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 0.8rem 2rem;
  background: rgba(20, 18, 15, 0.92);
  border: 1px solid rgba(180, 165, 135, 0.2);
  color: rgba(200, 185, 155, 0.75);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#user-message.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   LOADING STATE
   ============================================ */

#loading {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #050507;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}

#loading.complete {
  opacity: 0;
  pointer-events: none;
}

#loading-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.75rem;
  color: rgba(180, 165, 135, 0.25);
  letter-spacing: 0.2em;
  animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.5; }
}

/* ============================================
   FILM GRAIN — 1950s footage feel
   ============================================ */

#film-grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================
   ENHANCED MOBILE + TOUCH + POLISH
   ============================================ */

/* Prevent iOS rubber-banding */
body {
  overscroll-behavior-y: none;
}

/* iOS momentum scrolling */
#about-overlay {
  -webkit-overflow-scrolling: touch;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  #room-canvas { cursor: auto; }
  #room-cursor { display: none; }
  #rain-canvas { cursor: auto; }
}

/* Touch target minimums (44x44px) */
@media (max-width: 600px) {
  #sound-toggle {
    font-size: 1rem;
    padding: 1rem 1.5rem;
    min-width: 44px;
    min-height: 44px;
  }

  #back-to-rain {
    font-size: 0.8rem;
    padding: 0.8rem 1.2rem;
    min-height: 44px;
  }

  .track-item {
    padding: 0.9rem 2rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #tracklist-close,
  .info-close {
    padding: 0.8rem 1.5rem;
    min-height: 44px;
  }
}

/* ============================================
   FOCUS INDICATORS — keyboard navigation
   ============================================ */

.hotspot:focus-visible,
.track-item:focus-visible,
#tracklist-close:focus-visible,
.info-close:focus-visible,
.premium-cta:focus-visible,
#sound-toggle:focus-visible,
#back-to-rain:focus-visible,
#step-inside:focus-visible {
  outline: 1px solid rgba(200, 185, 155, 0.4);
  outline-offset: 4px;
}
