.record-player {
  --jacket-stock: #f4e5bd;
  --jacket-ink: #243f35;
  --jacket-copper: #90431e;
  --song-progress: 0%;
  isolation: isolate;
  position: relative;
  color: var(--jacket-ink);
  background:
    radial-gradient(ellipse at 32% 0%, #47635496, transparent 68%),
    linear-gradient(116deg, #263e33, #182e26);
  border-block: 1px solid #41513f;
}
.record-player::before {
  content: "";
  pointer-events: none;
  z-index: -1;
  position: absolute;
  inset: 0;
  background: url("assets/paper-grain.png") repeat;
  opacity: 0.095;
  mix-blend-mode: screen;
}
.record-inner {
  width: min(100%, 75rem);
  margin-inline: auto;
  padding: clamp(2.5rem, 5.1vw, 5.7rem) var(--edge);
}
.record-jacket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  border: 1px solid #c4b390;
  border-radius: 2px;
  isolation: isolate;
  background:
    url("assets/paper-grain.png") repeat,
    var(--jacket-stock);
  box-shadow:
    0 1px 0 #fbf1cf,
    0 3px 0 #b7a986,
    0 4px 0 #4d513c,
    0 7px 8px #101c155c,
    0 17px 36px #0b1c1585;
}
.record-pocket {
  display: grid;
  place-items: center;
  padding: clamp(1.7rem, 3.5vw, 3.8rem) clamp(1.2rem, 2.75vw, 3.7rem);
  background:
    url("assets/paper-grain.png") repeat,
    linear-gradient(
      98deg,
      #cfbf95,
      #e2cca0 20%,
      #dec89b 88%,
      #c1a77e 99%,
      #b19b76
    );
  border-radius: 2px 0 0 2px;
}
.sleeve-art {
  position: relative;
  width: 100%;
  max-width: 24.5rem;
  aspect-ratio: 1.39;
  isolation: isolate;
}
.sleeve {
  position: absolute;
  display: block;
  width: 72%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  left: 0;
  top: -0.5%;
  transform: rotate(-3deg);
  box-shadow:
    0 1px 1px #4d351faa,
    2px 4px 5px #4d351f66,
    2px 9px 13px #66451e42;
}
.vinyl {
  --disc-size: 68.5%;
  position: absolute;
  top: 1.8%;
  right: 0;
  width: var(--disc-size);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #87826b;
  box-shadow:
    1px 3px 6px #111e19b0,
    0 7px 14px #14221e80;
  background:
    repeating-radial-gradient(
      circle,
      transparent 0 1.2px,
      #e8ddc51c 1.5px,
      transparent 2.4px
    ),
    conic-gradient(
      from 16deg,
      #1a2422,
      #191c1b 38deg,
      #76796b 75deg,
      #2e3935 99deg,
      #151b1a 130deg,
      #2e322c 189deg,
      #5a6154 247deg,
      #202724 284deg,
      #141b19 338deg,
      #1a2422
    );
}
/* Grooves rotate under the stationary reflection from the café window. */
.vinyl::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50.7% 49.8%,
    transparent 0 4.2%,
    #e6d8ac28 4.4% 4.65%,
    transparent 4.9% 7%
  );
  mask-image: conic-gradient(
    transparent 0deg 30deg,
    #0009 58deg,
    transparent 105deg 190deg,
    #000 212deg,
    transparent 236deg 360deg
  );
  animation: spin-label 6s linear infinite;
  animation-play-state: paused;
}
.vinyl-label {
  position: absolute;
  display: block;
  width: 36%;
  aspect-ratio: 1;
  inset: 0;
  margin: auto;
  border: 1px solid #b99556;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #0d201c 0 4%,
      #ceb991 4.5% 5.6%,
      transparent 6% 49%,
      #793f2c 49.5% 50.5%,
      transparent 51%
    ),
    conic-gradient(
      from 185deg at 53% 83%,
      #ba633d 15deg,
      #d89951 15deg 28deg,
      #b25634 28deg 38deg,
      #e2ad64 38deg 53deg,
      #b55a3a 53deg 65deg,
      #dca55e 65deg 79deg,
      #b9603b 79deg 91deg,
      #d49a57 91deg 102deg,
      #b55f3a 102deg 118deg,
      #d69b53 118deg 140deg,
      #b75d39 140deg
    );
  animation: spin-label 6s linear infinite;
  animation-play-state: paused;
}
.vinyl-label::after {
  content: "";
  position: absolute;
  top: 23%;
  right: 21%;
  width: 22%;
  height: 7%;
  border-block: 1px solid #f2c77b;
  transform: rotate(12deg);
}
.record-player.is-playing .vinyl::before,
.record-player.is-playing .vinyl-label {
  animation-play-state: running;
}
@keyframes spin-label {
  to {
    transform: rotate(360deg);
  }
}
.record-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.9rem, 3.4vw, 3.7rem) clamp(1.55rem, 3.3vw, 3.55rem);
  border-radius: 0 2px 2px 0;
  background:
    url("assets/paper-grain.png") repeat,
    linear-gradient(
      90deg,
      #b5a07a 0%,
      #dccea8 0.8%,
      #e9d9b5 3%,
      #f3e6c7 11%,
      #f7ebcb 72%,
      #f0dfbb
    );
}
.record-copy h2 {
  color: var(--jacket-ink);
  font: 500 italic clamp(2.25rem, 4.35vw, 4.25rem) / 0.95 var(--serif);
  letter-spacing: -0.048em;
  margin: 0;
}
.liner-poem {
  margin: clamp(1.05rem, 1.7vw, 1.6rem) 0 clamp(1.1rem, 2.05vw, 1.9rem);
  color: #433a2c;
  font: 500 clamp(1.13rem, 1.7vw, 1.54rem) / 1.3 var(--serif);
}
.liner-poem span {
  display: block;
}
.record-player .deck-controls {
  display: none;
  align-items: start;
  gap: clamp(0.75rem, 1.7vw, 1.35rem);
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid #705e3d52;
}
.record-player.player-ready .deck-controls {
  display: flex;
}
.record-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
  color: #fff2d1;
  background: var(--jacket-ink);
  border: 1px solid #243b2c;
  box-shadow: 0 2px 4px #68542c35;
  border-radius: 50%;
  align-self: start;
  padding: 0;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}
