@font-face { font-family: 'Space Grotesk'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/space-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/space-grotesk-latin-700-normal.woff2') format('woff2'); }
   
/* --- 2. Variables (The "Electric Swiss" Palette) --- */
:root {
    --bg-color: #ffffff;
    --card-color: #ffffff;
    --primary-text: #000000;
    --secondary-text: #555555;

    /* Lively Accents */
    --accent-color: #5200ff;   /* Electric Indigo */
    --highlight-color: #ccff00; /* Neon Lime */

    /* Dimensions */
    --border-radius: 0;
    --border-width: 3px;
}

/* --- 3. Global Styles --- */
body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);

    /* Dot pattern background */
    background-image: radial-gradient(#cfcfcf 1px, transparent 1px);
    background-size: 20px 20px;

    /* Layout basics */
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
    box-sizing: border-box;
    display: block;
}

a { text-decoration: none; color: inherit; }

/* --- 4. Layout Grid --- */
.container-sidebar {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Left third, right two-thirds */
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch; /* right column stretches to match left column height */
}

.left-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

/* --- 5. Sidebar / Profile --- */
.profile-card {
    position: sticky;
    top: 2rem;
    text-align: left;
}

.profile-card h1 {
    font-size: 4rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 0.5rem 0;
    color: var(--primary-text);

    /* Underline Decoration */
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 6px;
    text-underline-offset: 4px;
}

.profile-card .eyebrow {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;

    /* Tilted Highlight Box */
    background-color: var(--accent-color);
    color: white;
    display: inline-block;
    padding: 5px 10px;
    transform: rotate(-2deg);
}

.profile-card p { margin: 1rem 0 0; color: var(--secondary-text); line-height: 1.6; }

.profile-card p a {
    font-weight: 700;
    border-bottom: 2px solid var(--accent-color);
    transition: background 0.2s;
}
.profile-card p a:hover { background-color: var(--highlight-color); }

/* --- 6. Cards --- */
.card {
    background-color: var(--card-color);
    padding: 1.5rem;

    /* The "Pop" Look */
    border: var(--border-width) solid black;
    box-shadow: 8px 8px 0 var(--accent-color);
    border-radius: var(--border-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 12px 12px 0 var(--accent-color);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    border-bottom: var(--border-width) solid black;
    padding-bottom: 10px;
}

/* --- 7. Social Links --- */
.connect-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.connect-link {
    flex: 1;
    min-width: 80px;

    /* Button Style */
    background: black;
    color: white;
    padding: 1rem 0;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.connect-link .icon { width: 1.5rem; height: 1.5rem; color: var(--highlight-color); }

.mosaic-loading .icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    color: var(--highlight-color);
}
.spin-icon { animation: icon-spin 1.6s linear infinite; }
@keyframes icon-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.connect-link:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05) rotate(1deg); /* Wiggle */
    box-shadow: 5px 5px 0 black;
}

/* --- 8. Mosaic Panel (right two-thirds) --- */
.mosaic-panel {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    background: #0a0a0a;
    border: var(--border-width) solid black;
    box-shadow: 8px 8px 0 var(--accent-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mosaic-panel:hover {
    transform: translate(-2px, -2px);
    box-shadow: 12px 12px 0 var(--accent-color);
}

.mosaic-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: 500;
    font-style: italic;
    z-index: 1;
}

.mosaic-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    background: black;
}

.mosaic-tile {
    position: relative;
    overflow: hidden;
    background: #141414;
}

