/* ==========================================================
   ADAM MACHIN — mid-century jazz sleeve
   Themes are driven by CSS custom properties on <html data-theme>
   ========================================================== */

:root {
  --font-display: "Archivo Black", sans-serif;
  --font-condensed: "Oswald", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

/* -------- Theme: Red Note (default, from the album art) -------- */
[data-theme="red-note"] {
  --bg: #f2e8d5;
  --paper: #f2e8d5;
  --ink: #1a1712;
  --accent: #cf2e2e;
  --accent-2: #1e8f96;
  --accent-3: #e5a819;
  --muted: #6b6152;
  --card: #efe3cc;
  --strip-bg: #1a1712;
  --strip-ink: #f2e8d5;
  --record-body: #16130f;
  --record-label: #cf2e2e;
  --texture-opacity: 0.5;
}

/* -------- Theme: Blue Note -------- */
[data-theme="blue-note"] {
  --bg: #eef1f2;
  --paper: #eef1f2;
  --ink: #10151c;
  --accent: #1450a3;
  --accent-2: #2a9bb5;
  --accent-3: #e8e2d4;
  --muted: #5a6673;
  --card: #e4e9ec;
  --strip-bg: #10151c;
  --strip-ink: #eef1f2;
  --record-body: #10151c;
  --record-label: #1450a3;
  --texture-opacity: 0.35;
}

/* -------- Theme: Midnight (after-hours set) -------- */
[data-theme="midnight"] {
  --bg: #14121b;
  --paper: #14121b;
  --ink: #efe8da;
  --accent: #e0533d;
  --accent-2: #3fb8ad;
  --accent-3: #d9a52b;
  --muted: #8d8578;
  --card: #1d1a27;
  --strip-bg: #efe8da;
  --strip-ink: #14121b;
  --record-body: #0b0a10;
  --record-label: #d9a52b;
  --texture-opacity: 0.25;
}

/* -------- Theme: Espresso (for the coffee) -------- */
[data-theme="espresso"] {
  --bg: #ece1d1;
  --paper: #ece1d1;
  --ink: #2b1c12;
  --accent: #8c3b1b;
  --accent-2: #4f6f52;
  --accent-3: #c98f2e;
  --muted: #7a624d;
  --card: #e5d6c1;
  --strip-bg: #2b1c12;
  --strip-ink: #ece1d1;
  --record-body: #241710;
  --record-label: #c98f2e;
  --texture-opacity: 0.45;
}

/* ---------------- Base ---------------- */

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

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  transition: background 0.5s ease, color 0.5s ease;
  display: flex;
  justify-content: center;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: var(--texture-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sleeve {
  width: min(1200px, 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2.5vw, 32px);
}

/* ---------------- Top strip ---------------- */

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-condensed);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: clamp(0.65rem, 1.4vw, 0.85rem);
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.75rem;
}

.label-name { color: var(--ink); }
.label-fidelity { color: var(--accent); text-decoration: none; }

a.label-fidelity:hover,
a.label-fidelity:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.label-stereo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--ink);
}
.stereo-icon { width: 2em; height: 1em; }
.label-catalogue {
  background: var(--accent);
  color: var(--bg);
  padding: 0.25em 0.7em;
}

/* ---------------- Cover layout ---------------- */

.cover {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3.5rem) 0;
}

/* ---------------- Left: type ---------------- */

.big-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.92;
  color: var(--accent);
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
}

.subtitle-teal,
.subtitle-black {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-top: 0.35rem;
}
.subtitle-teal { color: var(--accent-2); }
.subtitle-black { color: var(--ink); }

.rule {
  border: none;
  border-top: 3px solid var(--ink);
  margin: 1.2rem 0 0.9rem;
  width: min(420px, 100%);
}

.tagline {
  font-family: var(--font-condensed);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
}

.liner-notes {
  list-style: none;
  margin-top: 1.4rem;
  display: grid;
  gap: 0.45rem;
}

.liner-notes strong {
  font-family: var(--font-condensed);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  color: var(--ink);
}

