/* shared.css - Kafka the Psychonaut - Common styles */

/* ---- Variable Defaults (pages override in inline :root) ---- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d4;
    --accent: #06ffa5;

    /* Aliases for pages using short variable names */
    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --text-dim: var(--text-secondary);
}

/* ---- Global Resets ---- */
html {
    overflow-y: scroll;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--bg-primary);
    color: var(--accent);
    border: 2px solid var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.skip-to-content:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
}

a:focus:not(:focus-visible), button:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Navigation ---- */
nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 150;
    line-height: normal;
}

.logo {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.logo:hover { opacity: 1; }

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }

/* ---- Language Selector ---- */
.language-selector {
    position: absolute;
    top: 80px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
}

.lang-btn {
    width: 44px;
    min-height: 44px;
    border-radius: 6px;
    background: rgba(15, 14, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #c5c7d9;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    order: -1;
}

/* Desktop: collapsed by default, expand on hover */
.language-selector .lang-btn:not(.active) {
    display: none;
}

@media (hover: hover) {
    .language-selector:hover .lang-btn {
        display: block;
    }
}

/* ---- Accessibility ---- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Parallax Performance ---- */
.stars > div, #stars > div {
    will-change: transform;
}

/* ---- Projects Sub-Navigation ---- */
.projects-nav {
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 101;
    padding: 0 20px;
}

.projects-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 24px;
    padding: 4px 0;
}

.project-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.project-nav-link:hover,
.project-nav-link.active {
    color: var(--accent);
}

/* ---- Explore More Projects ---- */
.explore-more {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.explore-more h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 2px;
}

.explore-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.explore-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s ease;
    aspect-ratio: 16/10;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.explore-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.explore-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
    transition: background 0.4s ease;
}

.explore-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
}

.explore-card h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.explore-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.9;
}

.explore-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.explore-card:hover .explore-card-image {
    transform: scale(1.1);
}

.explore-card:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 100%);
}

.explore-card:focus-visible {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.explore-card:focus-visible .explore-card-image {
    transform: scale(1.1);
}

.explore-card:focus-visible::before {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 100%);
}

/* ---- Support CTA ---- */
.support-cta {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.support-cta h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.support-cta p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.kofi-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--accent-cyan, #06ffa5);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.kofi-button:hover {
    background: var(--accent-pink, #E75480);
    color: var(--text-primary);
}

.kofi-button:focus-visible {
    background: var(--accent-pink, #E75480);
    color: var(--text-primary);
}

/* ---- Disco Carousel ---- */
.disco-carousel {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 50px;
    overflow: hidden;
}

.disco-carousel-track-wrapper {
    overflow: hidden;
}

.disco-carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.disco-carousel .disco-card {
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.disco-carousel-prev,
.disco-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.disco-carousel-prev:hover,
.disco-carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    color: var(--accent);
}

.disco-carousel-prev { left: 0; }
.disco-carousel-next { right: 0; }

.disco-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.disco-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0;
}

.disco-carousel-dot.active {
    background: var(--accent);
}

@media (max-width: 768px) {
    .disco-carousel {
        padding: 0 36px;
    }
    .disco-carousel-prev,
    .disco-carousel-next {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

/* ---- Band Gallery Carousel ---- */
.band-gallery-carousel {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 50px;
}

.band-gallery-viewport {
    overflow: hidden;
}

.band-gallery-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s ease;
}

.band-gallery-track.centered {
    justify-content: center;
}

.band-gallery-track img {
    width: calc(50% - 8px);
    flex-shrink: 0;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s ease;
    cursor: pointer;
    display: block;
}

.band-gallery-track img:hover {
    border-color: var(--accent);
}

.band-gallery-prev,
.band-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.band-gallery-prev:hover,
.band-gallery-next:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    color: var(--accent);
}

.band-gallery-prev { left: 0; }
.band-gallery-next { right: 0; }

@media (max-width: 768px) {
    .band-gallery-carousel {
        padding: 0 40px;
    }
    .band-gallery-track img {
        width: 100%;
    }
}

/* ---- Album Links (under release date) ---- */
.disco-album-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.disco-album-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 0;
}

.disco-album-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---- Platform Links (Connect section) ---- */
.platform-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 0;
}

.platform-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.disco-album-links a svg,
.platform-links a svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.platform-links a svg {
    width: 20px;
    height: 20px;
}

.disco-album-links a[aria-label*="Spotify"] svg,
.platform-links a[aria-label*="Spotify"] svg {
    width: 20px;
    height: 20px;
}

.disco-album-links a[aria-label*="Apple Music"] svg,
.platform-links a[aria-label*="Apple Music"] svg,
.disco-album-links a[aria-label*="Amazon Music"] svg,
.platform-links a[aria-label*="Amazon Music"] svg {
    width: 17px;
    height: 17px;
}

.disco-album-links a[aria-label*="YouTube Music"] svg,
.platform-links a[aria-label*="YouTube Music"] svg {
    width: 19px;
    height: 19px;
}

.disco-album-links a[aria-label*="Deezer"] svg,
.platform-links a[aria-label*="Deezer"] svg {
    width: 18px;
    height: 14px;
}

/* ---- Back to Top ---- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
    background: rgba(10, 10, 15, 0.9);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    background: var(--accent);
}

.back-to-top::before {
    content: '\2191';
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    color: var(--accent);
    transition: color 0.3s ease;
}

.back-to-top:hover::before {
    color: var(--bg-primary);
}

.back-to-top:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    background: var(--accent);
}

.back-to-top:focus-visible::before {
    color: var(--bg-primary);
}

/* ---- Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container.zoomed {
    cursor: crosshair;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.15s ease;
}

.lightbox-image-container.zoomed .lightbox-image {
    transition: none;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
    opacity: 0.6;
    transition: opacity 0.3s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    color: var(--accent);
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    z-index: 2001;
    letter-spacing: 2px;
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 2001;
    text-align: center;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }

    .lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }

    .lightbox-image-container {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* ---- Footer ---- */
footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.footer-social a {
    color: #b8b5c9;
    transition: color 0.3s, transform 0.3s;
}

.footer-social a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.footer-text {
    color: #b8b5c9;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ---- Common Animations ---- */
@keyframes fadeInPage {
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Hamburger Menu ---- */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
    position: absolute;
    right: 20px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    border: 0 solid var(--text-primary);
    border-radius: 0;
    transition: all 0.3s ease;
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    margin: 0;
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
    opacity: 0;
    height: 0;
    margin: 0;
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
    opacity: 0;
    height: 0;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    nav {
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 65px;
        right: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 20px 30px;
        gap: 16px;
        border-radius: 0 0 0 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-top: none;
        z-index: 1001;
        min-width: 200px;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .hamburger-btn {
        top: 20px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .language-selector {
        top: 20px;
        left: 16px;
        right: auto;
    }

    .language-selector .lang-btn {
        display: none;
        min-height: 44px;
        font-size: 12px;
    }

    .language-selector .lang-btn.active {
        display: block;
        order: -1;
    }

    .language-selector.lang-expanded .lang-btn {
        display: block;
    }

    .footer-social a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .projects-nav {
        top: 57px;
    }

    .projects-nav-inner {
        gap: 4px 16px;
    }

    .project-nav-link {
        font-size: 0.75rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

}

@media (max-width: 900px) {
    .explore-more-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .explore-more-grid {
        grid-template-columns: 1fr;
    }
}
