:root {
  color-scheme: light;
  --ink: #1a1b1f;
  --deep: #2b2d33;
  --cream: #f7e6c6;
  --sand: #e7cfa8;
  --sunset: #f5b07c;
  --tape-gray: #4b4d56;
  --tape-shadow: rgba(16, 18, 24, 0.25);
  --accent: #ff8b5e;
  --accent-2: #ffcf5c;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-condensed: "IBM Plex Sans Condensed", ui-sans-serif, system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    linear-gradient(180deg, rgba(244, 232, 214, 0.92), rgba(236, 222, 201, 0.96)),
    repeating-linear-gradient(
      135deg,
      rgba(156, 120, 85, 0.08) 0px,
      rgba(156, 120, 85, 0.08) 6px,
      rgba(156, 120, 85, 0.02) 6px,
      rgba(156, 120, 85, 0.02) 14px
    );
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: #6f4c2c;
  font-family: var(--font-condensed);
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 46px);
  margin: 2px 0 10px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  position: relative;
}

.hero h1::before,
.hero h1::after {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: rgba(90, 69, 51, 0.4);
  vertical-align: middle;
  margin: 0 14px;
}

h2 {
  font-family: var(--font-condensed);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.lead {
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.6;
  color: #4b3a2a;
  font-family: var(--font-ui);
}

.hero-badges {
  display: grid;
  gap: 16px;
  min-width: 220px;
}

.badge-card {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 24px rgba(83, 52, 24, 0.18);
  border: 1px solid rgba(99, 54, 32, 0.1);
}

.badge-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 4px;
}

.badge-value {
  font-family: var(--font-condensed);
  font-size: 1.4rem;
  margin: 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.header-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.user-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.header-actions--hidden {
  display: none;
}

.stage {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 36px;
}

.stage-single {
  grid-template-columns: 1fr;
}

.panel {
  background: #f9f3ea;
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(103, 67, 33, 0.14);
}

.form-panel {
  position: relative;
  overflow: hidden;
}

.form-panel::after {
  content: "";
  position: absolute;
  inset: auto -40px 12px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 166, 107, 0.35), transparent 70%);
  z-index: 0;
}

.mixtape-form {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
}

.field span {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5f4a36;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(66, 42, 18, 0.2);
  padding: 10px 12px;
  background: #fffaf2;
}

.field input {
  font-family: var(--font-ui);
}

.field textarea {
  font-family: var(--font-ui);
}

.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(66, 42, 18, 0.2);
  padding: 10px 12px;
  font-family: var(--font-ui);
  background: #fffaf2;
}

.mixtape-form p {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
}

.mixtape-form p label {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5f4a36;
}

.mixtape-form p input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(66, 42, 18, 0.2);
  padding: 10px 12px;
  font-family: var(--font-ui);
  background: #fffaf2;
}

.form-errors {
  background: #fff0e4;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.85rem;
  color: #9d3a26;
}

.deck-visual {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.deck-tape {
  width: min(760px, 100%);
  transition: transform 0.5s ease;
}

.deck-tape svg {
  width: 100%;
  height: auto;
  display: block;
}

.deck-tape.active {
  transform: translateY(-4px) rotate(-0.5deg);
}

.deck-tape-title {
  font-family: var(--font-condensed);
}

.deck-view {
  display: grid;
  gap: 18px;
  max-width: 960px;
  margin: 0 auto;
  justify-items: center;
  padding: 10px 0 32px;
}

.deck-view > * {
  width: 100%;
}

.back-link {
  background: none;
  border: none;
  color: #4d3a28;
  font-family: var(--font-condensed);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
  font-size: 0.72rem;
}

.cover-card {
  width: min(340px, 100%);
  border-radius: 18px;
  background: #f7eee1;
  padding: 18px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.cover-art {
  border-radius: 14px;
  padding: 18px;
  min-height: 160px;
  background: linear-gradient(135deg, var(--cover-a, #ffd6a1), var(--cover-b, #ffbda6));
  color: #2a1f1a;
  display: grid;
  align-content: space-between;
  gap: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.15), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.25) 0px,
      rgba(255, 255, 255, 0.25) 6px,
      rgba(255, 255, 255, 0) 6px,
      rgba(255, 255, 255, 0) 14px
    );
  opacity: 0.4;
  pointer-events: none;
}

.cover-text {
  font-family: var(--font-condensed);
  font-size: 2rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.cover-stripes {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--stripe-a, #ffb05e),
    var(--stripe-b, #ff8b5e),
    var(--stripe-c, #ff5d73)
  );
  position: relative;
  z-index: 1;
}

.cover-card.active {
  transform: rotateX(6deg) rotateZ(-1.5deg) translateY(-4px);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);
}

.cover-glow {
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 205, 146, 0.4), transparent 70%);
  pointer-events: none;
}

