/* ==========================================================================
   DATA AS ART v2 — Entangled Bodies
   NASA APOD + NEO + DONKI + Open-Meteo
   ========================================================================== */

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

.data-art-body {
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    font-family: 'Space Mono', monospace;
    color: #fff;
    cursor: crosshair;
}

/* --- Canvas --- */
canvas#main {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
}

/* --- Scanline overlay --- */
#scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 12;
}

/* --- HUD: Data Panel --- */
#data-panel {
    position: fixed;
    bottom: 24px;
    left: 24px;
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.8;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    z-index: 15;
    pointer-events: none;
    max-width: 360px;
}

#data-panel .label { color: rgba(255,255,255,0.15); }
#data-panel .value { color: rgba(255,255,255,0.5); }

/* --- Title Panel --- */
#title-panel {
    position: fixed;
    top: 24px;
    right: 24px;
    text-align: right;
    z-index: 15;
    pointer-events: none;
}

#title-panel h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}

#title-panel .apod-title {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    max-width: 280px;
    margin-left: auto;
}

/* --- Controls --- */
#controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 15;
    display: flex;
    gap: 8px;
}

#controls button {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.4);
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#controls button:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.25);
}

/* --- Overlays --- */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
    overflow-y: auto;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 28px;
    cursor: pointer;
    z-index: 101;
    transition: color 0.2s;
}

.overlay-close:hover {
    color: rgba(255,255,255,0.8);
}

.overlay-content {
    max-width: 800px;
    width: 90%;
    padding: 40px 0;
}

/* Photo overlay */
#raw-photo {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
}

#photo-caption h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 22px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}

#photo-caption p {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    line-height: 1.7;
    color: rgba(255,255,255,0.35);
    margin-bottom: 12px;
}

#photo-caption a {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

#photo-caption a:hover {
    color: rgba(255,255,255,0.7);
}

/* Info overlay */
.info-text h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 28px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
}

.info-text h3 {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-top: 28px;
    margin-bottom: 8px;
}

.info-text p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    line-height: 1.65;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.info-text strong {
    color: rgba(255,255,255,0.55);
}

.info-credit {
    margin-top: 36px;
    font-family: 'Space Mono', monospace !important;
    font-size: 9px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2) !important;
}

.info-credit a {
    color: rgba(255,255,255,0.3);
    text-decoration: none;
}

.info-credit a:hover {
    color: rgba(255,255,255,0.5);
}

/* --- Loading --- */
#loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 1.5s ease;
}

#loading-overlay.fade {
    opacity: 0;
    pointer-events: none;
}

#loading-overlay p {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}