.mosaic-tile .layer {
    position: absolute;
    inset: -12%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    filter: saturate(1.05);
    transition: opacity 1.8s ease;
    animation: mosaic-drift 22s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

.mosaic-tile .layer.active { opacity: 1; }

/* Stagger so tiles don't all drift in sync */
.mosaic-tile:nth-child(3n) .layer { animation-duration: 26s; }
.mosaic-tile:nth-child(3n+1) .layer { animation-duration: 19s; }
.mosaic-tile:nth-child(3n+2) .layer { animation-duration: 23s; }
.mosaic-tile:nth-child(even) .layer { animation-direction: alternate-reverse; }

@keyframes mosaic-drift {
    from { transform: scale(1) translate(0, 0); }
    to   { transform: scale(1.12) translate(-2.5%, 2.5%); }
}

/* Readability scrim so the track list pops off the artwork */
.mosaic-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.05) 35%,
        rgba(0,0,0,0.55) 70%,
        rgba(0,0,0,0.92) 100%);
    pointer-events: none;
}

.mosaic-heading {
    display: inline-block;
    background-color: var(--highlight-color);
    color: black;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    margin: 0 0 1rem 0;
    transform: rotate(-2deg);
    border: 2px solid black;
}

.mosaic-tracklist {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.5rem 1.75rem 1.75rem;
    background: rgba(5, 5, 5, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* --- 9. Track List --- */
.track-list { list-style: none; padding: 0; margin: 0; }

.track-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;

    /* Fade-in Setup */
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.album-art {
    width: 42px; height: 42px;
    border: 2px solid white;
    object-fit: cover;
    flex-shrink: 0;
}

.track-info { flex-grow: 1; min-width: 0; }
.track-title {
    display: block; font-weight: 700; font-size: 1.05rem; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-title a { color: inherit; text-decoration: none; }
.track-title a:hover { color: var(--highlight-color); }
.track-artist {
    display: block; font-size: 0.85rem; color: #cfcfcf;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-time { font-size: 0.75rem; font-weight: 700; color: #aaaaaa; white-space: nowrap; }

/* Scrobble Animation */
.scrobbling-indicator { display: flex; align-items: flex-end; gap: 2px; }
.scrobbling-indicator span {
    width: 3px; height: 12px;
    background-color: var(--highlight-color);
    display: inline-block;
    animation: scrobble 1.2s infinite ease-in-out;
}
.scrobbling-indicator span:nth-child(2) { animation-delay: -1.0s; }
.scrobbling-indicator span:nth-child(3) { animation-delay: -0.8s; }

@keyframes scrobble {
    0%, 40%, 100% { transform: scaleY(0.2); }
    20% { transform: scaleY(1.0); }
}

.loading-placeholder { padding: 1rem; color: #ccc; font-style: italic; }

/* --- 10. Footer --- */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 1rem;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

footer img {
    height: 1em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* --- 11. Mobile Responsiveness --- */
@media (max-width: 800px) {
    .container-sidebar { grid-template-columns: 1fr; gap: 2rem; }
    .left-column { position: static; }
    .profile-card { position: static; text-align: center; }
    .profile-card h1 { font-size: 3rem; }
    .connect-grid { justify-content: center; }
    .connect-link { width: calc(50% - 0.5rem); flex: none; } /* 2 per row on mobile */

    .mosaic-panel { min-height: 520px; }
}

/* --- 12. Feed unavailable: small card instead of a big empty panel --- */
.mosaic-panel.is-unavailable { min-height: 0; align-self: start; }
.mosaic-panel.is-unavailable .mosaic-grid,
.mosaic-panel.is-unavailable .mosaic-scrim { display: none; }
.mosaic-panel.is-unavailable .mosaic-tracklist {
    position: static;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.unavailable-message p { margin: 0 0 0.75rem; color: #cfcfcf; }
.unavailable-message a {
    color: #fff;
    font-weight: 700;
    border-bottom: 2px solid var(--highlight-color);
}
.unavailable-message a:hover { color: var(--highlight-color); }

/* --- 13. Keyboard focus --- */
a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}
.mosaic-panel a:focus-visible { outline-color: var(--highlight-color); }

/* --- 14. Reduced motion: honour the OS setting --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .track-item { opacity: 1; }
    .card:hover, .mosaic-panel:hover, .connect-link:hover { transform: none; }
}
