/* Album du Jour — Quiet Catalog
   LUFS Audio · dark-editorial / Swiss-modernist
   Brand-aligned rebuild (replaces the retro-brutalist theme).
   The webring buttons and the subtle moving background are kept,
   evolved within the brand system. */

@import url('https://fonts.googleapis.com/css2?family=Host+Grotesk:wght@400;500;600;700;800&family=Public+Sans:wght@300;400;500;600&family=Space+Mono&display=swap');

:root {
    /* LUFS spectrum — teal leads, the rest is seasoning */
    --teal: #78BEBA;
    --rust: #D35233;
    --gold: #E7B225;
    --blue: #2069af;

    /* Ground & ink */
    --ground: #111111;
    --ground-2: #0c0c0c;
    --cream: #fbf9e2;
    --muted: rgba(251, 249, 226, 0.62);
    --faint: rgba(251, 249, 226, 0.40);
    --hairline: rgba(251, 249, 226, 0.12);
    --hairline-strong: rgba(251, 249, 226, 0.20);
    --panel: rgba(18, 18, 18, 0.74);
    --card: rgba(251, 249, 226, 0.03);

    /* Type */
    --display: 'Host Grotesk', system-ui, sans-serif;
    --body: 'Public Sans', system-ui, sans-serif;
    --mono: 'Space Mono', ui-monospace, monospace;

    /* Rhythm */
    --xs: 4px;  --sm: 8px;  --md: 16px;  --lg: 24px;  --xl: 40px;  --xxl: 72px;
    --radius: 18px;
    --radius-sm: 12px;
    --ease: 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
    --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--body);
    font-weight: 300;
    line-height: 1.62;
    color: var(--cream);
    background: var(--ground);
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    cursor: none;
}

/* Restore native cursor where a custom one would be a nuisance */
@media (hover: none), (pointer: coarse) {
    body { cursor: auto; }
    .section-toggle, a, button { cursor: pointer; }
}

::selection { background: var(--teal); color: var(--ground); }
::-moz-selection { background: var(--teal); color: var(--ground); }

a { color: inherit; }

/* ---------- Custom cursor ---------- */
.cur-dot, .cur-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    will-change: transform;
}
.cur-dot {
    width: 6px; height: 6px;
    background: var(--cream);
    border-radius: 50%;
}
.cur-ring {
    width: 30px; height: 30px;
    border: 1px solid var(--cream);
    border-radius: 50%;
    transition: width var(--ease), height var(--ease), border-color var(--ease);
}
.cur-ring.hot {
    width: 52px; height: 52px;
    border-color: var(--teal);
}
@media (hover: none), (pointer: coarse) {
    .cur-dot, .cur-ring { display: none; }
}

/* ---------- Scroll progress ---------- */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--blue) 55%, var(--gold) 80%, var(--rust));
    z-index: 1001;
    transition: width 0.1s linear;
}

/* ---------- Moving background (kept, evolved) ---------- */
.animated-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    opacity: 0.06;
    will-change: transform, opacity;
}
.floating-shape.square   { border: 1px solid var(--teal); }
.floating-shape.circle   { border: 1px solid var(--blue); border-radius: 50%; }
.floating-shape.diamond  { border: 1px solid var(--gold); transform: rotate(45deg); }
.floating-shape.triangle {
    width: 0 !important; height: 0 !important;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 16px solid var(--rust);
    border-top: 0;
    opacity: 0.08;
}

.pulse-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
    opacity: 0.05;
    pointer-events: none;
}

@keyframes drift {
    0%   { transform: translate(0, 0) rotate(0deg);        opacity: 0.03; }
    25%  { transform: translate(14px, -22px) rotate(40deg); opacity: 0.09; }
    50%  { transform: translate(-10px, -12px) rotate(90deg); opacity: 0.06; }
    75%  { transform: translate(8px, -28px) rotate(150deg);  opacity: 0.10; }
    100% { transform: translate(0, 0) rotate(180deg);       opacity: 0.03; }
}
@keyframes driftSlow {
    0%, 100% { transform: translate(0, 0);          opacity: 0.04; }
    50%      { transform: translate(10px, -16px);   opacity: 0.08; }
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.03; transform: scale(1); }
    50%      { opacity: 0.07; transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
    .floating-shape, .pulse-element { animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Sticky header ---------- */
.sticky-header {
    position: fixed;
    top: -88px; left: 0; right: 0;
    z-index: 1000;
    background: rgba(17, 17, 17, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline);
    transition: top var(--ease);
    padding: 10px 0;
}
.sticky-header.visible { top: 0; }

.sticky-header .header-content {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 clamp(20px, 6vw, 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.sticky-header .logo-link { text-decoration: none; display: flex; }
.sticky-header .logo { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.sticky-header .logo svg { width: 100%; height: 100%; }
.sticky-header .header-text { display: flex; align-items: baseline; gap: 10px; }
.sticky-header .header-text h1 {
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cream);
}
.sticky-header .header-text p {
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--teal);
}

/* ---------- Container ---------- */
.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px) clamp(20px, 6vw, 80px) clamp(40px, 8vw, 96px);
    position: relative;
    z-index: 1;
}

/* ---------- Shared eyebrow / section label ---------- */
.sec-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--teal);
    display: block;
    margin-bottom: var(--md);
}

