/* ================================================
   KAFKA THE PSYCHONAUT - Main Styles (index page)
   ================================================ */

:root {
    --bg-primary: #0f0e17;
    --bg: #0f0e17;
    --grid-color: rgba(100, 120, 180, 0.25);
    --text: #fffffe;
    --text-dim: #a7a9be;
    --accent: #ffd54f;
    --accent-red: #ff6b6b;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

/* ================================================
   STARS BACKGROUND
   ================================================ */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.stars-1 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 50px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 120px 30px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 180px 150px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 250px 60px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 320px 180px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 400px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 480px 120px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 550px 200px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 220px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 200px 280px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 350px 250px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 500px 300px, rgba(255,255,255,0.4), transparent);
    background-size: 600px 350px;
}

.stars-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 30px 120px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 100px 200px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 170px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 240px 170px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 310px 90px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 380px 230px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 450px 70px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 520px 160px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 70px 280px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 280px 320px, rgba(255,255,255,0.6), transparent);
    background-size: 550px 380px;
}

.stars-3 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1.5px 1.5px at 80px 100px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 220px 220px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 400px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 150px 300px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 480px 280px, rgba(255,255,255,0.7), transparent);
    background-size: 700px 400px;
}

/* Constellation lines */
.constellations {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.constellation {
    position: absolute;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1;
    fill: none;
}

/* ================================================
   PERSPECTIVE GRID
   ================================================ */
.grid-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    perspective: 400px;
    overflow: hidden;
}

.grid {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(75deg);
    transform-origin: bottom center;
}

/* Gradient fade at horizon */
.horizon-fade {
    position: fixed;
    bottom: 40%;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
    z-index: 1;
}

/* ================================================
   NAVIGATION - Page-specific planet hover effects
   ================================================ */
/* Link hover triggers planet effect */
body:has(.nav-links a[href="music.html"]:hover) .planet-music {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(242, 139, 130, 0.6));
}

body:has(.nav-links a[href*="librenza"]:hover) .planet-poetry {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(240, 226, 184, 0.6));
}

body:has(.nav-links a[href="gallery.html"]:hover) .planet-gallery {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(100, 170, 220, 0.6));
}

body:has(.nav-links a[href="software.html"]:hover) .planet-software {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(126, 203, 195, 0.6));
}

body:has(.nav-links a[href="games.html"]:hover) .planet-games {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(180, 150, 200, 0.6));
}

body:has(.nav-links a[href="about.html"]:hover) .ship {
    filter: drop-shadow(0 0 15px rgba(180, 160, 220, 0.6));
}

/* ================================================
   MAIN CONTENT
   ================================================ */
main {
    position: relative;
    z-index: 10;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 5%;
}

/* ================================================
   PLANETS
   ================================================ */
.planets {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(30px, 7vw, 100px);
}

.planet-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.4s ease;
}

.planet-link:hover {
    transform: translateY(-12px);
}

.planet {
    position: relative;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.planet-music {
    width: clamp(100px, 12vw, 162px);
    height: clamp(100px, 12vw, 162px);
    background: url('images/site/planet-music.webp') center/contain no-repeat;
}

.planet-poetry {
    width: clamp(90px, 10.5vw, 144px);
    height: clamp(90px, 10.5vw, 144px);
    background: url('images/site/planet-poetry.webp') center/contain no-repeat;
}

.planet-gallery {
    width: clamp(90px, 11vw, 150px);
    height: clamp(90px, 11vw, 150px);
    background: url('images/site/planet-gallery.webp') center/contain no-repeat;
}

.planet-software {
    width: clamp(95px, 11vw, 148px);
    height: clamp(95px, 11vw, 148px);
    background: url('images/site/planet-software.webp') center/contain no-repeat;
}

.planet-games {
    width: clamp(90px, 10.5vw, 144px);
    height: clamp(90px, 10.5vw, 144px);
    background: url('images/site/planet-games.webp') center/contain no-repeat;
}

/* Planet labels */
.planet-label {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
}

.planet-link:hover .planet-label {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   SPACESHIP (About link)
   ================================================ */
.ship-link {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    z-index: 50;
}

.ship {
    width: clamp(80px, 10vw, 130px);
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-6px); }
    }
}