.liner-notes em {
  font-style: normal;
  font-family: var(--font-condensed);
  font-weight: 400;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.liner-notes li:nth-child(4n + 1) em { color: var(--accent); }
.liner-notes li:nth-child(4n + 2) em { color: var(--accent-2); }
.liner-notes li:nth-child(4n + 3) em { color: var(--accent-3); }
.liner-notes li:nth-child(4n + 4) em { color: var(--muted); }

.links {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.links a {
  font-family: var(--font-condensed);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.55em 1.1em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.links a:hover,
.links a:focus-visible {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ---------------- Right: geometric art ---------------- */

.cover-art {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
}

.art-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.block { position: relative; overflow: hidden; }

.block-teal { background: var(--accent-2); }
.block-red { background: var(--accent); }
.block-mustard { background: var(--accent-3); }
.block-cream { background: var(--card); }
.block-black { background: var(--ink); }
.block-teal-2 { background: var(--accent-2); }

/* arch shape (like the mustard arch) */
.arch {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 62%;
  height: 82%;
  background: var(--accent);
  border-radius: 50% 50% 0 0 / 45% 45% 0 0;
}

/* moon circle */
.moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 6px var(--accent-2);
}

/* vertical piano-string lines */
.strings {
  position: absolute;
  inset: 12% 20%;
  background: repeating-linear-gradient(
    90deg,
    var(--paper) 0 3px,
    transparent 3px 14px
  );
}

/* half dot */
.half-dot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  aspect-ratio: 2 / 1;
  border-radius: 999px 999px 0 0;
  background: var(--ink);
}

/* ---------------- Spinning record ---------------- */

.record-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  aspect-ratio: 1;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}

.record {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--record-body);
  animation: spin 8s linear infinite;
}

.record-grooves {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.06) 0 2px,
    transparent 2px 6px
  );
}

.record-label {
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  background: var(--record-label);
  display: grid;
  place-items: center;
}

.record-label-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.8rem);
  color: var(--bg);
  letter-spacing: 0.05em;
}

.record-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
}

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

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

/* ---------------- Catalogue box ---------------- */

.catalogue-box {
  position: absolute;
  right: -4%;
  bottom: -5%;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  min-width: 42%;
}

.catalogue-name {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.8vw, 1.2rem);
  line-height: 1.05;
  padding: 0.7em;
  border-right: 3px solid var(--ink);
  color: var(--ink);
}

.catalogue-name .reg { font-size: 0.5em; vertical-align: super; }

.catalogue-side {
  display: flex;
  flex-direction: column;
}

.catalogue-dot {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0.5em;
}

.catalogue-dot::after {
  content: "";
  width: clamp(24px, 3.5vw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
}

.catalogue-number {
  background: var(--accent-2);
  color: var(--paper);
  font-family: var(--font-condensed);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: clamp(0.6rem, 1.3vw, 0.8rem);
  text-align: center;
  padding: 0.5em 0.3em;
  border-top: 3px solid var(--ink);
}

/* ---------------- Bio page ---------------- */

.bio-cover {
  flex: 1;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.bio-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
}

.bio-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.bio-section-title {
  font-family: var(--font-condensed);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  color: var(--accent);
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.bio-side .bio-section-title:not(:first-child) {
  margin-top: 2rem;
}

.bio-about p {
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  line-height: 1.65;
  margin-bottom: 1rem;
  max-width: 60ch;
}

.tracklist {
  list-style: none;
  counter-reset: track;
  display: grid;
  gap: 0.5rem;
}

.tracklist li {
  counter-increment: track;
  display: flex;
  align-items: baseline;
  gap: 0.7em;
}

.tracklist li::before {
  content: counter(track, decimal-leading-zero) ".";
  font-family: var(--font-condensed);
  font-weight: 600;
  color: var(--accent-2);
  font-size: 0.85rem;
}

.tracklist strong {
  font-family: var(--font-condensed);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  color: var(--ink);
}

@media (max-width: 860px) {
  .bio-columns {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* rules on the bio page: consistent full width */
.bio-cover .rule {
  width: 100%;
}

/* an hr placed directly inside the grid spans both columns */
.bio-columns > .rule {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------------- Bottom strip / theme switcher ---------------- */

.bottom-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  border-top: 3px solid var(--ink);
  padding-top: 0.9rem;
  font-family: var(--font-condensed);
}

.pressing-label {
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--muted);
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-condensed);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  padding: 0.5em 0.9em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-btn:hover { background: var(--card); }

.theme-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.swatch {
  width: 0.9em;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.swatch-red-note { background: linear-gradient(135deg, #cf2e2e 50%, #1e8f96 50%); }
.swatch-blue-note { background: linear-gradient(135deg, #1450a3 50%, #eef1f2 50%); }
.swatch-midnight { background: linear-gradient(135deg, #14121b 50%, #d9a52b 50%); }
.swatch-espresso { background: linear-gradient(135deg, #8c3b1b 50%, #ece1d1 50%); }

.copyright {
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--muted);
}

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

@media (max-width: 860px) {
  .cover {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .cover-art {
    max-height: none;
    width: min(440px, 92%);
    margin: 0 auto;
    aspect-ratio: 1;
  }

  .top-strip .label-fidelity { display: none; }
}

@media (max-width: 480px) {
  .top-strip .label-stereo { display: none; }
  .catalogue-box { right: 0; }
}