/* ---------- Main header ---------- */
.main-header {
    padding: clamp(36px, 7vw, 80px) 0 clamp(28px, 5vw, 48px);
    margin-bottom: var(--xl);
    border-bottom: 1px solid var(--hairline);
}
.main-header .header-content { display: flex; }
.logo-section {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 28px);
}
.logo-link { text-decoration: none; transition: transform var(--ease); display: flex; }
.logo-link:hover { transform: translateY(-2px); }
.main-header .logo {
    width: clamp(52px, 8vw, 68px);
    height: clamp(52px, 8vw, 68px);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: var(--ground-2);
    flex-shrink: 0;
}
.main-header .logo svg { width: 64%; height: 64%; }
.header-text h1 {
    font-family: var(--display);
    font-size: clamp(2.3rem, 6.5vw, 4.1rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 0.98;
    color: var(--cream);
}
.header-text p {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--muted);
    margin-top: 10px;
}

/* ---------- Stats ---------- */
.stats-section {
    margin-bottom: var(--xxl);
    display: flex;
    flex-direction: column;
    gap: var(--md);
}
.stats-badges {
    display: flex;
    gap: var(--sm);
    flex-wrap: wrap;
}
.badge {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 7px 13px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    white-space: nowrap;
    transition: border-color var(--ease), color var(--ease);
}
.badge.current {
    color: var(--teal);
    border-color: rgba(120, 190, 186, 0.45);
}
.badge.total { color: var(--faint); }
.generation-time {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    color: var(--faint);
    text-transform: uppercase;
}

/* ---------- Content rhythm ---------- */
.content { display: flex; flex-direction: column; gap: var(--xxl); }
.currently-listening { margin: 0; }
.currently-listening h2 {
    font-family: var(--display);
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cream);
    margin-bottom: var(--lg);
}

.album-du-jour { max-width: 720px; }

/* Hero (album du jour) card — specificity beats base .album-card below */
.album-card.current-card {
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 32px);
    position: relative;
    overflow: hidden;
}
.current-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--teal);
    opacity: 0.7;
}
.current-card .card-header { margin-bottom: var(--lg); }
.current-card .album-title {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    line-height: 1.06;
}

/* Embed */
.embed-container {
    width: 100%;
    margin-top: var(--md);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--ground-2);
}
.current-embed-container { max-width: 660px; }
.embed-container iframe { width: 100%; display: block; border: 0; }
.no-embed {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    padding: var(--lg);
    text-align: center;
}

/* ---------- Collapsible sections ---------- */
.collapsible-section {
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--ground-2);
    overflow: hidden;
}
.section-toggle {
    width: 100%;
    padding: clamp(18px, 3vw, 26px) clamp(20px, 3.5vw, 32px);
    background: transparent;
    border: none;
    color: var(--cream);
    cursor: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--md);
    text-align: left;
    transition: background var(--ease);
}
.section-toggle:hover { background: rgba(251, 249, 226, 0.025); }
.section-toggle h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cream);
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.count {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--teal);
}
.toggle-icon {
    font-size: 0.7rem;
    color: var(--teal);
    transition: transform var(--ease);
    flex-shrink: 0;
}
.section-toggle[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); }

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    border-top: 1px solid transparent;
}
.section-content.expanded {
    max-height: none;
    padding: clamp(16px, 3vw, 24px) clamp(20px, 3.5vw, 32px) clamp(20px, 3.5vw, 28px);
    border-top-color: var(--hairline);
}

