:root {
  --bg: #f4f2ee;
  --ink: #111;
  --muted: #7a766f;
  --line: #dcd8d0;
  --accent: #d6402b;
  --radius: 4px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.top a { text-decoration: none; }
.top nav a { margin-left: 24px; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 74px);
  padding-bottom: 48px;
}

.hero-photo {
  position: relative;
  height: min(78vh, 760px);
  overflow: hidden;
  border-radius: var(--radius);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.hero-copy { display: flex; flex-direction: column; gap: 40px; }

h1 {
  font-size: clamp(56px, 7.5vw, 112px);
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 700;
}
h1 em { font-style: normal; color: var(--accent); }

.lede { max-width: 38ch; color: var(--muted); font-size: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 15px var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn.small { padding: 8px 14px; font-size: 13px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- CD player (discman) ---------- */
.player {
  width: 260px;
  aspect-ratio: 1 / 1.08;
  padding: 16px;
  border-radius: 28px;
  background: linear-gradient(145deg, #e9e7e3, #c9c6c0);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -2px 4px rgba(0,0,0,.12),
    0 24px 40px -18px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-lid {
  position: relative;
  flex: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a3a3a, #111 70%);
  box-shadow: inset 0 0 0 6px #d9d6d0, inset 0 0 0 7px #aaa;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.disc {
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #111 0 7%, #cfcfcf 7.5% 9%, transparent 9.5% 30%, rgba(255,255,255,.15) 30.5% 31%, transparent 31.5%),
    conic-gradient(from 0deg, #d7d7d7, #f7f1c9, #b9e3f0, #e7c3ef, #d7d7d7, #fbe3c4, #c6f0d8, #d7d7d7);
  animation: spin 2.4s linear infinite;
  animation-play-state: var(--play, running);
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.disc::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
}
.player-lid::after {
  /* clear-lid glare */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255,255,255,.18), transparent 45%);
  pointer-events: none;
}
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lcd {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #aab59a;
  color: #26301c;
  font: 500 12px/1.3 var(--mono);
  letter-spacing: .06em;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
  white-space: nowrap;
}
.lcd-title { overflow: hidden; }
#lcd-title { display: inline-block; }
#lcd-title.scroll { animation: lcd-scroll 9s ease-in-out infinite; }
@keyframes lcd-scroll {
  0%, 20% { transform: translateX(0); }
  70%, 90% { transform: translateX(var(--overflow)); }
  100% { transform: translateX(0); }
}
.keys { display: flex; gap: 6px; }
.key {
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(#f3f2ef, #cbc8c2);
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
  font-size: 10px;
  color: #444;
  cursor: pointer;
}
.key#next { font-size: 8px; letter-spacing: -2px; padding-right: 2px; }
.key:active { transform: translateY(1px); box-shadow: none; }

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

/* ---------- catalog ---------- */
.catalog { padding: 96px 0 120px; border-top: 1px solid var(--line); }

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
h2 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -.03em; line-height: 1; }
.catalog-head p { color: var(--muted); margin-top: 12px; }

.search {
  width: 280px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font: 15px var(--font);
  outline: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 48px 24px;
}

.card { display: flex; flex-direction: column; gap: 12px; }
.cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 12px 24px -16px rgba(0,0,0,.4);
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .cover img { transform: scale(1.03); }
.meta { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.meta h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.meta p { font-size: 14px; color: var(--muted); }
.meta .year { font: 12px var(--mono); color: var(--muted); padding-top: 2px; }

.card.owned .cover img { filter: grayscale(1); opacity: .45; }
.card.owned h3, .card.owned .meta p { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 7px 13px;
  border: 1px dashed var(--muted);
  border-radius: 999px;
  font: 12px var(--mono);
  color: var(--muted);
}

.empty { color: var(--muted); grid-column: 1 / -1; }

.catalog-foot { margin-top: 64px; color: var(--muted); }
.catalog-foot a { color: var(--ink); }

/* ---------- form page ---------- */
.sell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  padding: 48px 0 120px;
}
.sell > * { min-width: 0; }
.sell-cd { position: sticky; top: 32px; display: flex; flex-direction: column; gap: 20px; }
.sell-cd .covers { max-width: 460px; }
.cover.is-blank { background: radial-gradient(circle, var(--bg) 0 9%, var(--line) 10% 100%); box-shadow: none; }
.covers.many { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* lista de discos del formulario */
.items { display: flex; flex-direction: column; margin-bottom: 16px; border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.item-cover { aspect-ratio: 1; border-radius: 2px; overflow: hidden; background: var(--line); }
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-cover.is-empty { background: radial-gradient(circle, var(--bg) 0 9%, var(--line) 10% 100%); }
.item-cover.is-empty img { display: none; }
.item-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.item-main select, .item-main input[type=text] { padding: 6px 0; font-size: 16px; }
.item-main select { padding-right: 24px; }
.chips.small span { padding: 5px 11px; font-size: 13px; }
.item-remove {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.item-remove:hover { border-color: var(--ink); color: var(--ink); }

.phone { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--ink); }
.phone:focus-within { border-bottom-color: var(--accent); }
.phone-prefix { font: 17px var(--font); text-transform: none; letter-spacing: 0; color: var(--muted); }
.phone input { border-bottom: 0; }

.form-error { color: var(--accent); font-size: 15px; }
.sell-cd h2 { font-size: clamp(28px, 3.4vw, 40px); }
.sell-cd .artist { color: var(--muted); font-size: 18px; }

form { display: flex; flex-direction: column; gap: 28px; }
form h1 { font-size: clamp(40px, 5vw, 64px); }
fieldset { border: 0; }
legend { margin-bottom: 12px; font: 13px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }
label small { text-transform: none; letter-spacing: 0; font-family: var(--font); color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font: 17px var(--font);
  color: var(--ink);
  outline: none;
  text-transform: none;
  letter-spacing: 0;
}
input:focus, select:focus, textarea:focus { border-bottom-color: var(--accent); }
textarea { resize: vertical; min-height: 44px; }
select { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 4px center; padding-right: 24px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label { display: inline-block; }
.chips input { position: absolute; width: auto; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 14px var(--font);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.chips input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.hidden { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn:disabled { opacity: .5; cursor: wait; }

.done { display: flex; flex-direction: column; gap: 20px; }
.done p { color: var(--muted); max-width: 40ch; }

/* ---------- footer ---------- */
footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .hero, .sell { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero { padding-top: 16px; }
  .hero-copy { order: -1; gap: 28px; }
  .hero-photo { height: 46vh; }
  .player { width: 170px; padding: 12px; border-radius: 22px; }
  .lcd { font-size: 10px; padding: 4px 8px; }
  .player { width: 200px; }
  .sell-cd { position: static; flex-direction: row; align-items: center; }
  .sell-cd .covers { width: 120px; flex-shrink: 0; }
  .cover.is-blank { background: radial-gradient(circle, var(--bg) 0 9%, var(--line) 10% 100%); box-shadow: none; }
.covers.many { gap: 4px; }
  .item { grid-template-columns: 48px 1fr auto; gap: 12px; }
  .search { width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .top nav a:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .disc, #lcd-title.scroll { animation: none; }
}
