/* ============================================
   interplanetary.biz - Styles
   Pop-Art Space Commerce + HUD Overlay
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0A0A12;
    color: #E8E2D6;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 17px;
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Scanline Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 229, 255, 0.03) 2px,
        rgba(0, 229, 255, 0.03) 3px
    );
    pointer-events: none;
    z-index: 10000;
}

/* --- HUD Overlay --- */
#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Corner Brackets */
.hud-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
}

.hud-bracket-tl {
    top: 20px;
    left: 20px;
    border-top: 2px solid #FF2D6B;
    border-left: 2px solid #FF2D6B;
}

.hud-bracket-tr {
    top: 20px;
    right: 20px;
    border-top: 2px solid #FF2D6B;
    border-right: 2px solid #FF2D6B;
}

.hud-bracket-bl {
    bottom: 20px;
    left: 20px;
    border-bottom: 2px solid #FF2D6B;
    border-left: 2px solid #FF2D6B;
}

.hud-bracket-br {
    bottom: 20px;
    right: 20px;
    border-bottom: 2px solid #FF2D6B;
    border-right: 2px solid #FF2D6B;
}

/* HUD Readouts */
.hud-readout {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.hud-readout-tl {
    top: 28px;
    left: 70px;
}

.hud-readout-tr {
    top: 28px;
    right: 70px;
    text-align: right;
}

.hud-readout-bl {
    bottom: 28px;
    left: 70px;
}

.hud-readout-br {
    bottom: 28px;
    right: 70px;
    text-align: right;
}

/* Radar Blip Navigation */
.hud-nav {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
}

.radar-blip {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.25);
    border: 1px solid #00E5FF;
    transition: all 0.4s ease;
    text-decoration: none;
}

.radar-blip:hover {
    background: rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.radar-blip.active {
    background: #00E5FF;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.6), 0 0 24px rgba(0, 229, 255, 0.3);
    transform: scale(1.3);
}

/* --- Comic Panels --- */
.comic-panel {
    min-height: 100vh;
    border: 4px solid #0A0A12;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-dark {
    background: #0A0A12;
    color: #E8E2D6;
}

.panel-light {
    background: #E8E2D6;
    color: #0A0A12;
    border-color: #0A0A12;
}

/* --- Ben-Day Dot Overlays --- */
.ben-day-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ben-day-large {
    background: radial-gradient(circle, #FF8FAB 6px, transparent 6px);
    background-size: 28px 28px;
    opacity: 0.25;
}

.ben-day-medium {
    background: radial-gradient(circle, #FF8FAB 4px, transparent 4px);
    background-size: 20px 20px;
    opacity: 0.2;
}

.ben-day-small {
    background: radial-gradient(circle, #FF8FAB 3px, transparent 3px);
    background-size: 16px 16px;
    opacity: 0.25;
}

.ben-day-micro {
    background: radial-gradient(circle, #FF8FAB 2px, transparent 2px);
    background-size: 10px 10px;
    opacity: 0.15;
}

/* --- Marble Planets --- */
.marble-planet {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}

.planet-1 {
    width: 350px;
    height: 350px;
    bottom: -80px;
    right: 10%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(232,226,214,0.6) 0%, transparent 60%),
        conic-gradient(from 45deg at 50% 50%, #C8BDA8 0%, #0A0A12 15%, #C8BDA8 30%, #E8E2D6 45%, #C8BDA8 60%, #0A0A12 75%, #C8BDA8 100%);
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.15);
    animation: planet-drift-1 60s ease-in-out infinite alternate;
}

.planet-2 {
    width: 280px;
    height: 280px;
    bottom: 10%;
    right: -60px;
    background:
        radial-gradient(ellipse at 60% 30%, rgba(232,226,214,0.5) 0%, transparent 55%),
        conic-gradient(from 120deg at 50% 50%, #C8BDA8 0%, #E8E2D6 20%, #0A0A12 35%, #C8BDA8 50%, #E8E2D6 65%, #C8BDA8 80%, #0A0A12 100%);
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.1);
    animation: planet-drift-2 55s ease-in-out infinite alternate;
}

.planet-3 {
    width: 220px;
    height: 220px;
    top: 10%;
    left: -40px;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(232,226,214,0.4) 0%, transparent 50%),
        conic-gradient(from 200deg at 50% 50%, #C8BDA8 0%, #0A0A12 25%, #E8E2D6 40%, #C8BDA8 55%, #0A0A12 70%, #C8BDA8 85%, #E8E2D6 100%);
    box-shadow: 0 0 40px rgba(255, 45, 107, 0.1);
    animation: planet-drift-3 65s ease-in-out infinite alternate;
}

.planet-4 {
    width: 180px;
    height: 180px;
    top: 15%;
    right: 5%;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(232,226,214,0.5) 0%, transparent 60%),
        conic-gradient(from 80deg at 50% 50%, #C8BDA8 0%, #E8E2D6 15%, #C8BDA8 30%, #0A0A12 50%, #C8BDA8 65%, #E8E2D6 80%, #C8BDA8 100%);
    box-shadow: 0 0 35px rgba(255, 159, 28, 0.1);
    animation: planet-drift-4 50s ease-in-out infinite alternate;
}

.planet-5 {
    width: 400px;
    height: 400px;
    bottom: -150px;
    left: -100px;
    background:
        radial-gradient(ellipse at 35% 45%, rgba(232,226,214,0.5) 0%, transparent 55%),
        conic-gradient(from 160deg at 50% 50%, #C8BDA8 0%, #0A0A12 10%, #E8E2D6 25%, #C8BDA8 40%, #0A0A12 55%, #C8BDA8 70%, #E8E2D6 85%, #C8BDA8 100%);
    box-shadow: 0 0 80px rgba(0, 229, 255, 0.12);
    animation: planet-drift-5 70s ease-in-out infinite alternate;
}

@keyframes planet-drift-1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-15px, -20px); }
}

@keyframes planet-drift-2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, -10px); }
}