/* ---------- Carousel ---------- */
.album-carousel {
    display: flex;
    gap: var(--md);
    overflow-x: auto;
    padding-bottom: var(--sm);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.album-carousel::-webkit-scrollbar { height: 5px; }
.album-carousel::-webkit-scrollbar-track { background: var(--hairline); border-radius: 999px; }
.album-carousel::-webkit-scrollbar-thumb { background: rgba(120, 190, 186, 0.5); border-radius: 999px; }
.album-carousel::-webkit-scrollbar-thumb:hover { background: var(--teal); }

.album-carousel .album-card { flex: 0 0 264px; width: 264px; scroll-snap-align: start; }

/* ---------- Album cards ---------- */
.album-card {
    background: var(--card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: var(--md);
    transition: transform var(--ease), border-color var(--ease), background var(--ease);
}
.album-card.compact-card:hover {
    transform: translateY(-3px);
    border-color: rgba(120, 190, 186, 0.55);
    background: rgba(251, 249, 226, 0.05);
}
.card-header { margin-bottom: var(--sm); }
.album-title {
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.22;
    color: var(--cream);
    margin-bottom: 5px;
}
.artist-name {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--muted);
    margin-bottom: var(--sm);
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.card-meta .date { color: var(--faint); }
.card-meta .rating { color: var(--gold); letter-spacing: 0; font-size: 0.8rem; }

/* ---------- Card links ---------- */
.card-links {
    margin-top: var(--md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sm);
}
.card-links a, .music-link {
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 6px 11px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.card-links a:hover, .music-link:hover {
    color: var(--ground);
    background: var(--teal);
    border-color: var(--teal);
}

/* ---------- Empty state ---------- */
.empty-section {
    padding: clamp(24px, 5vw, 40px);
    text-align: center;
    color: var(--muted);
}
.empty-section p { margin-bottom: var(--xs); }
.empty-section .subtitle {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--faint);
}

/* ---------- Webring (kept) ---------- */
.retro-buttons {
    margin-top: var(--xxl);
    padding-top: var(--xl);
    border-top: 1px solid var(--hairline);
    text-align: center;
}
.buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sm);
    flex-wrap: wrap;
}
/* Iframe viewport is larger than the 88x31 button so its 2px border +
   pulsing box-shadow + float never overflow → no scrollbars, no clipping.
   The button stays visually 88x31, centered inside. */
.button-iframe {
    width: 104px;
    height: 44px;
    border: none;
    background: transparent;
    vertical-align: middle;
    overflow: hidden;
}

/* Retain hooks the button iframes / legacy markup may use */
.sparkle {
    position: absolute;
    width: 2px; height: 2px;
    background: var(--cream);
    z-index: 10;
    animation: sparkle 2s infinite;
    pointer-events: none;
}
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%      { opacity: 1; transform: scale(1); }
}
@keyframes dr-eyeBlink {
    0%, 95%, 100% { transform: scaleY(1); }
    97% { transform: scaleY(0.1); }
}
.dr-button .dr-cloud-eye { animation: dr-eyeBlink 4s infinite; transform-origin: center; }

/* ---------- Footer ---------- */
.footer {
    margin-top: var(--xxl);
    padding-top: var(--xl);
    border-top: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--md);
    flex-wrap: wrap;
}
.footer p {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--faint);
}
.footer .squares {
    display: inline-grid;
    grid-template-columns: 10px 10px;
    grid-template-rows: 10px 10px;
    gap: 3px;
}
.footer .squares span { display: block; width: 10px; height: 10px; }
.footer .squares .s-yellow { background: var(--gold); }
.footer .squares .s-teal   { background: var(--teal); }
.footer .squares .s-blue   { background: var(--blue); }
.footer .squares .s-red    { background: var(--rust); }

/* ---------- Scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Breakpoints ---------- */
@media (max-width: 820px) {
    .content { gap: var(--xl); }
    .stats-section { margin-bottom: var(--xl); }
}
@media (max-width: 680px) {
    .album-carousel .album-card { flex: 0 0 232px; width: 232px; }
    .footer { justify-content: center; text-align: center; }
}
@media (max-width: 540px) {
    .header-text h1 { font-size: clamp(2rem, 12vw, 2.6rem); }
    .album-carousel .album-card { flex: 0 0 208px; width: 208px; }
    .buttons-container { gap: var(--sm); }
    body { cursor: auto; }
    .cur-dot, .cur-ring { display: none; }
}
