/* ============================================
   TECHNO VISUAL ARCHIVE — Styles
   Dark, industrial, functional.
   ============================================ */

@font-face {
    font-family: 'Megatron Sans';
    src: url('../fonts/MegatronSans-Regular.woff2') format('woff2'),
         url('../fonts/MegatronSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body, html, * { font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif !important; text-transform: uppercase; }
.site-nav-brand { font-family: 'Megatron Sans', 'Arial Black', sans-serif !important; }

:root {
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-hover: #1a1a1a;
    --border: #222222;
    --border-light: #333333;
    --text: #e0e0e0;
    --text-dim: #777777;
    --text-muted: #555555;
    --accent: #ffffff;
    --accent-dim: #aaaaaa;
    --mono: 'Megatron Sans', 'IBM Plex Mono', 'Consolas', monospace;
    --sans: 'Megatron Sans', 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    --grid-gap: 2px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.4;
    min-height: 100vh;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
button { cursor: pointer; font-family: inherit; }
select, input { font-family: var(--mono); }

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.header-title h1 {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.header-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    max-width: 500px;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.stat {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Controls --- */
.controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding-bottom: 1rem;
    overflow-x: auto;
}

.search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-wrap input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s;
}

.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { border-color: var(--text-dim); }

.filters {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.filter-group select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    outline: none;
    min-width: 140px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.filter-group select:focus { border-color: var(--text-dim); }

/* --- View tabs --- */
.view-tabs {
    display: flex;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.view-tab {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: none;
    padding: 0.55rem 1rem;
    transition: color 0.15s;
}

.view-tab + .view-tab { border-left: 1px solid var(--border); }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--accent); background: var(--border-light); }

/* --- View containers --- */
.view-container { display: none; }
.view-container.active { display: block; }

/* --- Active filters --- */
.active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-bottom: 0.75rem;
    min-height: 0;
}

.active-filters:empty { padding-bottom: 0; }

.filter-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-tag button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
}

.filter-tag button:hover { color: var(--accent); }

/* --- Result count --- */
.result-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border);
}

/* --- Grid mode toggle (inside grid view) --- */
.grid-mode-toggle {
    display: flex;
    border: 1px solid var(--border);
    position: absolute;
    top: 0.5rem;
    right: 2rem;
    z-index: 10;
}

#view-grid { position: relative; }

.view-btn {
    background: var(--bg-elevated);
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--border-light); color: var(--accent); }

/* --- Grid view --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 1px;
    padding: 1px;
}

.grid.view-list {
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0;
}
@media (max-width: 1400px) { .grid.view-list { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1000px) { .grid.view-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid.view-list { grid-template-columns: 1fr; } }

.grid.view-list .card-title { cursor: copy; }
.grid.view-list .card-title:hover { color: var(--accent); }
.grid.view-list .card-title.copied::after {
    content: ' ✓ copied';
    color: var(--accent);
    font-size: 0.6rem;
    margin-left: 0.25rem;
}

/* --- Release card (grid) --- */
.release-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-elevated);
}

.release-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.release-card img.loaded { opacity: 1; }

.release-card .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
    line-height: 1.3;
}

/* Grid-mode cards: info hidden (list view overrides below). */
.release-card .card-info { display: none; }