.ship-link:hover .ship {
    filter: drop-shadow(0 0 15px rgba(180, 160, 220, 0.6));
}

.ship-label {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ship-link:hover .ship-label {
    opacity: 1;
    transform: translateY(0);
}

body:has(.nav-links a[href="ai.html"]:hover) .planet-deathstar {
    transform: scale(1.075);
    filter: drop-shadow(0 0 15px rgba(180, 156, 222, 0.6));
}

/* ================================================
   FOOTER - Page-specific overrides
   ================================================ */
footer {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    z-index: 100;
    border-top: none;
    padding: 0 24px;
}

/* ================================================
   CHANGELOG POPUP
   ================================================ */
.changelog-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 14, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.changelog-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.changelog-btn svg {
    width: 20px;
    height: 20px;
}

.changelog-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--accent-red, #ff6b6b);
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.changelog-btn .badge:empty {
    display: none;
}

.changelog-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: rgba(15, 14, 23, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.changelog-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.changelog-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.changelog-header h3 svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.changelog-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.changelog-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.changelog-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.changelog-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.changelog-item:last-child {
    border-bottom: none;
}

.changelog-date {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffd54f;
    margin-bottom: 6px;
}

.changelog-text {
    font-size: 13px;
    line-height: 1.5;
}

.changelog-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 13px;
}

/* ================================================
   LANGUAGE SELECTOR - Page-specific position override
   ================================================ */
.language-selector {
    top: 134px;
}

/* ================================================
   RESPONSIVE - TABLET & MOBILE
   ================================================ */
@media (max-width: 768px) {
    /* Mobile carousel layout */
    main {
        flex-direction: column;
    }

    .carousel-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 30px;
    }

    .planets {
        position: relative;
    }

    .planet-link {
        display: none;
        flex-direction: column;
        align-items: center;
    }

    .planet-link:hover {
        transform: none;
    }

    .planet-link.active,
    .ship-carousel-item.active {
        display: flex;
    }

    .planet-music,
    .planet-poetry,
    .planet-gallery,
    .planet-software,
    .planet-games {
        width: clamp(80px, 20vw, 130px);
        height: clamp(80px, 20vw, 130px);
    }

    /* Hide fixed ship on mobile - it's in the carousel */
    .ship-link {
        display: none;
    }

    .language-selector {
        top: 20px;
        left: 16px;
        right: auto;
    }

    .nav-links { display: none; }

    nav {
        justify-content: center;
    }

    .logo {
        text-align: center;
    }

    .planet-label {
        opacity: 1;
        transform: translateY(0);
        font-size: 0.75rem;
        margin-top: 12px;
    }

    .carousel-arrow {
        background: none;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: var(--text-dim);
        font-size: 1.5rem;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-arrow:hover {
        border-color: rgba(255, 255, 255, 0.6);
        color: var(--text);
    }

    /* Dots indicator */
    .carousel-dots {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 30px;
    }

    .carousel-dot {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background 0.3s;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 5px, transparent 5px);
    }

    .carousel-dot.active {
        background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 5px, transparent 5px);
    }

    .carousel-dot:focus-visible {
        outline: 2px solid var(--accent, #ffd54f);
        outline-offset: 2px;
    }
}

@media (max-width: 400px) {
    .changelog-popup {
        width: calc(100vw - 40px);
        right: 20px;
    }
}

/* Hide carousel elements on desktop */
.carousel-arrow, .carousel-dots {
    display: none;
}

.ship-carousel-item {
    display: none;
}

.planet-deathstar {
    width: clamp(90px, 10.5vw, 144px);
    height: clamp(90px, 10.5vw, 144px);
    object-fit: contain;
}

.planet-ship {
    width: clamp(80px, 10vw, 130px);
    height: auto;
    object-fit: contain;
    border-radius: 0;
}

@media (max-width: 768px) {
    .carousel-arrow, .carousel-dots {
        display: flex;
    }
}