@keyframes planet-drift-3 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10px, 15px); }
}

@keyframes planet-drift-4 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-12px, 8px); }
}

@keyframes planet-drift-5 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(18px, -12px); }
}

/* --- Panel Content --- */
.panel-content {
    position: relative;
    z-index: 2;
    padding: 80px 100px;
    max-width: 1100px;
    width: 100%;
}

/* --- Typography --- */
.hero-title {
    font-family: 'Bungee', cursive;
    font-size: 8vw;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 0.95;
    text-transform: uppercase;
    color: #FF2D6B;
    text-shadow: 3px 3px 0 #00E5FF;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    color: #0A0A12;
}

.section-title {
    font-family: 'Bungee', cursive;
    font-size: 3.5vw;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 0.95;
    text-transform: uppercase;
    color: #FF2D6B;
    text-shadow: 2px 2px 0 #00E5FF;
    margin-bottom: 32px;
}

.section-title-light {
    color: #FF2D6B;
    text-shadow: 2px 2px 0 #00E5FF;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.01em;
    margin-bottom: 20px;
}

.body-emphasis {
    font-weight: 600;
}

.body-text-light {
    color: #E8E2D6;
}

/* --- Speech Bubble (Panel 1) --- */
.speech-bubble {
    position: relative;
    background: #E8E2D6;
    border: 4px solid #0A0A12;
    border-radius: 40px;
    padding: 60px 50px;
    max-width: 800px;
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.speech-bubble.in-focus {
    transform: scale(1);
    filter: blur(0);
}

.speech-bubble-inner {
    position: relative;
    z-index: 1;
}

.speech-bubble-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #FF8FAB 4px, transparent 4px);
    background-size: 18px 18px;
    opacity: 0.15;
    pointer-events: none;
    border-radius: 36px;
}

.speech-bubble-tail {
    position: absolute;
    bottom: -30px;
    right: 80px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid #0A0A12;
}

.speech-bubble-tail::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: -16px;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 30px solid #E8E2D6;
}

/* --- Diagonal Split (Panel 2) --- */
.diagonal-split {
    position: relative;
}

