@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ground: #0B0B0D; --s1: #121214; --s2: #1B1B1E; --s3: #232326; --s4: #2C2C30;
  --text: #EDEDEF; --text-2: #A6A6AE; --text-3: #8A8A92;
  --accent: #2ED47A; --on-accent: #0B0B0D; --accent-dim: #1B8A4C;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 5vw, 56px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scrollbar-color: var(--s4) var(--ground); scrollbar-width: thin; }
body {
  margin: 0; min-height: 100dvh; background: var(--ground); color: var(--text);
  font: 400 1rem/1.6 "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 10px; border: 2px solid var(--ground); }
[hidden] { display: none !important; }

.page { max-width: 80rem; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.top { padding: 24px var(--pad) 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none;
  font: 700 1.25rem/1 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.02em; border-radius: 10px; }
.mark { display: block; width: auto; height: 40px; }

main { flex: 1; padding-top: clamp(40px, 9vw, 96px); }
.intro { padding: 0 var(--pad); }
h1 { margin: 0; max-width: 13ch; text-wrap: balance;
  font: 700 clamp(2.6rem, 8.2vw, 5.5rem)/1.02 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.035em; }
.intro p { margin: 1.25rem 0 0; max-width: 52ch; color: var(--text-2); font-size: clamp(1rem, 2.2vw, 1.15rem); text-wrap: pretty; }

/* La onda: el logo de la app convertido en barra de progreso */
.wave { position: relative; margin-top: clamp(36px, 7vw, 72px); height: clamp(110px, 17vw, 170px); }
.wave svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wave path { vector-effect: non-scaling-stroke; }
.wave-base .line-1 { stroke: var(--s4); stroke-width: 3; }
.wave-base .line-2 { stroke: var(--s3); stroke-width: 2; }
.wave-played { clip-path: inset(0 62% 0 0); animation: play 1.7s var(--ease) 0.25s backwards; }
.wave-played .line-1 { stroke: var(--accent); stroke-width: 3.5; }
.wave-played .line-2 { stroke: var(--accent-dim); stroke-width: 2.5; }
.playhead { position: absolute; top: 6%; bottom: 6%; left: 38%; width: 2px; margin-left: -1px; border-radius: 2px;
  background: var(--text); animation: head 1.7s var(--ease) 0.25s backwards; }
@keyframes play { from { clip-path: inset(0 100% 0 0); } }
@keyframes head { from { left: 0; } }

.deck { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px;
  padding: clamp(24px, 4vw, 40px) var(--pad) 0; }
.track { display: flex; align-items: center; gap: 16px; min-width: 0; }
.cover { width: 72px; height: 72px; flex: none; }
.cover-img { object-fit: cover; border-radius: 16px; background: var(--s2); }
.cover-img[hidden], .cover[hidden] { display: none; }
.track[data-round="1"] .cover-img { border-radius: 50%; }
.track-kind { margin: 0 0 4px !important; color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.track-kind:empty { display: none; }
.track-text { min-width: 0; }
.track-text p { margin: 0; }
.track-title { font: 600 1.35rem/1.2 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.015em; }
.track-ref { margin-top: 4px !important; color: var(--text-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 600 1rem/1 "Hanken Grotesk", system-ui, sans-serif; text-decoration: none; border: 0; cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #63E6A3; }
.btn-quiet { background: var(--s3); color: var(--text); }
.btn-quiet:hover { background: var(--s4); }
.btn:active { transform: scale(.97); }
.btn-ig { gap: 10px; }
.btn-ig .ig { flex: none; }
.ig-note { flex-basis: 100%; margin: 4px 0 0; color: var(--text-2); font-size: .9rem; }
.btn-off { background: var(--s2); color: var(--text-3); cursor: default; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.facts { list-style: none; margin: clamp(56px, 9vw, 104px) 0 0; padding: 0 var(--pad); display: grid; gap: 0 48px; }
.facts li { display: grid; gap: 4px; padding: 20px 0; border-top: 1px solid var(--s3); }
.facts strong { font: 600 1.2rem/1.25 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.015em; }
.facts span { color: var(--text-2); max-width: 44ch; }
@media (min-width: 48rem) { .facts { grid-template-columns: 1fr 1fr; } }

footer { padding: 40px var(--pad) 32px; color: var(--text-3); font-size: .9rem; }

/* Estados */
body[data-state="invalid"] .wave-played, body[data-state="invalid"] .playhead { display: none; }
@media (prefers-reduced-motion: reduce) { .wave-played, .playhead { animation: none; } .btn { transition: none; } }

/* Fondo difuminado con la carátula */
.backdrop { position: fixed; inset: -12%; width: 124%; height: 124%; object-fit: cover; z-index: -1; pointer-events: none;
  filter: blur(72px) saturate(1.35); opacity: .32; }
.page { position: relative; }

/* Carátula grande (canciones, álbumes, playlists) y avatar redondo (artistas, perfiles) */
body[data-cover] .deck { flex-direction: column; align-items: flex-start; }
body[data-cover] .track { flex-direction: column; align-items: flex-start; gap: 20px; }
body[data-cover="big"] .cover-img { width: min(78vw, 340px); height: min(78vw, 340px); border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
body[data-cover="round"] .cover-img { width: min(52vw, 190px); height: min(52vw, 190px); border-radius: 50%; box-shadow: 0 18px 44px rgba(0,0,0,.45); }
body[data-cover] .track-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }

/* Aviso de navegador integrado (Instagram, TikTok...) */
.inapp { margin: 28px var(--pad) 0; padding: 18px 20px; max-width: 40rem; border-radius: 18px; background: var(--s2); border: 1px solid var(--s4); }
.inapp p { margin: 0 0 14px; color: var(--text-2); }
.inapp .btn { min-height: 46px; padding: 0 20px; font-size: .95rem; }

/* Canciones populares del artista */
.top-wrap { margin: 36px var(--pad) 0; max-width: 40rem; }
.top-wrap h2 { margin: 0 0 8px; font: 600 1.2rem/1.25 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.015em; }
.top-songs { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.top-songs li { counter-increment: n; display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--s3); overflow-wrap: anywhere; }
.top-songs li::before { content: counter(n); flex: none; width: 1.4em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.top-songs small { display: block; color: var(--text-2); font-size: .85rem; }

/* Importar playlists (/import) */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-link { color: var(--text-2); text-decoration: none; font-weight: 600; padding: 10px 14px; border-radius: 999px; background: var(--s2); }
.top-link:hover { background: var(--s3); color: var(--text); }
body[data-state="import"] .deck, body[data-state="import"] .facts, body[data-state="import"] .top-link { display: none; }
body[data-state="import"] h1 { max-width: 16ch; }
.importer { padding: clamp(28px, 5vw, 48px) var(--pad) 0; max-width: 46rem; }
.imp-card { padding: clamp(20px, 4vw, 28px); border-radius: 22px; background: var(--s1); border: 1px solid var(--s3); }
.imp-card h2 { margin: 0 0 6px; font: 600 1.35rem/1.2 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.015em; }
.imp-hint { margin: 0 0 16px; color: var(--text-2); }
.imp-card label { display: block; margin: 16px 0 6px; color: var(--text-2); font-size: .9rem; font-weight: 600; }
.imp-card input[type="text"], .imp-card input[type="password"], .imp-card textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--s4); background: var(--s2); color: var(--text);
  font: 400 1rem/1.4 "Hanken Grotesk", system-ui, sans-serif; }
.imp-card textarea { resize: vertical; min-height: 7rem; }
.imp-card input:focus-visible, .imp-card textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.imp-card .actions { margin-top: 18px; }
.btn:disabled { background: var(--s2); color: var(--text-3); cursor: default; transform: none; }
.imp-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 1.15rem/1 "Bricolage Grotesque", system-ui, sans-serif; }
.imp-who .btn { min-height: 40px; padding: 0 18px; font-size: .9rem; }
.imp-msg { min-height: 1.4em; margin: 12px 0 0; color: var(--text-2); font-size: .95rem; }
.imp-msg[data-kind="error"] { color: #FF8A8A; }
.imp-msg[data-kind="ok"] { color: var(--accent); }
.imp-list { list-style: none; margin: 8px 0 0; padding: 0; }
.imp-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--s3); }
.imp-item > div { flex: 1; min-width: 0; }
.imp-item input[type="checkbox"] { flex: none; width: 22px; height: 22px; accent-color: var(--accent); }
.imp-item input[type="text"] { padding: 10px 12px; font-weight: 600; }
.imp-item small { display: block; margin-top: 4px; color: var(--text-3); overflow-wrap: anywhere; }
.imp-item.is-error { display: block; }
.imp-item.is-error p { margin: 0; color: #FF8A8A; }