.card-info .card-artist {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info .card-title {
    font-size: 0.65rem;
    color: var(--accent-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info .card-meta {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- Release card (list view) --- */
.grid.view-list .release-card {
    aspect-ratio: unset;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 1rem;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border);
}

.grid.view-list .release-card img {
    width: 60px;
    height: 60px;
}

.grid.view-list .release-card .card-info {
    position: static;
    background: none;
    opacity: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid.view-list .release-card .placeholder {
    position: static;
    width: 60px;
    height: 60px;
}

/* --- Compact card (map sidebar) --- */
.release-card.compact {
    aspect-ratio: 1;
}

/* --- Loading --- */
.loading {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 2rem;
}

.loading.hidden { display: none; }

/* --- Load more --- */
.load-more {
    text-align: center;
    padding: 2rem;
    display: none;
}

.load-more.visible { display: block; }

.load-more button {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 0.7rem 2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.15s;
}

.load-more button:hover {
    background: var(--border);
    border-color: var(--border-light);
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.empty-state.visible { display: block; }

.empty-state p {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   TIMELINE VIEW
   ============================================ */

#view-timeline {
    position: relative;
}

#view-timeline.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.timeline-year-label { display: none; }

/* Nav (overview + decades) sits above the main strip */
.timeline-nav {
    padding: 0.5rem 2rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.timeline-overview {
    position: relative;
    height: 28px;
    display: flex;
    align-items: stretch;
    cursor: pointer;
    background: var(--bg-elevated);
    overflow: hidden;
}

.timeline-overview-bars {
    display: flex;
    flex: 1;
    height: 100%;
    align-items: stretch;
    gap: 0;
    min-width: 0;
}

.tl-ov-bar {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    opacity: 0.75;
    transition: opacity 0.1s ease;
}
.timeline-overview:hover .tl-ov-bar { opacity: 0.9; }

.timeline-viewport {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    border-left: 1px solid var(--accent);
    border-right: 1px solid var(--accent);
    pointer-events: none;
    transition: left 0.05s linear, width 0.05s linear;
}

.timeline-decades {
    display: flex;
    gap: 2px;
    margin-top: 6px;
    width: 100%;
}

.tl-decade {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-align: left;
    line-height: 1.1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tl-decade:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.tl-decade.active {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--bg-hover);
}

.tl-decade-all {
    flex: 0 0 auto !important;
    align-items: center;
    padding: 0.35rem 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tl-decade-label {
    font-weight: 600;
    letter-spacing: 0.04em;
}
.tl-decade-count {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.timeline-strip {
    display: flex;
    align-items: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    padding: 2.5rem 2rem 0;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg);
}

.timeline-strip { --tl-thumb-size: 40px; }

.tl-column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    justify-content: flex-end;
}

/* When zoomed into a decade, visible year columns fill the strip width. */
.timeline-strip.zoomed .tl-column {
    flex: 1 1 0;
    min-width: 0;
}
/* When zoomed into a single year, let the single column occupy the strip width
   and let covers wrap into a grid inside it. */
.timeline-strip.zoomed-year .tl-covers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tl-thumb-size), 1fr));
    gap: 2px;
    align-content: end;
    width: 100%;
    padding: 0 8px;
}

.tl-column--empty { opacity: 0.45; }

.tl-year {
    font-family: var(--mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    padding: 0.4rem 0.2rem;
    text-align: center;
    min-height: 1.8rem;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.tl-year:hover { color: var(--text); }
.tl-year.active {
    color: var(--accent);
    background: var(--bg-hover);
}

.tl-year--decade {
    color: var(--text-dim);
    font-weight: 500;
    border-top: 1px solid var(--border);
}

.tl-covers {
    display: flex;
    flex-direction: column-reverse;
    gap: 1px;
    width: 100%;
    align-items: center;
}

.tl-thumb {
    width: var(--tl-thumb-size);
    height: var(--tl-thumb-size);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.tl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tl-thumb img.loaded { opacity: 1; }

.tl-thumb:hover {
    outline: 1px solid var(--text-dim);
    z-index: 2;
}

.tl-more {
    font-family: var(--mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    padding: 0.3rem;
    text-align: center;
    cursor: default;
}

.timeline-empty {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 2rem;
    width: 100%;
}

/* ============================================
   MAP VIEW
   ============================================ */

#view-map.active {
    display: block;
    height: calc(100vh - 200px);
}

.map-wrap {
    display: grid;
    grid-template-columns: 1fr 0;
    height: 100%;
    transition: grid-template-columns 0.3s;
}

.map-wrap:has(.map-sidebar.open) {
    grid-template-columns: 1fr 360px;
}

#map-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Leaflet dark overrides */
.leaflet-container {
    background: var(--bg) !important;
    font-family: var(--mono) !important;
}

.leaflet-control-attribution { display: none !important; }

/* Map thumbnail markers — one per release, scattered */
.map-thumb-icon {
    background: none !important;
    border: none !important;
}

/* Default / world zoom: tiny thumbs so they fit inside each country */
.map-thumb {
    width: 10px;
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    cursor: pointer;
    background: var(--bg-elevated);
    transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, transform 0.15s ease;
    position: relative;
    margin: -5px 0 0 -5px; /* keep centered on lat/lng anchor while size changes */
}

.map-thumb:hover {
    transform: scale(4.5);
    z-index: 1000;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 12px rgba(0, 0, 0, 0.8);
}

.map-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-thumb-empty {
    background: var(--border);
    background-image:
        linear-gradient(135deg, transparent 46%, rgba(255,255,255,0.15) 46%, rgba(255,255,255,0.15) 54%, transparent 54%);
}

/* Thumb sizes per zoom level — grow as you zoom in */
.zoom-world .map-thumb { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.zoom-continent .map-thumb { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.zoom-country .map-thumb { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.zoom-region .map-thumb { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.zoom-city .map-thumb { width: 52px; height: 52px; margin: -26px 0 0 -26px; }

/* Scale hover effect down as thumbs grow (less extreme zoom-in) */
.zoom-continent .map-thumb:hover { transform: scale(3.5); }
.zoom-country .map-thumb:hover { transform: scale(2.6); }
.zoom-region .map-thumb:hover { transform: scale(1.8); }
.zoom-city .map-thumb:hover { transform: scale(1.4); }

/* Scene label — clickable center of each cluster */
.map-label-icon {
    background: none !important;
    border: none !important;
    pointer-events: none;
}

.map-scene-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.15s ease, color 0.15s ease;
    backdrop-filter: blur(4px);
    transform: translateX(-50%);
}

.map-scene-label:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.map-scene-name {
    font-weight: 500;
}

.map-scene-count {
    color: var(--text-dim);
    font-size: 0.55rem;
}

.map-scene-label:hover .map-scene-count {
    color: var(--accent);
}

/* Scene labels: hidden at world zoom (overlap in dense regions like Europe),
   visible from continent zoom onward. */
.zoom-world .map-label-icon { display: none; }
.zoom-continent .map-scene-label { font-size: 0.55rem; padding: 0.15rem 0.4rem; }
.zoom-continent .map-scene-count { font-size: 0.5rem; }

/* Map sidebar */
.map-sidebar {
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    display: none;
}

.map-sidebar.open { display: flex; flex-direction: column; }

.map-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.map-sidebar-title {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.map-sidebar-count {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.map-sidebar-labels {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.map-sidebar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.map-sidebar-close:hover { color: var(--accent); }

.map-sidebar-body { flex: 1; overflow-y: auto; }

.map-sidebar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 1px;
}

/* ============================================
   COLOR VIEW
   ============================================ */

#view-color.active {
    display: flex;
    flex-direction: column;
}

.color-spectrum {
    display: flex;
    height: 10px;
    margin: 0;
    flex-shrink: 0;
}

.spectrum-segment {
    min-width: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.spectrum-segment:hover {
    opacity: 0.7;
}

/* --- Full-screen mosaic ordered by hue --- */
.color-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0;
    padding: 0;
    width: 100%;
}

.color-mosaic .release-card {
    height: 100%;
    width: 100%;
}

/* ============================================
   OVERLAY
   ============================================ */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.overlay.open { display: flex; }

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.overlay-content {
    position: relative;
    margin: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close:hover { color: var(--accent); }

.overlay-body { padding: 0; }

.overlay-image {
    width: 100%;
    aspect-ratio: 1;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.overlay-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s;
    image-rendering: auto;
}

.overlay-details {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.overlay-details h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.overlay-details .overlay-artist {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.overlay-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.overlay-meta-item label {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.15rem;
}

.overlay-meta-item span {
    font-size: 0.8rem;
    color: var(--text);
}

.overlay-colors {
    display: flex;
    gap: 0.4rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.overlay-swatch {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    cursor: default;
}

.overlay-link {
    display: inline-block;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.overlay-link a {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.15s;
}

.overlay-link a:hover { color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */

footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

footer p {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.8;
}

footer a { text-decoration: underline; }

/* ============================================
   HERO — wordmark + falling covers
   ============================================ */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 1440 / 768;
    max-height: 100vh;
    overflow: hidden;
    background: #fff;
    animation: heroFlash 0.18s steps(1, end) infinite;
}
.hero-drops {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.hero-drop {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    background: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    will-change: transform;
    top: 0; left: 0;
}
.hero-drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-wordmark {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    mix-blend-mode: difference;
}
.hero-wordmark svg {
    width: 100%;
    height: 100%;
    animation: heroTitleJitter 2.4s ease-in-out infinite;
}
.hero-wordmark svg path { fill: #fff !important; animation: heroTitleHue 0.09s steps(1, end) infinite; }
.hero-wordmark svg rect { fill: #0a0a0a !important; }
@keyframes heroTitleJitter {
    0%, 100% { filter: none; }
    48%      { filter: blur(0.4px); }
    50%      { filter: blur(0) contrast(2); }
    52%      { filter: blur(0.4px); }
}
@keyframes heroTitleHue {
    0%, 49.9% { fill: #fff !important; }
    50%, 100% { fill: #ff2d2d !important; }
}
.hero-scroll-cue {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #888;
    mix-blend-mode: difference;
    animation: heroCue 2s ease-in-out infinite;
}

@keyframes heroFlash {
    0%, 49.9% { background: #fff; }
    50%, 100% { background: #000; }
}
@keyframes heroTextFlash {
    0%, 49.9% { fill: #000; }
    50%, 100% { fill: #fff; }
}
@keyframes heroCue {
    0%, 100% { opacity: 0.4; transform: translate(-50%, 0); }
    50% { opacity: 1; transform: translate(-50%, 4px); }
}

@media (max-width: 768px) {
    .hero {
        aspect-ratio: auto;
        height: 100vh;
        height: 100dvh; /* use dynamic viewport so mobile browser chrome doesn't clip */
        max-height: none;
    }
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .site-header { padding: 1rem 1rem 0; }
    .header-top { flex-direction: column; gap: 0.75rem; }
    .header-stats { gap: 1rem; }
    .controls { flex-direction: column; align-items: stretch; }
    .search-wrap { max-width: 100%; }
    .filters { flex-wrap: wrap; }
    .view-tabs { width: 100%; }
    .view-tab { flex: 1; text-align: center; padding: 0.6rem 0.5rem; }

    .grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
    .grid.view-list .release-card { padding: 0.75rem 1rem; }
    .result-count { padding: 0.75rem 1rem; }

    .grid-mode-toggle { right: 1rem; }

    /* Map: sidebar overlays */
    .map-wrap:has(.map-sidebar.open) {
        grid-template-columns: 1fr;
    }
    .map-sidebar.open {
        position: absolute;
        inset: 0;
        z-index: 10;
    }

    /* Timeline */
    .tl-column { flex: 1 1 0; min-width: 0; }
    .tl-thumb { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
    .color-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   SITE NAV (home + library top bar)
   ============================================ */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-nav--over-hero {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    mix-blend-mode: difference;
    color: #fff;
}
.site-nav--scrolled {
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    mix-blend-mode: normal;
}
.site-nav-brand {
    font-family: 'Megatron Sans', sans-serif;
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: 0;
    color: inherit;
    text-decoration: none;
}
.site-nav-links {
    display: flex;
    gap: 1.5rem;
}
.site-nav-links a {
    color: inherit;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.site-nav-links a:hover,
.site-nav-links a.active { opacity: 1; }
.site-nav-links a.active { text-decoration: underline; text-underline-offset: 4px; }

/* ============================================
   SCENES — laid out per section2.svg mockup:
   title (right column) → full-width photo row with one expanded → body (right column)
   ============================================ */
.scenes {
    background: #0a0a0a;
    color: #fff;
    padding: 5rem 0 6rem;
    max-width: 100%;
    overflow: hidden;
}
.scenes-intro,
.scene-text {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 1.5rem !important;
    display: block !important;
    grid-template-columns: none !important;
}
.scenes-intro > *,
.scene-text > * {
    max-width: none !important;
    width: 100% !important;
    grid-column: auto !important;
    text-align: left;
}
.scenes-intro {
    margin-bottom: 4rem;
}
.scenes-intro p {
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #e8e8e8;
    margin: 0 0 1.25rem;
    text-transform: uppercase;
    max-width: 72ch;
}
@media (max-width: 720px) {
    .scenes-intro p { font-size: clamp(1.35rem, 4.8vw, 1.8rem); line-height: 1.35; max-width: none; }
}
.scenes-intro p:last-child { margin-bottom: 0; }

.scenes-carousel-wrap {
    position: relative;
    margin-bottom: 3.5rem;
}
.scenes-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
    transition: background 0.15s, transform 0.15s;
}
.scenes-arrow:hover { background: #fff; color: #000; }
.scenes-arrow-prev { left: 1.5rem; }
.scenes-arrow-next { right: 1.5rem; }

.scenes-carousel {
    display: flex;
    gap: 0;
    overflow: hidden;
    scrollbar-width: none;
    padding: 0 0 1rem;
}
.scenes-carousel::-webkit-scrollbar { display: none; }

.scene-card {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    height: 265px;
    transform-origin: center center;
    will-change: transform, filter;
    border: none;
    padding: 0;
    background: #111;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(.2,.8,.3,1),
                height 0.4s cubic-bezier(.2,.8,.3,1),
                filter 0.3s;
    filter: brightness(0.6);
}
.scene-card img {
    width: auto;
    height: 100%;
    display: block;
    filter: grayscale(1) contrast(1.05);
}
.scene-card:hover { filter: brightness(0.85); }
/* Proximity-based expansion set by JS via inline transform/filter. */
.scenes-carousel { align-items: flex-start; padding: 3rem 0; cursor: grab; user-select: none; }
.scenes-carousel.dragging { cursor: grabbing; }
.scene-card { transform-origin: center top; }
.scene-title, .scene-body { transition: opacity 0.2s ease; }
.scene-text.fading .scene-title, .scene-text.fading .scene-body { opacity: 0; }
.scene-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1rem; }
.scene-title-row .scene-title { margin: 0; }
.scene-nav-group { display: flex; gap: 0.5rem; }
.scene-nav {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.8rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, transform 0.15s;
}
.scene-nav:hover { opacity: 1; transform: scale(1.1); }

.scene-text h3 {
    font-family: 'Megatron Sans', sans-serif;
    font-size: clamp(1.5rem, 2.2vw, 2.2rem);
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 1.25rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.scene-text p {
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.65;
    color: #cfcfcf;
    margin: 0;
    text-transform: uppercase;
    text-indent: 2.5em;
    max-width: 75ch;
}
.scenes-intro p { text-indent: 2.5em; }

/* ===== Home: visual system breakdown ===== */
.system {
    background: #0a0a0a;
    color: #fff;
    padding: 5rem 0 6rem;
    border-top: 1px solid #111;
}
.system-head {
    max-width: none !important;
    width: 100% !important;
    margin: 0 0 3rem !important;
    padding: 0 1.5rem !important;
    display: block !important;
    grid-template-columns: none !important;
}
.system-head > * { max-width: none !important; width: 100% !important; grid-column: auto !important; text-align: left; }
.system-head h2 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.system-head p {
    margin: 0;
    color: #b5b5b5;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.65;
    max-width: 70ch;
}
.system-grid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}
.system-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.system-img {
    height: 100%;
    background: #111;
    overflow: hidden;
    position: relative;
}
.system-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1) contrast(1.05);
}
.system-item figcaption { display: flex; flex-direction: column; gap: 0.4rem; }
.system-num {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: #666;
}
.system-item h3 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.system-item figcaption p {
    margin: 0;
    color: #9a9a9a;
    font-size: 0.82rem;
    line-height: 1.55;
}

@media (max-width: 960px) {
    .system-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .system-head { grid-template-columns: 1fr; }
    .system-head > * { grid-column: 1; }
    .system-grid { grid-template-columns: 1fr; }
}

/* ===== Home: trail ===== */
.trail-section {
    background: #0a0a0a;
    padding: 0;
}
.trail-section {
    padding: 1.5rem !important;
    box-sizing: border-box;
}
.trail-frame {
    width: 100%;
    height: 85vh;
    min-height: 480px;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    border: 1px solid #fff;
    box-sizing: border-box;
}
.trail-drop {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 5.5s ease-out, transform 5.5s ease-out;
    will-change: opacity, transform;
}
.trail-drop img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.trail-drop.fading { opacity: 0; }
@media (max-width: 720px) {
    .trail-frame { height: 70vh; }
}

/* Home footer */
body.is-home footer { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }
body.is-home footer a { color: var(--text); }


@media (max-width: 720px) {
    .scene-card { height: 200px; }
}

/* ============================================
   TRIAD — SCARCITY / REFUSAL / RUIN
   ============================================ */
.triad {
    background: #0a0a0a;
    color: #fff;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 2%;
    box-sizing: border-box;
}
.triad-row {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}
.triad-row span {
    font-family: 'Megatron Sans', 'Megatron', 'Arial Black', Impact, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    line-height: 0.82;
    display: block;
    will-change: font-size, letter-spacing;
}

.ppi-essays {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 5rem 1.5rem;
    background: #0a0a0a;
    color: #fff;
    box-sizing: border-box;
}
.ppi-col h3 {
    font-family: 'Megatron Sans', 'Megatron', 'Arial Black', Impact, sans-serif;
    text-transform: uppercase;
    font-size: clamp(1.1rem, 1.4vw, 1.4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.04em;
    margin: 0 0 1.25rem;
    color: #fff;
}
.ppi-col p {
    text-transform: uppercase;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    margin: 0 0 1rem;
    text-indent: 2.5em;
    color: #cfcfcf;
}
@media (max-width: 900px) {
    .ppi-essays { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1.25rem; }
}

.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 3rem;
    padding: 6rem 1.5rem;
    background: #0a0a0a;
    color: #fff;
    box-sizing: border-box;
}
.about-left {
    position: relative;
    min-height: 100%;
    display: block;
}
.about-right p {
    text-transform: uppercase;
    font-size: clamp(1.2rem, 1.5vw, 1.55rem);
    line-height: 1.5;
    letter-spacing: 0.01em;
    margin: 0 0 1.5rem;
    text-indent: 0;
    color: #dcdcdc;
}
@media (max-width: 720px) {
    .about-right p { font-size: clamp(1.2rem, 4.4vw, 1.6rem); line-height: 1.4; }
}
.about-right p:last-child { margin-bottom: 0; }
@media (max-width: 900px) {
    .about-section { grid-template-columns: 1fr; gap: 2rem; padding: 4rem 1.25rem; }
}

.cover-pile {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.pile-cover {
    position: absolute;
    width: 35%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.8);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
    pointer-events: none;
}

.about-cta {
    text-indent: 0 !important;
    margin-top: 2rem !important;
}
.about-cta a {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #000;
    background: #fff;
    text-decoration: none;
    border: 0;
    outline: 0;
    padding: 0.85rem 1.5rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.about-cta a:hover { background: #000; color: #fff; }

.about-title {
    font-family: 'Megatron Sans', 'Megatron', 'Arial Black', Impact, sans-serif;
    text-transform: uppercase;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0 0 1.75rem;
    color: #fff;
    line-height: 1.05;
}

/* ===== Library edit mode ===== */
.edit-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}
.edit-btn {
    background: transparent;
    color: #fff;
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.edit-btn:hover { background: #fff; color: #000; border-color: #fff; }
.edit-btn.active { background: #fff; color: #000; border-color: #fff; }
.edit-btn-primary { border-color: #fff; }
.edit-status {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    letter-spacing: 0.02em;
}
.card-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.15s, transform 0.15s;
}
.card-remove:hover { background: #e33; transform: scale(1.1); }
.release-card { position: relative; }
body.editing .card-remove { display: flex; }
body.editing .release-card { cursor: default; }
body.editing .release-card:hover { outline: 1px solid rgba(255,80,80,0.6); }

/* ===== Scenes marquee: photos scroll left, city names overlay scrolls right ===== */
.scenes-marquee-stack {
    width: 100%;
    margin-bottom: 3rem;
    background: #0a0a0a;
}
.scenes-photo-marquee {
    position: relative;
    width: 100%;
    height: clamp(320px, 48vw, 540px);
    overflow: hidden;
    background: #0a0a0a;
}

/* Photos — top-aligned row with per-orientation heights
   (matches the 1350x1080 landscape vs 1080x1350 portrait spec). */
.scenes-photo-track {
    display: flex;
    gap: 0;
    align-items: flex-start; /* top-align landscape tiles against the row top */
    width: max-content;
    height: 100%;
    animation: scenes-photo-marquee 140s linear infinite;
    will-change: transform;
}
.marquee-item {
    flex: 0 0 auto;
    background: #111;
    overflow: hidden;
    cursor: pointer;
}
/* Landscape: 80% row height (1080/1350), top-aligned */
.marquee-item.is-landscape {
    height: 80%;
    aspect-ratio: 1350 / 1080;
}
/* Portrait: full row height (1350/1350), top-aligned */
.marquee-item.is-portrait {
    height: 100%;
    aspect-ratio: 1080 / 1350;
}
.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1) contrast(1.05);
    transition: filter 0.25s ease;
}
.marquee-item:hover img { filter: grayscale(1) contrast(1.15) brightness(1.1); }

/* City names — overlay, pinned to the very top of the photos, white, wide tracking */
.scenes-names-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: difference;
}
.scenes-names-track {
    display: flex;
    gap: 0;
    width: max-content;
    align-items: flex-start;
    animation: scenes-names-marquee 140s linear infinite;
    will-change: transform;
    pointer-events: auto;
}
.scene-name-btn {
    background: transparent;
    border: 0;
    color: #fff;
    font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif;
    font-size: 64px;
    font-weight: 700;
    letter-spacing: 1.37em; /* 137% spacing */
    text-transform: uppercase;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
    opacity: 0.9;
}
.scene-name-btn:hover,
.scene-name-btn.active { opacity: 1; }
.scene-name-sep {
    color: #fff;
    font-size: 64px;
    letter-spacing: 1.37em;
    padding: 0 1.37em 0 0;
    opacity: 0.5;
    user-select: none;
    line-height: 1;
}
@media (max-width: 720px) {
    .scene-name-btn,
    .scene-name-sep { font-size: 36px; }
}

@keyframes scenes-photo-marquee {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}
@keyframes scenes-names-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (max-width: 720px) {
    .scenes-photo-marquee { height: 280px; }
    .scenes-photo-track { animation-duration: 100s; }
    .scenes-names-track { animation-duration: 100s; }
}

/* ===== Global section rhythm (UX/UI vertical spacing) =====
   8-pt scale. Desktop sections get 96px top/bottom padding, mobile 64px.
   Blocks inside a section space at 48px / 32px. */
:root {
    --section-py: 6rem;       /* 96px */
    --section-py-sm: 4rem;    /* 64px */
    --block-gap: 3rem;        /* 48px */
    --block-gap-sm: 2rem;     /* 32px */
}

.scenes {
    /* Intro hugs the hero — small top gap so it reads as the hero's subtitle. */
    padding-top: 1.5rem !important;
    padding-bottom: var(--section-py) !important;
}
.ppi-essays,
.about-section {
    padding-top: var(--section-py) !important;
    padding-bottom: var(--section-py) !important;
}

/* Scenes internal rhythm: intro → marquee → text, evenly spaced. */
.scenes-intro { margin-bottom: var(--block-gap) !important; }
.scenes-marquee-stack { margin-bottom: var(--block-gap) !important; }
.scene-text { margin-top: 0 !important; }

/* PPI kinetic iframe: breathe away from essays above and trail below. */
.ppi-section { margin: var(--block-gap) 0 !important; }

/* Trail (mouse path) already has inset padding; give it air around. */
.trail-section { margin: var(--block-gap) 0 !important; }

/* Footer spacing from about section. */
footer { padding: var(--section-py) 1.5rem !important; }

@media (max-width: 720px) {
    .scenes,
    .ppi-essays,
    .about-section,
    footer {
        padding-top: var(--section-py-sm) !important;
        padding-bottom: var(--section-py-sm) !important;
    }
    .scenes-intro,
    .scenes-marquee-stack,
    .ppi-section,
    .trail-section { margin-bottom: var(--block-gap-sm) !important; }
}

/* Scene title row — arrows sit at the end of the title */
.scene-text .scene-title-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
}
.scene-text .scene-title { flex: 0 1 auto; margin: 0; }
.scene-text .scene-nav-group {
    display: inline-flex;
    gap: 0.35rem;
    margin-left: auto;
}
.scene-text .scene-nav {
    background: #fff;
    border: 0;
    outline: 0;
    color: #000;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.scene-text .scene-nav:hover,
.scene-text .scene-nav:focus-visible { background: #000; color: #fff; }

/* ===== Legal pages (Impressum / Datenschutz) ===== */
body.legal-page { background: #0a0a0a; color: #e8e8e8; }
.legal-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 8rem 1.5rem 5rem;
}
.legal-main h1 {
    font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.05;
    margin: 0 0 1.5rem;
    color: #fff;
}
.legal-main h2 {
    font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: #fff;
    margin: 2.5rem 0 0.75rem;
}
.legal-main p,
.legal-main li {
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.7;
    color: #cfcfcf;
    margin: 0 0 0.9rem;
    text-transform: none;
}
.legal-main ul { margin: 0 0 1rem 1.5rem; }
.legal-main li { margin-bottom: 0.4rem; }
.legal-main a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.legal-main a:hover { color: #fff; text-decoration: none; }
.legal-main strong { color: #fff; }
.legal-main code {
    font-family: ui-monospace, Menlo, monospace;
    background: #1a1a1a;
    padding: 0.1rem 0.4rem;
    font-size: 0.9em;
}
.legal-intro {
    border-left: 2px solid #fff;
    padding-left: 1rem;
    color: #e8e8e8;
    margin-bottom: 2.5rem;
}
.legal-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 3rem;
    font-style: italic;
}
.legal-footer-link {
    margin-top: 2rem;
    font-weight: 700;
}

.legal-changelog { list-style: disc; margin-left: 1.5rem; }
.legal-changelog li { font-size: 0.85rem; color: #aaa; margin-bottom: 0.35rem; }
.legal-changelog li strong { color: #fff; font-weight: 700; margin-right: 0.4rem; }

/* Offset content so the fixed site nav doesn't overlap anything on non-home pages. */
body:not(.is-home) { padding-top: 72px; }
body:not(.is-home) .site-header { padding-top: 1rem; top: 72px; }
body.legal-page .legal-main { padding-top: 3rem; }

.site-nav-brand--full {
    font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif !important;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

/* ===== Block-mode: strip visible outlines & separators site-wide ===== */
.site-nav,
.site-nav--scrolled,
.site-header,
.result-count,
.view-tabs,
.view-tab + .view-tab,
.grid-mode-toggle,
.view-btn + .view-btn,
.trail-frame,
.scenes-names-marquee,
.filter-tag,
.search-wrap input,
.filter-group select,
.edit-btn,
.edit-controls,
footer {
    border: 0 !important;
}
/* Keep usable focus state on inputs/selects without a border line */
.search-wrap input:focus,
.filter-group select:focus { outline: 1px solid #fff; outline-offset: -1px; }

/* Replace the thin separators that divided segmented controls with zero-gap blocks */
.view-tab,
.view-btn { background: var(--bg-elevated); }

/* No underline on the active scene name in the carousel — keep it as pure opacity */
.scene-name-btn.active { text-decoration: none; }

/* Scene nav arrow glyph — same chevron used in the library filter dropdowns */
.scene-text .scene-nav svg { width: 14px; height: 10px; display: block; }
.scene-text .scene-nav-prev svg { transform: rotate(90deg); }
.scene-text .scene-nav-next svg { transform: rotate(-90deg); }

/* Library search header: solid sticky bar under the fixed nav */
body:not(.is-home) .site-header {
    position: sticky;
    top: 72px;
    z-index: 90;
    background: var(--bg);
    padding: 1rem 2rem !important;
    margin: 0 !important;
}
body:not(.is-home) main { position: relative; z-index: 1; }

/* Keep the white outline on the trail/mouse-path frame so it reads as interactive */
.trail-frame { border: 1px solid #fff !important; }

/* Force the sticky search header above map tiles & all view content */
body:not(.is-home) .site-header { z-index: 1000 !important; }
/* Leaflet's internal panes can go up to ~650; keep them below the sticky header */
.leaflet-pane,
.leaflet-control,
.leaflet-top,
.leaflet-bottom { z-index: auto !important; }
#map-container .leaflet-container { z-index: 1; }

/* Mobile: bigger section headings + CTA for shorter lines */
@media (max-width: 720px) {
    .about-title { font-size: clamp(2.25rem, 8vw, 3rem) !important; line-height: 1 !important; }
    .system-head h2 { font-size: clamp(2rem, 7vw, 2.75rem) !important; line-height: 1.05 !important; }
    .ppi-col h3 { font-size: clamp(1.3rem, 5vw, 1.8rem) !important; }
    .ppi-col p { font-size: clamp(1.05rem, 4vw, 1.35rem) !important; line-height: 1.45 !important; text-indent: 0 !important; }
    .scene-text .scene-title { font-size: clamp(1.75rem, 6.5vw, 2.4rem) !important; }
    .scene-text p { font-size: clamp(1.05rem, 4vw, 1.35rem) !important; line-height: 1.5 !important; text-indent: 0 !important; }
    .about-cta a { font-size: 1rem; padding: 1rem 1.5rem; }
}

/* Mobile: collapse library brand to the AE monogram so it doesn't clash with view tabs */
@media (max-width: 720px) {
    .site-nav-brand--full {
        font-size: 0;
        line-height: 1;
    }
    .site-nav-brand--full::before {
        content: "Æ";
        font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif;
        font-size: 1.9rem;
        font-weight: 700;
        letter-spacing: 0;
        color: inherit;
        display: inline-block;
    }
}

/* Mobile: search header stays pinned, fully opaque, never lets the grid show through */
@media (max-width: 720px) {
    body:not(.is-home) .site-header {
        position: sticky;
        top: 60px;
        z-index: 1000 !important;
        background: #0a0a0a !important;
        padding: 0.85rem 1rem !important;
        box-shadow: 0 1px 0 #1a1a1a;
    }
    body:not(.is-home) .site-header .controls { flex-wrap: wrap; gap: 0.6rem; padding-bottom: 0; }
    body:not(.is-home) .site-header .search-wrap { flex: 1 1 100%; max-width: none; }
    body:not(.is-home) .site-header .filters { flex: 1 1 100%; gap: 0.5rem; }
    body:not(.is-home) .site-header .filter-group select { min-width: 0; width: 100%; font-size: 0.8rem; }
    body:not(.is-home) { padding-top: 60px; }
}

/* Mobile: interleave cover pile between About title and paragraph */
@media (max-width: 900px) {
    .about-section { display: flex !important; flex-direction: column; gap: 1.5rem; }
    .about-left, .about-right { display: contents; }
    .about-title { order: 1; }
    .about-left > #cover-pile {
        order: 2;
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
        min-height: 0;
        max-height: 75vw;
        overflow: hidden;
        position: relative;
    }
    .about-left > #cover-pile .pile-cover { width: 44%; }
    .about-right > p { order: 3; }
    .about-right > .about-cta { order: 4; }
}

/* Read more / read less — visible only on mobile */
.scene-more {
    display: none;
    margin-top: 1rem;
    background: transparent;
    border: 0;
    padding: 0.25rem 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}
@media (max-width: 720px) {
    .scene-text .scene-body {
        display: -webkit-box;
        -webkit-line-clamp: 6;
        line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .scene-text.expanded .scene-body {
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }
    .scene-more { display: inline-block; }
}

/* Mobile: CTA becomes a full-width centered block */
@media (max-width: 720px) {
    .about-cta { text-align: center !important; }
    .about-cta a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1.15rem 1rem;
    }
}

/* Library: search header sits at top of the page and scrolls away with content. Never overlaps grid/map. */
body:not(.is-home) .site-header {
    position: static !important;
    top: auto !important;
}

/* Mobile: force Arial Black on all body copy (titles keep their chosen faces) */
@media (max-width: 720px) {
    .scenes-intro p,
    .scene-text .scene-body,
    .about-right p,
    .ppi-col p,
    .scene-more {
        font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif !important;
    }
}

/* Remove link underlines across the site (legal pages keep theirs) */
a { text-decoration: none; }
body:not(.legal-page) a,
body:not(.legal-page) a:hover,
body:not(.legal-page) a:focus { text-decoration: none !important; }

/* Album detail overlay: fit properly on mobile */
@media (max-width: 720px) {
    .overlay-content {
        max-width: 100%;
        width: calc(100% - 1.5rem) !important;
        max-height: calc(100dvh - 1.5rem) !important;
        margin: 0.75rem auto !important;
    }
    .overlay-details { padding: 1rem 1.15rem !important; }
    .overlay-details h2 { font-size: 1.25rem !important; }
    .overlay-details .overlay-artist { font-size: 1rem !important; }
    .overlay-close {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.75rem;
    }
    .overlay-image { aspect-ratio: 1; }
}

/* Mobile: force Arial Black on every text element except wordmark/logo SVGs */
@media (max-width: 720px) {
    body, body *:not(svg):not(svg *) {
        font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif !important;
    }
    /* Keep Megatron on the hero wordmark, nav brand and city-name carousel */
    .site-nav-brand,
    .site-nav-brand--full,
    .scene-name-btn,
    .scene-name-sep {
        font-family: 'Megatron Sans', 'Arial Black', Impact, sans-serif !important;
    }
}

/* Library search header: always pinned at the top while scrolling */
body:not(.is-home) .site-header {
    position: sticky !important;
    top: 72px !important;
    z-index: 1000 !important;
    background: #0a0a0a !important;
}
@media (max-width: 720px) {
    body:not(.is-home) .site-header { top: 60px !important; }
}
