/* Analyrics -- layered on top of Bootstrap 5 dark mode. */

:root {
    --ink: #0d0f14;
    --ink-2: #141822;
    --ink-3: #1c2130;
    --line: #262c3b;
    --text: #e8eaf0;
    --muted: #939bb0;
    --accent: #e4572e;      /* seismograph orange, from the original logo */
    --accent-soft: rgba(228, 87, 46, 0.14);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration-color: rgba(228, 87, 46, 0.5); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.text-muted { color: var(--muted) !important; }
.sep { color: var(--line); padding: 0 .25rem; }

/* ---- nav ---------------------------------------------------------------- */

.site-nav {
    background: rgba(13, 15, 20, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-word { font-size: 1.25rem; }

/* Seismograph tick: a nod to the original mark, drawn in CSS. */
.brand-mark {
    width: 26px; height: 18px; display: inline-block;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 50% / 100% 2px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 8px 0 / 2px 100% no-repeat,
        linear-gradient(var(--accent), var(--accent)) 15px 25% / 2px 50% no-repeat;
}

.site-search { position: relative; }
.site-search .form-control { background: var(--ink-3); border-color: var(--line); color: var(--text); min-width: 220px; }
.site-search .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }

.search-suggest {
    position: absolute; top: calc(100% + .4rem); left: 0; right: 0; z-index: 50;
    background: var(--ink-2); border: 1px solid var(--line); border-radius: .5rem;
    overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.search-suggest a { display: block; padding: .6rem .8rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover, .search-suggest a:focus { background: var(--ink-3); }
.search-suggest .s-title { font-weight: 600; }
.search-suggest .s-artist { color: var(--muted); font-size: .85rem; }

/* Artist rows sit above song rows and are visually distinct. */
.search-suggest .s-artist-row { display: flex; align-items: center; gap: .55rem; background: rgba(228, 87, 46, .06); }
.search-suggest .s-avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.search-suggest .s-kind {
    margin-left: auto; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--accent); border: 1px solid rgba(228, 87, 46, .35); border-radius: 999px; padding: .05rem .45rem;
}

.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover, .btn-accent:focus { background: #c9451f; border-color: #c9451f; color: #fff; }

/* ---- hero --------------------------------------------------------------- */

.hero { padding: 3rem 0 1rem; max-width: 46rem; }
.hero-title { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
.hero-title em { color: var(--accent); font-style: italic; }
.hero-lede { font-size: 1.15rem; color: var(--muted); line-height: 1.6; }
.hero-count { color: var(--muted); font-size: .95rem; }
.hero-search { display: flex; gap: .6rem; margin-top: 1.5rem; }
.hero-search .form-control { background: var(--ink-3); border-color: var(--line); color: var(--text); }
.hero-search .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }

/* ---- headings ----------------------------------------------------------- */

.page-title { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.02em; }

.section-heading {
    font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--muted); font-weight: 700; margin-bottom: 1.2rem;
    padding-bottom: .5rem; border-bottom: 1px solid var(--line);
}

.sub-heading { font-family: var(--serif); font-size: 1.25rem; margin: 2rem 0 .75rem; }

/* ---- song cards --------------------------------------------------------- */

.song-card {
    display: block; height: 100%; text-decoration: none;
    background: var(--ink-2); border: 1px solid var(--line); border-radius: .75rem; overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}
.song-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.song-card-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.song-card-art-empty { background: linear-gradient(135deg, var(--ink-3), var(--ink-2)); }
.song-card-body { padding: 1rem 1.1rem 1.2rem; }
.song-card-title { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 .2rem; color: var(--text); }
.song-card-artist { color: var(--accent); font-size: .9rem; margin: 0 0 .6rem; }
.song-card-summary { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: 0 0 .7rem; }
.song-card-themes { margin: 0; }

.theme-tag {
    display: inline-block; padding: .15rem .55rem; margin: 0 .3rem .3rem 0;
    font-size: .75rem; border-radius: 999px;
    background: var(--accent-soft); color: #f0a68d; border: 1px solid rgba(228, 87, 46, .3);
    text-decoration: none;
}
a.theme-tag:hover { background: var(--accent); color: #fff; }

/* ---- song page ---------------------------------------------------------- */

.song-header { padding: 1rem 0 1.5rem; }
.song-eyebrow { color: var(--muted); margin-bottom: .35rem; }
.song-eyebrow a { color: var(--accent); text-decoration: none; font-weight: 600; }
.song-title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; margin: 0; }
.song-mood { color: var(--muted); font-style: italic; margin-top: .5rem; }

.video-wrap {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    border-radius: .75rem; overflow: hidden; border: 1px solid var(--line); background: #000;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-credit { margin-top: .5rem; }

.lyrics-panel {
    background: var(--ink-2); border: 1px solid var(--line); border-radius: .75rem;
    padding: 1.5rem; position: sticky; top: 5rem;
}
.lyrics { font-family: var(--serif); font-size: 1.05rem; line-height: 1.75; }
.lyrics .stanza { margin-bottom: 1.1rem; }
.lyrics-instrumental { color: var(--muted); font-style: italic; }
.lyrics-truncated {
    margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line);
    color: var(--muted); font-size: .9rem;
}
.lyrics-credit { margin-top: 1rem; }

@media (max-width: 991.98px) {
    .lyrics-panel { position: static; }
}

.analysis-summary { font-size: 1.15rem; line-height: 1.7; }
.themes { margin: 1rem 0 1.5rem; }

.analysis-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1.5rem 0; }
.analysis-grid h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: .4rem; }
.analysis-grid p { color: var(--text); font-size: .95rem; line-height: 1.6; margin: 0; }

.section-note { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.section-note:last-child { border-bottom: 0; }
.section-note h4 { font-size: .95rem; font-weight: 700; color: var(--accent); margin-bottom: .35rem; }
.section-note p { margin: 0; line-height: 1.65; }

.devices dt { font-weight: 700; margin-top: .8rem; }
.devices dd { color: var(--muted); margin: .2rem 0 0; line-height: 1.6; }

.listen-for { padding-left: 1.1rem; line-height: 1.8; }
.analysis-meta { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---- artist ------------------------------------------------------------- */

.artist-header { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; padding: 1rem 0 2rem; }
.artist-portrait, .artist-thumb { border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.artist-thumb { width: 140px; height: 140px; }
.artist-name { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.8rem); margin: 0; }
.artist-meta { color: var(--muted); margin: .4rem 0 .6rem; }
.artist-bio p { line-height: 1.75; max-width: 52rem; }
.link-list { list-style: none; padding: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.link-list a { text-transform: capitalize; }

.artist-card {
    display: flex; gap: .9rem; align-items: center; height: 100%;
    background: var(--ink-2); border: 1px solid var(--line); border-radius: .6rem;
    padding: .8rem; text-decoration: none; transition: border-color .15s ease;
}
.artist-card:hover { border-color: var(--accent); }
.artist-card-thumb { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.artist-card-thumb-empty { background: var(--ink-3); display: inline-block; }
.artist-card-body { display: flex; flex-direction: column; min-width: 0; }
.artist-card-name { font-weight: 600; color: var(--text); }
.artist-card-summary { color: var(--muted); font-size: .82rem; }

.artist-strip { background: var(--ink-2); border: 1px solid var(--line); border-radius: .75rem; padding: 1.5rem; }

/* ---- forms / states ----------------------------------------------------- */

.submit-form .form-control { background: var(--ink-3); border-color: var(--line); color: var(--text); }
.submit-form .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.empty-state {
    background: var(--ink-2); border: 1px dashed var(--line);
    border-radius: .75rem; padding: 2.5rem; text-align: center;
}
.error-detail {
    background: var(--ink-3); border: 1px solid var(--line); border-radius: .5rem;
    padding: 1rem; color: var(--muted); font-size: .85rem; max-width: 40rem; margin: 1rem auto 0;
    white-space: pre-wrap; word-break: break-word;
}

/* ---- footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0; background: var(--ink-2); }

/* ---- side rail ----------------------------------------------------------
   Names here are deliberately neutral. Generic cosmetic filters hide anything
   whose class/id contains ad, ads, advert, sponsor, banner, promo or a standard
   ad-size token, so this block sticks to site-flavoured names only. */

/* Deliberately NOT transformed: a transformed ancestor becomes the containing
   block for position:fixed descendants, which would trap the flyout inside the
   scroll container. Centred with top/bottom + flex instead of translateY(-50%). */
.side-rail {
    position: fixed;
    left: 12px;
    top: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    pointer-events: none; /* the empty gutter must not eat clicks */
}

/* The scroll container. Clipping lives here, and the flyout escapes it by being
   position:fixed rather than absolute -- overflow does not clip fixed children. */
.side-rail-inner {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-height: 86vh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 6px 3px;
    border-radius: 999px;
    background: rgba(20, 24, 34, .72);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.side-rail-inner::-webkit-scrollbar { display: none; }

.cell-wrap { display: block; }

/* Plain wrapper for the flyouts. Deliberately has NO transform, filter,
   backdrop-filter, contain or overflow -- any of those would make it the
   containing block for the position:fixed cards and clip them again. */
.rail-cards { position: static; }

.cell {
    display: block; width: 40px; height: 40px; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--line); background: var(--ink-3);
    transition: transform .12s ease, border-color .12s ease;
}
.cell:hover { transform: scale(1.08); border-color: var(--accent); }
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Flyout card, opening to the right of the column (the rail sits on the left).
   position:fixed so the rail's overflow cannot clip it; top/left are set by JS
   from the hovered tile's rect, which also keeps it inside the viewport. */
.cell-card {
    position: fixed;
    width: 310px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: .6rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s;
    z-index: 40;
}
.cell-card.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto; /* the card must be hoverable and clickable */
}

/* Invisible bridge across the gap between tile and card. Without it the pointer
   crosses dead space on its way over and the card closes under the cursor. */
.cell-card::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 0;
    bottom: 0;
    width: 18px;
}

/* The whole card is the same sponsored destination as its tile. */
.cell-card-link { display: block; color: inherit; text-decoration: none; }
.cell-card-link:hover .cell-card-headline { color: var(--accent); }

/* Heroes are 3:2 landscape up to 720x480. A ~310px card renders them at 2x.
   Off-ratio creatives letterbox inside the box rather than cropping. */
.cell-card-hero {
    display: block; width: 100%; aspect-ratio: 3 / 2;
    object-fit: contain; background: #000;
}
.cell-card-body { padding: .7rem .8rem .8rem; }
.cell-card-headline { font-weight: 700; font-size: .9rem; margin: 0 0 .3rem; color: var(--text); }
.cell-card-text { font-size: .82rem; line-height: 1.45; color: var(--muted); margin: 0; }
.cell-card-host { font-size: .72rem; color: var(--accent); margin: .45rem 0 0; }

.rail-mark { display: block; opacity: .5; margin-top: 2px; transition: opacity .12s ease; }
.rail-mark:hover { opacity: 1; }
.rail-mark img { display: block; width: 24px; height: 24px; object-fit: contain; }

/* The rail lives in a gutter rather than on top of the content: from 700px up,
   the whole page shifts right by the column's width so nothing is overlapped.
   Below 700px there isn't room for a gutter, so the column steps aside. */
@media (min-width: 700px) {
    body { padding-left: 64px; }
}
@media (max-width: 699.98px) {
    .side-rail { display: none; }
    body { padding-left: 0; }
}
