/* ---- Dave Sings Country Classics — tribute cassette player ---- */

@font-face {
  font-family: "Special Elite";
  src: url("fonts/SpecialElite.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper:      #efe6d6;
  --paper-2:    #e7dcc6;
  --ink:        #3a2c1d;
  --ink-soft:   #6d5b46;
  --kraft:      #c9b079;
  --kraft-edge: #b29a64;
  --kraft-ink:  #4a3826;
  --wood:       #5b3d27;
  --wood-2:     #3f2918;
  --shell:      #f3ece0;
  --shell-edge: #cdc2ad;
  --tape:       #6b4a2f;
  --accent:     #9a3b2e;   /* muted barn red */
  --shadow:     rgba(40, 26, 12, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, #f7f0e2 0%, var(--paper) 55%, var(--paper-2) 100%) fixed;
  line-height: 1.5;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1.1rem 3rem;
}

/* ---------- Memorial header ---------- */
.memorial { text-align: center; margin-bottom: clamp(1.8rem, 5vw, 2.8rem); }

.eyebrow {
  font-family: "Special Elite", "Courier New", monospace;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--ink-soft);
  margin: 0 0 .6rem;
}

.memorial h1 {
  font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  letter-spacing: .01em;
  margin: 0;
  color: var(--ink);
}

.dates {
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: .25rem 0 1.4rem;
}

.portrait {
  margin: 0 auto;
  width: min(330px, 78%);
}
.portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 7px solid #fff;
  box-shadow: 0 10px 30px var(--shadow), 0 2px 6px rgba(0,0,0,.18);
  transform: rotate(-1.2deg);
}

.tribute {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 1.5rem auto 0;
  max-width: 30ch;
}

/* ---------- The deck ---------- */
.deck {
  background:
    linear-gradient(155deg, var(--wood) 0%, var(--wood-2) 100%);
  border-radius: 16px;
  padding: clamp(1rem, 4vw, 1.7rem);
  box-shadow:
    0 18px 40px var(--shadow),
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -3px 12px rgba(0,0,0,.4);
  position: relative;
}
/* subtle wood grain */
.deck::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  background-image: repeating-linear-gradient(
    92deg, rgba(255,255,255,.035) 0 2px, transparent 2px 7px,
    rgba(0,0,0,.05) 7px 9px, transparent 9px 16px);
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ---------- Cassette ---------- */
.cassette {
  position: relative;
  aspect-ratio: 8 / 5;
  background: linear-gradient(180deg, var(--shell) 0%, #e8dfd0 100%);
  border-radius: 12px;
  border: 1px solid var(--shell-edge);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.8),
    inset 0 -8px 18px rgba(120,100,70,.25),
    0 8px 18px rgba(0,0,0,.3);
  padding: 7% 8% 0;
  overflow: hidden;
}

.screw {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b9ad96 60%, #8c8068);
  box-shadow: inset 0 0 2px rgba(0,0,0,.4);
}
.screw::after {
  content: ""; position: absolute; inset: 3px;
  border-top: 1.5px solid rgba(0,0,0,.35);
  transform: rotate(35deg);
}
.screw.tl { top: 5%; left: 4%; }  .screw.tr { top: 5%; right: 4%; }
.screw.bl { bottom: 6%; left: 4%; } .screw.br { bottom: 6%; right: 4%; }

/* kraft J-card label */
.label {
  background: linear-gradient(180deg, var(--kraft) 0%, var(--kraft-edge) 100%);
  border: 1px solid var(--kraft-edge);
  border-radius: 4px;
  padding: 5% 6% 6%;
  text-align: center;
  font-family: "Special Elite", "Courier New", monospace;
  color: var(--kraft-ink);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.4), 0 1px 3px rgba(0,0,0,.2);
  position: relative;
}
.label::after { /* two ruled lines like a real insert */
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 17%;
  border-top: 1px solid rgba(74,56,38,.25);
  box-shadow: 0 5px 0 -4px rgba(74,56,38,.25);
}
.label-title { display: block; font-size: clamp(.85rem, 3.4vw, 1.15rem); letter-spacing: .02em; }
.label-artist { display: block; font-size: clamp(.7rem, 2.6vw, .9rem); margin-top: .15em; opacity: .85; }
.label-side {
  position: absolute; top: 6%; right: 7%;
  font-size: .6rem; letter-spacing: .12em;
  border: 1px solid rgba(74,56,38,.5);
  border-radius: 2px; padding: 1px 4px;
}