.diagonal-text {
    max-width: 600px;
    padding: 40px;
    background: rgba(232, 226, 214, 0.95);
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.diagonal-text.in-focus {
    transform: scale(1);
    filter: blur(0);
}

/* --- Timeline Strip (Panel 3) --- */
.timeline-strip {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 60px 0 40px;
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.timeline-strip.in-focus {
    transform: scale(1);
    filter: blur(0);
}

.timeline-line {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #00E5FF, #FF2D6B, #00E5FF, transparent);
}

.waypoint {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.waypoint-node {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0A0A12;
    border: 2px solid #FF2D6B;
    box-shadow: 0 0 12px rgba(255, 45, 107, 0.4);
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.waypoint-node::after {
    content: attr(data-year);
    position: absolute;
    bottom: -8px;
}

.waypoint-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #E8E2D6;
    text-align: center;
    max-width: 120px;
}

.waypoint::before {
    content: attr(data-year);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    margin-bottom: 8px;
}

/* Annotations */
.annotation {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    font-weight: 400;
    color: #FF9F1C;
    margin-top: 10px;
    display: block;
    text-align: center;
}

.annotation-1 { transform: rotate(-2deg); }
.annotation-2 { transform: rotate(3deg); }
.annotation-3 { transform: rotate(-3deg); }

.footnote-marker {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    color: #FF9F1C;
    margin-top: 30px;
    transform: rotate(-1deg);
}

.footnote-sup {
    color: #FF9F1C;
    font-size: 0.8em;
}

/* --- Book Layout (Panel 4) --- */
.book-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 40px;
    position: relative;
}

.book-main {
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.book-main.in-focus {
    transform: scale(1);
    filter: blur(0);
}

.chapter-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, #C8BDA8, transparent);
    margin: 24px 0;
}

/* Margin Notes */
.margin-notes {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 80px;
}

.margin-note {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    font-weight: 400;
    color: #FF9F1C;
    opacity: 0;
    transform: translateX(-20px) rotate(-2deg);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.margin-note.revealed {
    opacity: 1;
    transform: translateX(0) rotate(-2deg);
}

.margin-note-1 { transition-delay: 0ms; }
.margin-note-1.revealed { transform: rotate(-3deg); }
.margin-note-2 { transition-delay: 200ms; }
.margin-note-2.revealed { transform: rotate(2deg); }
.margin-note-3 { transition-delay: 400ms; }
.margin-note-3.revealed { transform: rotate(-1deg); }
.margin-note-4 { transition-delay: 600ms; }
.margin-note-4.revealed { transform: rotate(3deg); }

/* Index Card */
.index-card {
    position: absolute;
    bottom: 40px;
    right: 60px;
    width: 200px;
    padding: 20px;
    background: #E8E2D6;
    border: 1px solid #C8BDA8;
    transform: rotate(4deg);
    box-shadow: 4px 4px 0 #1B0A3C;
}

.index-card-line {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(to right, #C8BDA8 0px, #C8BDA8 4px, transparent 4px, transparent 8px);
    margin-bottom: 18px;
}

.index-card-text {
    font-family: 'Caveat', cursive;
    font-size: 13px;
    color: #FF2D6B;
    transform: rotate(-1deg);
}

/* --- Compass Layout (Panel 5) --- */
.compass-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.compass-rose {
    width: 320px;
    height: 320px;
    margin-bottom: 40px;
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.compass-rose.in-focus {
    transform: scale(1);
    filter: blur(0);
}

.compass-svg {
    width: 100%;
    height: 100%;
}

.compass-label {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.compass-title {
    text-align: center;
}

.compass-text {
    color: #E8E2D6;
    max-width: 600px;
    text-align: center;
    margin: 0 auto 30px;
}

.closing-stamp {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 12px 24px;
    display: inline-block;
}

/* --- Focus Element Defaults --- */
.focus-element {
    transform: scale(0.7);
    filter: blur(4px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease-out;
}

.focus-element.in-focus {
    transform: scale(1);
    filter: blur(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .panel-content {
        padding: 60px 30px;
    }

    .hero-title {
        font-size: 12vw;
    }

    .section-title {
        font-size: 6vw;
    }

    .speech-bubble {
        padding: 30px 25px;
        border-radius: 24px;
    }

    .book-layout {
        grid-template-columns: 1fr;
    }

    .margin-notes {
        padding-top: 20px;
    }

    .index-card {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 30px;
    }

    .timeline-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        padding: 30px 0;
    }

    .timeline-line {
        display: none;
    }

    .waypoint {
        flex-direction: row;
        gap: 16px;
        align-items: center;
    }

    .waypoint-label {
        text-align: left;
        max-width: none;
    }

    .hud-readout-tl,
    .hud-readout-tr {
        font-size: 9px;
    }

    .hud-readout-bl,
    .hud-readout-br {
        font-size: 9px;
    }

    .compass-rose {
        width: 240px;
        height: 240px;
    }

    .diagonal-text {
        clip-path: none;
    }
}
