/* site.css: Wrecks Music main site.
   (styles.css is the old sheet, still used by the BPM Finder app; leave it.) */

:root {
    --iron: #1a1b1e;      /* page */
    --slate: #232529;     /* raised surfaces */
    --rule: #383b41;      /* borders */
    --bone: #ece6dc;      /* text */
    --fog: #a4a7ad;       /* secondary text */
    --blood: #a8141c;     /* download actions */
    --blood-hi: #c41b24;
    --ember: #e3923a;     /* what's playing */

    --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --body: 'Archivo', system-ui, sans-serif;

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    --player-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    background: var(--iron);
    color: var(--bone);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.has-player { padding-bottom: var(--player-h); }

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 300;
    background: var(--bone); color: var(--iron); padding: 0.6rem 1rem; border-radius: 4px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 44px; padding: 0.65rem 1.25rem;
    border-radius: 4px; border: 1px solid transparent;
    font-family: var(--body); font-weight: 600; font-size: 0.95rem; text-decoration: none;
    cursor: pointer; white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { cursor: progress; opacity: 0.85; }
.btn .fa-solid, .btn .fa-brands { font-size: 0.9em; }

.primary-btn { background: var(--bone); color: var(--iron); }
.primary-btn:hover { background: #fff; }

.btn-blood { background: var(--blood); color: #fff; }
.btn-blood:hover { background: var(--blood-hi); }

.btn-ghost, .secondary-btn { background: transparent; color: var(--bone); border-color: var(--rule); }
.btn-ghost:hover, .secondary-btn:hover { border-color: var(--bone); }

.btn-quiet { min-height: 38px; padding: 0.4rem 1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(26, 27, 30, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}
.header-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
    height: 64px; display: flex; align-items: center; gap: 2rem;
}
.wordmark {
    font-family: var(--display); font-weight: 900; font-size: 1.9rem; line-height: 1;
    letter-spacing: 0.02em; text-decoration: none; color: var(--bone);
}
.wordmark-small { font-size: 1.4rem; }
.site-nav { display: flex; gap: 1.6rem; }
.site-nav a { text-decoration: none; color: var(--fog); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--bone); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: 1.2rem; }
.socials { display: flex; gap: 0.25rem; }
.socials a {
    width: 36px; height: 36px; display: grid; place-items: center;
    color: var(--fog); text-decoration: none; border-radius: 4px; font-size: 1.05rem;
}
.socials a:hover { color: var(--bone); background: var(--slate); }
.user-name { color: var(--fog); font-size: 0.9rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- hero: the newest album ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero-backdrop {
    position: absolute; inset: -40px;
    background: var(--hero-art) center / cover no-repeat;
    filter: blur(48px) saturate(1.2) brightness(0.38);
    transform: scale(1.1);
}
.hero-backdrop::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(26,27,30,0) 40%, var(--iron) 100%);
}
.hero-inner {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem);
    padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(2.5rem, 5vw, 4rem);
    align-items: start;
}
.hero-cover {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    position: sticky; top: 88px;
}
.hero-kicker { color: var(--ember); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.hero-title {
    font-family: var(--display); font-weight: 900;
    font-size: clamp(3.4rem, 9vw, 7.5rem); line-height: 0.86; letter-spacing: -0.005em;
    margin-bottom: 1rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.hero-meta { color: var(--fog); margin-bottom: 1.5rem; max-width: 46ch; }
.hero .btn-row { margin-bottom: 2rem; }

/* ---------- tracklists ---------- */
.tracklist { list-style: none; border-top: 1px solid var(--rule); }
.tracklist li { border-bottom: 1px solid var(--rule); }
.track-row {
    width: 100%; display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.5rem; background: none; border: 0; text-align: left; cursor: pointer;
    color: var(--bone); font-size: 0.98rem;
}
.track-row:hover { background: rgba(236, 230, 220, 0.05); }
.track-num { color: var(--fog); font-variant-numeric: tabular-nums; text-align: right; }
.track-time { color: var(--fog); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.track-row:hover .track-num { color: transparent; position: relative; }
.track-row:hover .track-num::after {
    content: "\f04b"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.75rem;
    color: var(--bone); position: absolute; right: 0; top: 50%; transform: translateY(-50%);
}
.track-row.is-playing .track-name, .track-row.is-playing .track-num { color: var(--ember); }
.track-row.is-playing .track-num { position: relative; color: transparent; }
.track-row.is-playing .track-num::after {
    content: "\f028"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.8rem;
    color: var(--ember); position: absolute; right: 0; top: 50%; transform: translateY(-50%);
}

/* ---------- song of the day ---------- */
.sotd { border-bottom: 1px solid var(--rule); background: var(--slate); }
.sotd-inner {
    display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 1rem 1.25rem;
    padding-top: 1rem; padding-bottom: 1rem;
}
.sotd-art { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; }
.sotd-kicker { color: var(--fog); font-size: 0.85rem; }
.sotd-title { font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.sotd-album { color: var(--fog); font-weight: 400; }
.sotd-actions { display: flex; gap: 0.5rem; }
.sotd-timer { color: var(--fog); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-title {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 0.95; margin-bottom: 0.6rem;
}
.section-lede { color: var(--fog); max-width: 60ch; margin-bottom: 2rem; }

/* ---------- other albums ---------- */
.album-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.album { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.album-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.album-title { font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 0.95; margin-bottom: 0.35rem; }
.album-meta { color: var(--fog); font-size: 0.92rem; margin-bottom: 1rem; }
.album .btn { min-height: 40px; padding: 0.5rem 0.9rem; font-size: 0.88rem; }
.album-tracks { margin-top: 1.1rem; }
.album-tracks summary {
    cursor: pointer; color: var(--fog); font-weight: 600; font-size: 0.92rem; padding: 0.3rem 0;
    list-style: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.album-tracks summary::-webkit-details-marker { display: none; }
.album-tracks summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.7rem; transition: transform 0.15s; }
.album-tracks[open] summary::after { transform: rotate(180deg); }
.album-tracks summary:hover { color: var(--bone); }
.album-tracks .tracklist { margin-top: 0.6rem; }

/* Album opened from a shared link */
.album.is-shared .album-cover { outline: 2px solid var(--ember); outline-offset: 4px; }

/* ---------- radio ---------- */
.radio-band { background: var(--slate); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.radio-inner {
    display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
    padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.radio-art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.radio-text .section-lede { margin-bottom: 1.5rem; }

/* ---------- tools ---------- */
.tool-list { list-style: none; border-top: 1px solid var(--rule); max-width: 820px; }
.tool-list li { border-bottom: 1px solid var(--rule); }
.tool {
    display: grid; grid-template-columns: 52px 1fr auto; gap: 1rem; align-items: center;
    padding: 1rem 0.5rem; text-decoration: none;
}
.tool:hover { background: rgba(236, 230, 220, 0.04); }
.tool-icon { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.tool-name { display: block; font-weight: 600; font-size: 1.05rem; }
.tool-desc { display: block; color: var(--fog); font-size: 0.92rem; }
.tool-open { color: var(--fog); font-weight: 600; font-size: 0.9rem; }
.tool:hover .tool-open { color: var(--bone); }

/* ---------- community ---------- */
.community-wrap > * { max-width: 820px; }
.field-label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--fog); margin: 0.9rem 0 0.35rem; }
.comment-form-container, .community-login-prompt {
    background: var(--slate); border: 1px solid var(--rule); border-radius: 6px; padding: 1.25rem; margin-bottom: 2rem;
}
.community-login-prompt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.comment-form-container .btn { margin-top: 1rem; }
select, textarea, input[type="email"], input[type="password"] {
    width: 100%; background: var(--iron); color: var(--bone);
    border: 1px solid var(--rule); border-radius: 4px; padding: 0.7rem 0.8rem; font: inherit;
}
select:focus, textarea:focus, input:focus { outline: 2px solid var(--ember); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
.community-feed { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.comment-card { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.comment-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--fog); font-size: 0.88rem; margin-bottom: 0.4rem; }
.comment-user { color: var(--bone); font-weight: 600; }
.comment-song { color: var(--ember); }
.comment-text { overflow-wrap: anywhere; }
.comment-actions { margin-top: 0.5rem; }
.like-btn {
    background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 0.25rem 0.6rem;
    cursor: pointer; font-size: 0.85rem; color: var(--fog);
}
.like-btn:hover, .like-btn.liked { border-color: var(--blood-hi); color: var(--bone); }
.loading-comments { color: var(--fog); padding: 1.5rem 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0; color: var(--fog); font-size: 0.88rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- modals ---------- */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(10, 10, 12, 0.75); display: grid; place-items: center; padding: 16px;
}
.modal-content {
    position: relative; width: min(460px, 100%); max-height: 90vh; overflow-y: auto;
    background: var(--slate); border: 1px solid var(--rule); border-radius: 8px; padding: 2rem 1.6rem 1.6rem;
}
.modal-content h2 { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; margin-bottom: 0.5rem; }
.modal-content > p { color: var(--fog); margin-bottom: 0.5rem; }
.close-modal {
    position: absolute; top: 0.6rem; right: 0.6rem; width: 40px; height: 40px;
    background: none; border: 0; font-size: 1.6rem; color: var(--fog); cursor: pointer; border-radius: 4px;
}
.close-modal:hover { color: var(--bone); background: var(--iron); }
.auth-form .btn { margin-top: 1.25rem; }
.checkbox-container { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; color: var(--fog); font-size: 0.9rem; }
.text-link { display: block; text-align: center; margin-top: 1rem; color: var(--fog); font-size: 0.9rem; }
.text-link:hover { color: var(--bone); }
.install-steps { display: grid; gap: 1.2rem; margin: 1.2rem 0 1.5rem; }
.install-steps h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.install-steps ol { padding-left: 1.2rem; color: var(--fog); font-size: 0.92rem; }

/* ---------- player ---------- */
.audio-player {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: rgba(35, 37, 41, 0.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--rule);
}
.player-progress { height: 4px; background: var(--rule); cursor: pointer; }
.player-progress:hover { height: 6px; margin-top: -2px; }
.progress-bar { height: 100%; width: 0; background: var(--ember); }
.player-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
    height: calc(var(--player-h) - 4px);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
}
.player-info { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.player-art { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.player-text { min-width: 0; }
.player-track, .player-album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track { font-weight: 600; }
.player-album { color: var(--fog); font-size: 0.85rem; }
.player-controls { display: flex; align-items: center; gap: 0.4rem; }
.ctrl-btn {
    width: 44px; height: 44px; display: grid; place-items: center;
    background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--bone); font-size: 1.05rem;
}
.ctrl-btn:hover { background: var(--iron); }
.ctrl-btn[hidden] { display: none; }
.play-pause { background: var(--bone); color: var(--iron); width: 48px; height: 48px; }
.play-pause:hover { background: #fff; }
.ctrl-small { width: 36px; height: 36px; font-size: 0.95rem; color: var(--fog); }
.player-end { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.player-time { color: var(--fog); font-size: 0.85rem; font-variant-numeric: tabular-nums; margin-right: 0.5rem; }
.volume-slider { width: 96px; accent-color: var(--ember); }

/* ---------- toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); transform: translate(-50%, 20px);
    background: var(--bone); color: var(--iron); padding: 0.7rem 1.1rem; border-radius: 4px; font-weight: 600; font-size: 0.92rem;
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 250; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .site-nav { display: none; }
    .album-list { grid-template-columns: 1fr; }
    .sotd-inner { grid-template-columns: 56px 1fr; }
    .sotd-actions { grid-column: 1 / -1; }
    .sotd-timer { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .socials { display: none; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-cover { position: static; max-width: 420px; }
    .radio-inner { grid-template-columns: 1fr; }
    .radio-art { max-width: 260px; }
    .player-inner { grid-template-columns: 1fr auto; }
    .player-end { display: none; }
    .player-controls #btnPrev { display: none; }
}
@media (max-width: 520px) {
    .album { grid-template-columns: 110px minmax(0, 1fr); gap: 1rem; }
    .album-title { font-size: 1.7rem; }
    .hero .btn-row .btn { flex: 1 1 auto; }
    .user-name { display: none; }
}