.cover-label {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: #2a1f1a;
  box-shadow: inset 0 0 0 1px rgba(32, 20, 12, 0.08);
}

.cover-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 6px;
  color: #2a1f1a;
}

.cover-story {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.4;
  color: #3a2b22;
}

.deck-player {
  border-radius: 10px;
  background: transparent;
  padding: 8px 0 0;
  min-height: 120px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
  color: #6f675f;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  padding: 14px;
  border-radius: 16px;
  max-width: 760px;
}

.deck-player iframe {
  width: 100%;
  border-radius: 12px;
}

.player-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #8b837b;
  font-family: var(--font-condensed);
}

.deck-bay {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  max-width: 760px;
}

.player-placeholder {
  text-align: center;
  opacity: 0.8;
}

.site-footer {
  margin-top: 24px;
  padding: 22px 16px 28px;
  text-align: center;
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
  color: #6c5a45;
  border-top: 1px solid rgba(96, 62, 32, 0.18);
  background: rgba(249, 243, 234, 0.6);
  position: relative;
  z-index: 2;
}

.wall-stage {
  position: relative;
  margin-top: 6px;
  padding-bottom: 32px;
}

.rack-panel {
  position: relative;
  overflow: hidden;
  padding: 10px 0 26px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.shelf-hint {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: #6b5a45;
  margin: 8px 0 18px;
  text-align: center;
}

.shelf {
  margin-bottom: 28px;
}

.shelf__frame {
  position: relative;
}

.shelf__rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 18px 10px 22px;
  scroll-snap-type: x mandatory;
  align-items: flex-end;
  border-top: none;
  border-bottom: none;
  padding-bottom: 6px;
}

.shelf__empty {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: rgba(90, 69, 51, 0.5);
  padding: 24px 10px;
  border: 1px dashed rgba(90, 69, 51, 0.2);
  border-radius: 12px;
}

.shelf__plank {
  position: relative;
  margin-top: -12px;
}

.shelf__wood {
  width: 100%;
  height: 140px;
  display: block;
  transform: translateY(-4px);
  position: relative;
  z-index: 1;
}

.shelf__overlay {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  z-index: 2;
}

.shelf__overlay h2 {
  font-family: var(--font-condensed);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: rgba(60, 40, 22, 0.85);
}

.meta {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: #6c5a45;
}

.shelf__actions {
  display: flex;
  gap: 10px;
  font-family: var(--font-condensed);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  align-items: center;
  pointer-events: auto;
}

.link-button {
  color: #5b4633;
  text-decoration: none;
  padding: 2px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.link-button:hover {
  color: #2f251b;
}

.link-button--danger {
  color: #7b3b2c;
}

.link-button--danger:hover {
  color: #4c241b;
}

.spine {
  scroll-snap-align: start;
  width: 92px;
  height: 360px;
}

.spine.is-chosen {
  transform: scale(1.02);
}

.spine.is-ghost {
  opacity: 0.5;
}

.wall-stage.focus-deck .rack-panel {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.rack-panel::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 18px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 69, 45, 0.2), rgba(94, 69, 45, 0.08));
}

.rack-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  font-family: var(--font-condensed);
}