/* window with reels */
.window {
  position: relative;
  margin: 6% auto 0;
  width: 86%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reel {
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #efe9dc 0 18%, transparent 18%),
    radial-gradient(circle at 50% 50%, var(--tape) 0 50%, transparent 50%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5), inset 0 0 14px rgba(0,0,0,.35);
  position: relative;
}
/* the brown tape pack thickness differs slightly L vs R */
.reel-left  { box-shadow: inset 0 0 0 9px var(--tape), inset 0 0 0 11px rgba(0,0,0,.15), inset 0 0 16px rgba(0,0,0,.4); }
.reel-right { box-shadow: inset 0 0 0 20px var(--tape), inset 0 0 0 22px rgba(0,0,0,.15), inset 0 0 16px rgba(0,0,0,.4); }

.hub {
  width: 34%; height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #d9cfbb 70%, #b6a888);
  position: relative;
  box-shadow: 0 0 0 3px rgba(255,255,255,.35), inset 0 0 3px rgba(0,0,0,.3);
}
.hub span { /* the 3 teeth */
  position: absolute; top: 50%; left: 50%;
  width: 16%; height: 42%;
  background: #9a8e72;
  transform-origin: center -8%;
}
.hub span:nth-child(1){ transform: translate(-50%,-8%) rotate(0deg); }
.hub span:nth-child(2){ transform: translate(-50%,-8%) rotate(120deg); }
.hub span:nth-child(3){ transform: translate(-50%,-8%) rotate(240deg); }

.tape-path {
  flex: 1;
  height: 8px;
  margin: 0 4%;
  background: linear-gradient(180deg, var(--tape), #4f3620);
  border-radius: 2px;
  align-self: flex-end;
  margin-bottom: 8%;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* spinning */
@keyframes spin { to { transform: rotate(360deg); } }
.cassette.playing .hub { animation: spin 1.7s linear infinite; }
.cassette.playing .reel-right .hub { animation-duration: 2.1s; }
.cassette.seeking .hub { animation-duration: .5s !important; }

.shell-bottom {
  position: absolute;
  bottom: 5%; left: 0; right: 0;
  display: flex; justify-content: center; gap: 16%;
}
.shell-bottom .sprocket {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #cfc6b2, #a99c80);
  box-shadow: inset 0 0 3px rgba(0,0,0,.5);
}

/* ---------- Display ---------- */
.display {
  margin: 1.1rem 0 .6rem;
  background: #20160d;
  border-radius: 8px;
  padding: .7rem .9rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  color: #ffce8a;
  font-family: "Special Elite", "Courier New", monospace;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
  text-shadow: 0 0 6px rgba(255,160,60,.5);
}
.track-no {
  font-size: 1.3rem;
  min-width: 1.6em; text-align: center;
  color: #ffb761;
}
.now-title {
  font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.time { font-size: .82rem; letter-spacing: .03em; white-space: nowrap; opacity: .9; }
.time .slash { opacity: .5; }

/* ---------- Scrubber ---------- */
.scrubber {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  border-radius: 4px;
  background: rgba(0,0,0,.35);
  outline: none;
  margin: .2rem 0 1.1rem;
  cursor: pointer;
}
.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--kraft) 70%, var(--kraft-edge));
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.scrubber::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--kraft);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* ---------- Transport ---------- */
.transport {
  display: flex; justify-content: center; gap: .5rem;
}
.key {
  flex: 1; max-width: 64px;
  height: 46px;
  border: none;
  border-radius: 7px;
  background: linear-gradient(180deg, #efe7d8 0%, #cdc1aa 100%);
  box-shadow: 0 3px 0 #8d7f64, 0 5px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.7);
  color: #3a2c1d;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .05s ease;
  display: grid; place-items: center;
}
.key:hover { filter: brightness(1.04); }
.key:active, .key.pressed {
  transform: translateY(3px);
  box-shadow: 0 0 0 #8d7f64, 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5);
}
.key-play {
  background: linear-gradient(180deg, #c4553f 0%, #9a3b2e 100%);
  box-shadow: 0 3px 0 #6f281d, 0 5px 8px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff;
}
.key-play:active, .key-play.pressed { box-shadow: 0 0 0 #6f281d, 0 1px 3px rgba(0,0,0,.4); }
.key .g { line-height: 1; pointer-events: none; }

/* ---------- Tracklist ---------- */
.tracklist {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1.6rem;
}
.side h2 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(58,44,29,.2);
  padding-bottom: .4rem; margin: 0 0 .4rem;
}
.tracklist ol { list-style: none; margin: 0; padding: 0; }
.track {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .42rem .5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s ease;
}
.track:hover { background: rgba(154,59,46,.08); }
.track .n { font-family: "Special Elite", monospace; font-size: .8rem; color: var(--ink-soft); min-width: 1.3em; }
.track .t { flex: 1; font-size: .96rem; }
.track .d { font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.track.active { background: rgba(154,59,46,.14); }
.track.active .t { font-weight: 700; color: var(--accent); }
.track.active .n::before { content: "\25B8\00a0"; color: var(--accent); }

/* ---------- Footer ---------- */
/* ---------- Download ---------- */
.download { text-align: center; margin-top: 2rem; }
.dl-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1rem; letter-spacing: .02em;
  color: var(--kraft-ink);
  background: linear-gradient(180deg, var(--kraft) 0%, var(--kraft-edge) 100%);
  border: 1px solid var(--kraft-edge);
  padding: .8rem 1.5rem; border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 3px 0 #a98f57, 0 5px 10px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .05s ease, box-shadow .05s ease, filter .1s ease;
}
.dl-btn:hover { filter: brightness(1.04); }
.dl-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #a98f57, 0 1px 3px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.3);
}
.dl-ico { font-size: 1.15rem; line-height: 1; }
.dl-note { font-size: .8rem; color: var(--ink-soft); font-style: italic; margin-top: .55rem; }

footer {
  margin-top: 2rem; text-align: center;
  font-size: .82rem; color: var(--ink-soft); font-style: italic;
}

@media (max-width: 460px) {
  .tracklist { grid-template-columns: 1fr; gap: 1rem; }
  .key { height: 50px; }
  .now-title { font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cassette.playing .hub { animation: none; }
}