.record-toggle svg {
  grid-area: 1/1;
  width: 1.2rem;
  height: 1.2rem;
}
.record-player .when-playing,
.record-player.is-playing .when-paused {
  display: none;
}
.record-player.is-playing .when-playing {
  display: block;
}
.record-toggle:hover {
  background: #425e46;
}
.record-toggle:active {
  transform: scale(0.96);
}
.record-toggle:focus-visible,
.wave:focus-within {
  outline: 2px solid #995123;
  outline-offset: 3px;
}
.scrubber {
  min-width: 0;
  flex: 1;
}
.wave {
  position: relative;
  height: 48px;
  color: #7d745e;
  border-radius: 3px;
}
.wave svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.wave-base {
  color: #80775f;
}
.wave-played {
  color: var(--jacket-copper);
  clip-path: inset(0 calc(100% - var(--song-progress)) 0 0);
}
.wave::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  left: clamp(0px, var(--song-progress), calc(100% - 2px));
  border-radius: 4px;
  background: var(--jacket-copper);
  pointer-events: none;
}
.wave input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  position: absolute;
  inset: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  touch-action: pan-y;
}
.wave input::-webkit-slider-runnable-track {
  height: 100%;
}
.wave input::-moz-range-track {
  height: 100%;
}
.wave input::-webkit-slider-thumb {
  appearance: none;
  width: 1px;
  height: 100%;
}
.wave input::-moz-range-thumb {
  border: 0;
  width: 1px;
  height: 100%;
}
.record-player .times {
  display: flex;
  justify-content: space-between;
  color: #675b45;
  font: 500 0.875rem/1.25 var(--sans);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.record-player audio[controls] {
  display: block;
  width: 100%;
  max-width: 27rem;
  margin-top: 1.15rem;
}
.record-player.player-ready audio,
.record-player [hidden],
.record-player [data-song-status]:empty {
  display: none;
}
.record-player [data-song-status]:not(:empty) {
  margin: 0.55rem 0 0;
  font: 500 0.9rem/1.5 var(--sans);
  color: #783821;
}
@media (max-width: 700px) {
  .record-inner {
    max-width: 36rem;
    padding: clamp(1.6rem, 6.5vw, 2.5rem) clamp(1rem, 4.7vw, 2rem);
  }
  .record-jacket {
    grid-template-columns: minmax(0, 0.93fr) minmax(0, 1.18fr);
    column-gap: clamp(0.7rem, 4vw, 1.5rem);
    padding: clamp(1.1rem, 4.7vw, 1.8rem) clamp(1.05rem, 4.7vw, 1.85rem);
    background:
      url("assets/paper-grain.png") repeat,
      linear-gradient(102deg, #ead8b0, #f8eac8 22%, #f4e4c0 95%, #e3cfa7);
  }
  .record-pocket {
    padding: 0.1rem 0;
    align-self: center;
    background: none;
    border-radius: 0;
  }
  .record-copy {
    display: contents;
  }
  .record-copy h2 {
    align-self: center;
    font-size: clamp(2rem, 8vw, 3.1rem);
    line-height: 0.99;
    text-wrap: balance;
  }
  .liner-poem {
    grid-column: 1/-1;
    margin: clamp(1.1rem, 4.6vw, 1.6rem) 0 1rem;
    font-size: clamp(1.07rem, 4.65vw, 1.45rem);
    line-height: 1.32;
  }
  .record-player .deck-controls,
  .record-player audio[controls],
  .record-player [data-song-status] {
    grid-column: 1/-1;
  }
  .record-player .deck-controls {
    gap: 0.8rem;
    padding-top: 0.7rem;
  }
  .record-toggle {
    width: 3rem;
    height: 3rem;
  }
}

@media (max-width: 350px) {
  .record-inner {
    padding-inline: 0.75rem;
  }
  .record-jacket {
    padding-inline: 0.8rem;
  }
  .liner-poem {
    font-size: 1.025rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-toggle,
  .vinyl::before,
  .vinyl-label {
    animation: none;
    transition: none;
  }
}
