/* Records Modal — margashova.com
   Tone: warm | Depth: subtle */

:root {
  --room-bg:        #f0ede8;
  --rm-radius-sm:   4px;
  --rm-radius-md:   6px;
  --rm-radius-xl:   14px;
  --rm-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --rm-ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --rm-dur-fast:    150ms;
}

/* ── Vinyl hotspot ────────────────────────────────────────────── */
.room-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.vinyl-hotspot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.vinyl-overlay {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition: opacity 0.22s ease;
}
.vinyl-hotspot:hover .vinyl-overlay,
.vinyl-hotspot:focus-visible .vinyl-overlay {
  opacity: 0.88;
}
.vinyl-hotspot:focus-visible {
  outline: none;
}

/* ── Modal backdrop ───────────────────────────────────────────── */
.records-modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  animation: rm-fade-in 240ms var(--rm-ease-out) both;
}
.records-modal-root[hidden] {
  display: none;
}
@keyframes rm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.records-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.42);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

/* ── Modal shell ──────────────────────────────────────────────── */
.records-modal {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  background: var(--room-bg);
  border: 1px solid var(--line);
  border-radius: var(--rm-radius-xl);
  padding: 18px 28px 28px;
  animation: rm-slide-up 300ms var(--rm-ease-out) both;
}
@keyframes rm-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Header ───────────────────────────────────────────────────── */
.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}
.records-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rose);
}
.records-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink3);
  margin-left: auto;
  margin-right: 14px;
  font-variant-numeric: tabular-nums;
}
.records-close {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--rm-radius-md);
  background: none;
  display: inline-grid;
  place-items: center;
  color: var(--ink2);
  cursor: pointer;
  transition: color var(--rm-dur-fast), border-color var(--rm-dur-fast);
  font-size: 0;
  flex-shrink: 0;
}
.records-close:hover { color: var(--blue); border-color: var(--blue); }

/* ── Coverflow wrap ───────────────────────────────────────────── */
.records-cf-wrap {
  height: 320px;
  margin: 16px 0 8px;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
}
.records-cf-wrap.dragging { cursor: grabbing; }

.records-coverflow {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1600px;
  transform-style: preserve-3d;
}

.records-card {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 260px;
  height: 260px;
  background: transparent;
  border: none;
  padding: 0;
  transform-style: preserve-3d;
  transition: transform 360ms var(--rm-ease), opacity 360ms var(--rm-ease);
  will-change: transform, opacity;
  cursor: pointer;
}
.records-card[aria-current="true"] { cursor: default; }

/* art wrapper holds SVG placeholder + real cover img */
.cf-art {
  position: relative;
  width: 260px;
  height: 260px;
  display: block;
}
.cf-art svg,
.cf-cover-img {
  display: block;
  border-radius: 2px;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}
.records-card[aria-current="true"] .cf-art svg,
.records-card[aria-current="true"] .cf-cover-img {
  outline-color: rgba(0, 0, 0, 0.14);
}
.cf-cover-img {
  position: absolute;
  inset: 0;
  width: 260px;
  height: 260px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.cf-art svg {
  transition: opacity 0.4s ease;
}
.cf-art.has-cover .cf-cover-img { opacity: 1; }
.cf-art.has-cover svg            { opacity: 0; }

/* Reflection */
.records-reflection {
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  height: 50px;
  overflow: hidden;
  transform: scaleY(-1);
  transform-origin: top;
  margin-top: 2px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.records-reflection svg { border-radius: 2px; }

/* ── Meta ─────────────────────────────────────────────────────── */
.records-meta {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 22px;
}
.records-album {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.25;
  color: var(--ink);
}
.records-sub {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink2);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.records-dot { color: var(--ink3); }
.records-year { font-variant-numeric: tabular-nums; }

/* ── Player ───────────────────────────────────────────────────── */
.records-player-wrap {
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
.records-player {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(440px, 100%);
}
.records-player-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
  cursor: pointer;
  transition: color var(--rm-dur-fast), border-color var(--rm-dur-fast);
}
.records-player-btn:hover { color: var(--blue); border-color: var(--blue); }
.records-player-btn svg { margin-left: 1px; }
.records-player-btn.is-loading { opacity: 0.45; cursor: wait; }

.records-progress {
  position: relative;
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.records-progress-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
  transform: translateY(-50%);
}
.records-progress-fill {
  position: absolute;
  left: 0; top: 50%;
  height: 1px;
  background: var(--ink);
  transform: translateY(-50%);
  transition: width 80ms linear;
}
.records-progress-thumb {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: left 80ms linear, transform var(--rm-dur-fast);
}
.records-progress:hover .records-progress-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}

/* ── Nav (arrows + dots) ──────────────────────────────────────── */
.records-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.records-nav-arrow {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink2);
  border-radius: var(--rm-radius-md);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: color var(--rm-dur-fast), border-color var(--rm-dur-fast), opacity var(--rm-dur-fast);
}
.records-nav-arrow:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); }
.records-nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Dots ─────────────────────────────────────────────────────── */
.records-dots {
  display: flex;
  gap: 6px;
}
.records-dot-btn {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink3);
  border: none;
  padding: 0;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity var(--rm-dur-fast), transform var(--rm-dur-fast), background var(--rm-dur-fast);
}
.records-dot-btn:hover { opacity: 0.8; }
.records-dot-btn.is-current {
  opacity: 1;
  background: var(--ink);
  transform: scale(1.4);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .records-modal { padding: 14px 18px 20px; }
  .records-cf-wrap { height: 240px; }
  .records-card { width: 200px; height: 200px; }
  .records-card svg,
  .records-reflection,
  .records-reflection svg { width: 200px !important; height: 200px !important; }
  .records-reflection { height: 36px !important; }
}
