/* ============================================================
   PI-Website · redesign v1
   White-dominant, professional, minimal.
   Font: Inter everywhere (display + body)
   ============================================================ */

:root {
    --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --color-paper: #ffffff;
    --color-surface: #ffffff;
    --color-surface-2: #f7f8f9;
    --color-ink: #101319;
    --color-muted: #667085;
    --color-faint: #98a2b3;
    --color-line: #e6e8ec;
    --color-line-strong: #d4d8de;

    /* single accent: refined signal blue (nod to the old #06c) */
    --color-accent: #1f5eff;
    --color-accent-soft: #eef3ff;
    --pos: #12805c;
    --neg: #c93b3b;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(16, 19, 25, 0.05);
    --shadow-md: 0 4px 16px rgba(16, 19, 25, 0.07);

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    background: var(--color-paper);
    color: var(--color-ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-style: normal;
    letter-spacing: -0.01em;
}

/* ------------------------------------------------------------
   Top navigation
   ------------------------------------------------------------ */
.top-links {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-line);
    font-family: var(--font-body);
    flex-wrap: wrap;
}

.top-links .brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15.5px;
    color: var(--color-ink);
    text-decoration: none;
    margin-right: var(--space-md);
    letter-spacing: -0.02em;
}

.top-links .nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    margin: 0 auto;
}

.top-links a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    transition: color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
    white-space: nowrap;
}

.top-links a:hover {
    color: var(--color-ink);
    background: var(--color-surface-2);
}

.top-links a.active {
    color: var(--color-ink);
    background: var(--color-accent-soft);
}

.top-links .logout-link {
    position: static;
    order: 99;
    color: var(--color-faint);
}

/* guest nav (beats/loops + login only): balance brand on the left with the
   login link on the right so the links sit truly centered */
.top-links.guest-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: nowrap;
}
.top-links.guest-nav .brand { grid-column: 1; justify-self: start; margin-right: 0; }
.top-links.guest-nav .nav-group { grid-column: 2; margin: 0; justify-content: center; }
.top-links.guest-nav .nav-group a { text-align: center; }
.top-links.guest-nav .logout-link { grid-column: 3; order: 0; justify-self: end; }

.top-links .logout-link:hover {
    color: var(--neg);
    background: transparent;
}

/* ------------------------------------------------------------
   Period switcher (monthly / biweekly / weekly / daily)
   ------------------------------------------------------------ */
.period-links {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin: var(--space-lg) auto var(--space-md);
    padding: 3px;
    width: fit-content;
    max-width: calc(100vw - 32px);
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: 999px;
}

.period-links a {
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-muted);
    text-decoration: none;
    padding: 6px 18px;
    border-radius: 999px;
    transition: color 0.15s var(--ease-out), background-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
    white-space: nowrap;
}

.period-links a:hover {
    color: var(--color-ink);
}

.period-links a.current {
    background: #e4e7eb;
    color: var(--color-ink);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   Chart image frames (stats pages)
   ------------------------------------------------------------ */
.image-container {
    width: 100%;
    overflow-x: auto;
    text-align: center;
    padding: 0 var(--space-md) var(--space-xl);
}

.image-container img {
    width: min(1240px, 96vw);
    height: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
}

/* ------------------------------------------------------------
   Data columns / cards / tables
   ------------------------------------------------------------ */
.columns {
    display: block;
    padding: 0 var(--space-md) var(--space-xl);
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

.column {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: 0 auto var(--space-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.column h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-line);
    text-align: left;
    color: var(--color-ink);
}

.list {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
    color: var(--color-ink);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

.table th {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    background: transparent;
    padding: var(--space-sm) var(--space-sm);
    text-align: center;
    border-bottom: 1px solid var(--color-line-strong);
    white-space: nowrap;
}

.table td {
    padding: 8px var(--space-sm);
    text-align: center;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-ink);
    white-space: nowrap;
}



.table tbody tr {
    transition: background-color 0.12s var(--ease-out);
}

.table tbody tr:hover { background: var(--color-surface-2); }

#all-artists-table th { cursor: pointer; user-select: none; }
#all-artists-table th:hover { color: var(--color-ink); }
#all-artists-table th.sort-asc::after { content: ' \2191'; color: var(--color-accent); }
#all-artists-table th.sort-desc::after { content: ' \2193'; color: var(--color-accent); }

@media (max-width: 720px) {
    .top-links { padding: var(--space-sm) var(--space-md); }
    .top-links .nav-group { margin: 0; }
    .column { padding: var(--space-md); }
    .table { font-size: 12.5px; }
}

/* ------------------------------------------------------------
   Forms, buttons, inputs
   ------------------------------------------------------------ */
input[type="text"], input[type="password"], input[type="email"], textarea {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-ink);
    background: var(--color-surface);
    border: 1px solid var(--color-line-strong);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

input[type="text"]::placeholder, input[type="password"]::placeholder, input[type="email"]::placeholder, textarea::placeholder {
    color: var(--color-faint);
}

button, .btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-surface);
    background: var(--color-ink);
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    cursor: pointer;
    transition: opacity 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}

button:hover, .btn:hover { opacity: 0.85; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible,
a:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button:disabled { opacity: 0.45; cursor: default; }

/* ------------------------------------------------------------
   Page shells (beats, loops, graphs, comp, request, login)
   ------------------------------------------------------------ */
.page-title {
    font-size: 26px;
    font-weight: 600;
    margin: var(--space-xl) 0 var(--space-xs);
    text-align: center;
}

.page-subtitle {
    text-align: center;
    color: var(--color-muted);
    font-size: 14px;
    margin: 0 0 var(--space-lg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md) var(--space-xl);
    width: 100%;
}

.note {
    text-align: center;
    color: var(--color-faint);
    font-size: 12.5px;
    margin-top: var(--space-sm);
}

.error {
    text-align: center;
    color: var(--neg);
    margin-top: var(--space-sm);
    font-size: 14px;
}

.search {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.search input { width: min(360px, 80vw); }

#chart {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.releases-container { display: flex; gap: var(--space-lg); margin-top: var(--space-lg); flex-wrap: wrap; }
.releases-box { flex: 1 1 380px; }

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin: var(--space-xl) 0 var(--space-sm);
    text-align: center;
}

.track {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-sm) 0;
    transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.track:hover {
    border-color: var(--color-line-strong);
    box-shadow: var(--shadow-sm);
}

.track-name-row { display: flex; align-items: center; gap: var(--space-sm); margin: 0 0 6px; }
.track-name { font-size: 13.5px; font-weight: 500; color: var(--color-ink); }

.dl-btn {
    font-size: 14px;
    color: var(--color-faint);
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}

.dl-btn:hover { color: var(--color-accent); background: var(--color-accent-soft); }

audio {
    width: 100%;
    height: 36px;
    margin: 4px 0;
    border-radius: var(--radius-sm);
}

/* clickable artist names in stats tables */
.artist-link {
    color: var(--color-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.12s var(--ease-out), border-color 0.12s var(--ease-out);
}

.artist-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.artist-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}


/* beats + loops: cards 10% wider (500 -> 550px), centered, spaced */
.track {
    max-width: 550px;
    margin: 10px auto;
}