.rack-header h2 {
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
  color: #5a4533;
}

.rack-header::before,
.rack-header::after {
  content: "";
  height: 1px;
  width: 120px;
  background: rgba(90, 69, 51, 0.35);
}

.rack-header p {
  display: none;
}

.deck-stage {
  display: grid;
  align-content: start;
  width: 100%;
  margin: 0;
  position: relative;
  background:
    linear-gradient(180deg, rgba(244, 232, 214, 0.92), rgba(236, 222, 201, 0.96)),
    repeating-linear-gradient(
      135deg,
      rgba(156, 120, 85, 0.08) 0px,
      rgba(156, 120, 85, 0.08) 6px,
      rgba(156, 120, 85, 0.02) 6px,
      rgba(156, 120, 85, 0.02) 14px
    );
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  max-height: 2000px;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.6s ease;
}

.deck-hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
  max-height: 0;
}

.deck-back {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  margin-bottom: -10px;
}

.deck-meta h2 {
  font-family: var(--font-display);
  margin: 0 0 4px;
  font-size: 1.9rem;
}

.deck-meta {
  max-width: 62ch;
  margin: 0 auto;
}

.deck-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(96, 62, 32, 0.2);
  border-radius: 999px;
  color: #5f4a36;
  background: transparent;
}

.chip.is-empty {
  display: none;
}

.deck-story {
  border-top: 1px solid rgba(96, 62, 32, 0.2);
  padding-top: 16px;
  margin: 22px auto 0;
  transition: transform 0.35s ease;
  max-width: 62ch;
}

.deck-story p {
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.65;
  margin: 0;
  color: #3a2b22;
}

.deck-story.active {
  transform: translateY(-2px);
}

.cassette-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 140px);
  gap: 10px;
  margin: 22px auto 0;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  justify-content: center;
}

.tape-sleeve {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transform-origin: center;
  transition: opacity 0.3s ease;
}
.tape-sleeves {
  align-items: start;
}

.tape-sleeve-svg {
  width: 92px;
  height: 360px;
  display: block;
}

.tape-sleeve-svg .sleeve-title,
.tape-sleeve-svg .sleeve-subtitle,
.tape-sleeve-svg .sleeve-genre {
  font-family: var(--font-condensed);
}

.tape-sleeve:focus-visible {
  outline: 2px solid #ffb05e;
  outline-offset: 4px;
}

.manage-list {
  display: grid;
  gap: 12px;
}

.manage-card {
  background: #fff7eb;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(96, 62, 32, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.manage-card h3 {
  font-family: var(--font-condensed);
  margin: 0 0 6px;
}

.manage-card p {
  margin: 0;
  max-width: 560px;
}

.manage-meta {
  font-family: var(--font-condensed);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #6c5a45;
  margin-bottom: 6px;
}

.manage-flags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.flag {
  font-family: var(--font-condensed);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(96, 62, 32, 0.2);
  border-radius: 999px;
  color: #5a4631;
  background: transparent;
}

.manage-actions {
  display: flex;
  gap: 8px;
}

.icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}

.confirm-delete {
  display: flex;
  justify-content: flex-start;
}

.empty-state {
  padding: 32px;
  text-align: center;
  font-size: 0.95rem;
  color: #6e4c2d;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 28px 16px 48px;
  }

  .hero {
    align-items: flex-start;
  }

  .panel {
    padding: 20px;
  }

  .lead {
    font-size: 0.98rem;
  }

  .cta-row {
    width: 100%;
  }

  .cassette-row {
    grid-auto-columns: minmax(110px, 130px);
  }

  .tape-sleeve-svg {
    width: 76px;
    height: 300px;
  }

  .spine {
    width: 76px;
    height: 300px;
  }

  .shelf__overlay {
    left: 20px;
    right: 20px;
    top: 26px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shelf__actions {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .shelf__rail {
    padding: 14px 6px 18px;
    gap: 12px;
  }

  .wall-stage {
    min-height: 680px;
  }

  .deck-story {
    padding-top: 14px;
  }
}
