/* ===================================
   CSS VARIABLES
   =================================== */
:root {
    /* Colors - Palette */
    --color-bg-primary: #0D1B2A;
    --color-bg-secondary: #1A1A2E;
    --color-accent-cold: #40E0D0;
    --color-accent-warm: #E67E22;
    --color-bridge: #9B59B6;
    --color-text-primary: #F8F9FA;
    --color-text-secondary: #B8C5D6;

    /* Gradients */
    --gradient-cosmic: linear-gradient(135deg, #40E0D0, #9B59B6, #E67E22);
    --gradient-cold: linear-gradient(135deg, #40E0D0, #9B59B6);
    --gradient-warm: linear-gradient(135deg, #9B59B6, #E67E22);

    /* Typography */
    --font-heading: 'Bodoni Moda', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-accent: 'Italiana', serif;
    --font-code: 'JetBrains Mono', monospace;

    /* Font Sizes - Mobile First */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.25rem;
    --fs-lg: 1.5rem;
    --fs-xl: 2rem;
    --fs-2xl: 3rem;
    --fs-3xl: 4rem;
    --fs-4xl: 6rem;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Layout */
    --max-width: 1200px;
    --header-height: 80px;

    /* Animation */
    --transition-fast: 0.2s ease-out;
    --transition-smooth: 0.3s ease-out;
    --transition-slow: 0.6s ease-in-out;

    /* Shadows */
    --shadow-glow-cold: 0 0 30px rgba(64, 224, 208, 0.4);
    --shadow-glow-warm: 0 0 30px rgba(230, 126, 34, 0.4);

    /* Z-index layers */
    --z-stars: 0;
    --z-content: 1;
    --z-header: 100;
    --z-lightbox: 1000;
}

/* ===================================
   RESET & BASE
   =================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-accent-cold);
    color: var(--color-bg-primary);
    z-index: calc(var(--z-header) + 1);
    transition: top var(--transition-fast);
    border-radius: 4px;
    font-weight: 600;
}

.skip-link:focus {
    top: var(--space-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ===================================
   KEYFRAME ANIMATIONS
   =================================== */

/* Float animation for hero elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Star twinkle effect */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Cold glow pulse (turquoise) */
@keyframes glow-cold {
    0%, 100% {
        box-shadow: 0 0 20px rgba(64, 224, 208, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(64, 224, 208, 0.5);
    }
}

/* Warm glow pulse (orange) */
@keyframes glow-warm {
    0%, 100% {
        box-shadow: 0 0 20px rgba(230, 126, 34, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(230, 126, 34, 0.5);
    }
}

/* Slow rotation for decorations */
@keyframes rotate-slow {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Fade in */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade in up */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   STARS BACKGROUND
   =================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-stars);
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--color-text-primary);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

/* ===================================
   HEADER / NAVIGATION
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: var(--z-header);
    background: linear-gradient(
        to bottom,
        rgba(13, 27, 42, 0.95),
        rgba(13, 27, 42, 0)
    );
    padding: 0 var(--space-md);
    transition: background var(--transition-smooth);
}

.header--scrolled {
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(10px);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
}

.nav__logo {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 700;
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav__list {
    display: flex;
    gap: var(--space-md);
}

.nav__link {
    font-family: var(--font-accent);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-cosmic);
    transition: width var(--transition-smooth);
}

.nav__link:hover,
.nav__link:focus {
    color: var(--color-text-primary);
}

.nav__link:hover::after,
.nav__link:focus::after {
    width: 100%;
}

/* ===================================
   SECTIONS (General)
   =================================== */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
    position: relative;
    z-index: var(--z-content);
}

/* ===================================
   HERO SECTION
   =================================== */
.section--hero {
    flex-direction: column;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(64, 224, 208, 0.06), transparent 55%),
        var(--color-bg-primary);
}

.hero__content {
    position: relative;
    z-index: 2;
}

.hero__title {
    display: flex;
    flex-direction: column;
}

.hero__name {
    font-family: var(--font-code);
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--color-text-primary);
    text-shadow: 0 0 60px rgba(64, 224, 208, 0.25);
    animation: fade-in 1s ease-out;
}

.hero__subtitle {
    font-family: var(--font-accent);
    font-size: var(--fs-md);
    color: var(--color-text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: var(--space-xs);
    animation: fade-in 1s ease-out 0.3s backwards;
}

.hero__tagline {
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    font-style: italic;
    color: var(--color-text-secondary);
    margin-top: var(--space-lg);
    animation: fade-in 1s ease-out 0.6s backwards;
}

.hero__cta {
    display: inline-block;
    margin-top: var(--space-xl);
    animation: float 3s ease-in-out infinite;
}

.hero__arrow {
    font-size: var(--fs-xl);
    color: var(--color-accent-cold);
    transition: color var(--transition-fast);
}

.hero__cta:hover .hero__arrow,
.hero__cta:focus .hero__arrow {
    color: var(--color-accent-warm);
}

.hero__decoration {
    display: none;
}

.hero__decoration::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border: 1px solid rgba(155, 89, 182, 0.15);
    border-radius: 50%;
}

.hero__decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border: 1px solid rgba(230, 126, 34, 0.1);
    border-radius: 50%;
}

/* ===================================
   GALLERY SECTION
   =================================== */
.section--gallery {
    flex-direction: column;
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-lg)) var(--space-md) var(--space-lg);
    background: var(--color-bg-secondary);
}

.gallery__title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-lg);
    text-align: center;
}

/* ===================================
   GALLERY GRID
   =================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    max-width: var(--max-width);
    width: 100%;
}

.artwork-card {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity var(--transition-slow),
        transform var(--transition-slow);
}

.artwork-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.artwork-card__figure {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin: 0;
}

.artwork-card__image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    cursor: zoom-in;
    transition:
        transform var(--transition-smooth),
        filter var(--transition-smooth);
}

.artwork-card:hover .artwork-card__image {
    transform: scale(1.05);
}

.artwork-card__figure::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(13, 27, 42, 0.8) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none; /* Fix: allow clicks through overlay */
}

.artwork-card:hover .artwork-card__figure::after {
    opacity: 1;
}

.artwork-card__number {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity var(--transition-smooth),
        transform var(--transition-smooth);
}

.artwork-card:hover .artwork-card__number {
    opacity: 1;
    transform: translateY(0);
}

/* Alternating glow colors */
.artwork-card:nth-child(odd) .artwork-card__figure {
    box-shadow: 0 0 0 rgba(64, 224, 208, 0);
    transition: box-shadow var(--transition-smooth);
}

.artwork-card:nth-child(odd):hover .artwork-card__figure {
    box-shadow: 0 0 30px rgba(64, 224, 208, 0.4);
}

.artwork-card:nth-child(even) .artwork-card__figure {
    box-shadow: 0 0 0 rgba(230, 126, 34, 0);
    transition: box-shadow var(--transition-smooth);
}

.artwork-card:nth-child(even):hover .artwork-card__figure {
    box-shadow: 0 0 30px rgba(230, 126, 34, 0.4);
}

/* ===================================
   ABOUT SECTION
   =================================== */
.section--about {
    background:
        radial-gradient(ellipse at center, rgba(155, 89, 182, 0.1), transparent 60%),
        var(--color-bg-primary);
    text-align: center;
}

.about__content {
    max-width: 600px;
    opacity: 0;
    transform: translateY(60px);
    transition:
        opacity var(--transition-slow),
        transform var(--transition-slow);
}

.about__content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.about__title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
}

.about__text {
    font-size: var(--fs-md);
    line-height: 1.8;
    color: var(--color-text-secondary);
}

/* ===================================
   CONTACT SECTION
   =================================== */
.section--contact {
    background: var(--color-bg-secondary);
    text-align: center;
}

.contact__content {
    max-width: 600px;
    opacity: 0;
    transform: translateY(60px);
    transition:
        opacity var(--transition-slow),
        transform var(--transition-slow);
}

.contact__content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.contact__title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
}

.contact__text {
    font-size: var(--fs-md);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.contact__email {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: var(--fs-lg);
    color: var(--color-accent-cold);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-accent-cold);
    border-radius: 4px;
    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.contact__email:hover,
.contact__email:focus {
    background: var(--color-accent-cold);
    color: var(--color-bg-primary);
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    padding: var(--space-md);
    text-align: center;
    background: var(--color-bg-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__text {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

/* ===================================
   LIGHTBOX - Epic Animation
   =================================== */

/* Lightbox open animation */
@keyframes lightbox-backdrop-in {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

@keyframes lightbox-image-in {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-5deg);
        filter: blur(20px);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
}

@keyframes lightbox-glow-pulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(64, 224, 208, 0.3),
            0 0 60px rgba(155, 89, 182, 0.2),
            0 0 90px rgba(230, 126, 34, 0.1);
    }
    50% {
        box-shadow:
            0 0 50px rgba(64, 224, 208, 0.5),
            0 0 100px rgba(155, 89, 182, 0.3),
            0 0 150px rgba(230, 126, 34, 0.2);
    }
}

@keyframes lightbox-close-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(90deg);
    }
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 42, 0.85);
    backdrop-filter: blur(0px);
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.4s ease-out,
        visibility 0.4s ease-out,
        backdrop-filter 0.6s ease-out;
    cursor: zoom-out;
}

.lightbox[aria-hidden="false"],
.lightbox:not([hidden]) {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(20px);
    animation: lightbox-backdrop-in 0.5s ease-out;
}

.lightbox__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 56px;
    height: 56px;
    background: rgba(13, 27, 42, 0.8);
    border: 2px solid var(--color-text-secondary);
    border-radius: 50%;
    color: var(--color-text-primary);
    font-size: var(--fs-xl);
    cursor: pointer;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
    z-index: 10;
}

.lightbox__close:hover,
.lightbox__close:focus {
    border-color: var(--color-accent-cold);
    color: var(--color-accent-cold);
    transform: rotate(90deg) scale(1.1);
    box-shadow:
        0 0 20px rgba(64, 224, 208, 0.5),
        inset 0 0 20px rgba(64, 224, 208, 0.1);
}

.lightbox__image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    cursor: default;
    /* Initial state for animation */
    opacity: 0;
    transform: scale(0.3);
    filter: blur(20px);
    box-shadow:
        0 0 30px rgba(64, 224, 208, 0.3),
        0 0 60px rgba(155, 89, 182, 0.2),
        0 0 90px rgba(230, 126, 34, 0.1);
}

.lightbox:not([hidden]) .lightbox__image {
    animation:
        lightbox-image-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        lightbox-glow-pulse 3s ease-in-out 0.6s infinite;
}

/* Navigation hint on hover */
.lightbox::before {
    content: 'Kliknij aby zamknac';
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-accent);
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lightbox:not([hidden]):hover::before {
    opacity: 0.6;
}

/* ===================================
   RESPONSIVE - TABLET (576px+)
   =================================== */
@media (min-width: 576px) {
    :root {
        --fs-3xl: 5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

/* ===================================
   RESPONSIVE - TABLET LANDSCAPE (768px+)
   =================================== */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }
}

/* ===================================
   RESPONSIVE - DESKTOP (992px+)
   =================================== */
@media (min-width: 992px) {
    :root {
        --fs-3xl: 6rem;
        --fs-2xl: 4rem;
    }

    .section {
        padding: var(--space-xl);
    }

    .section--gallery {
        padding: calc(var(--header-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================================
   RESPONSIVE - LARGE (1200px+)
   =================================== */
@media (min-width: 1200px) {
    :root {
        --fs-4xl: 8rem;
    }

    .hero__name {
        font-size: var(--fs-4xl);
    }

    .hero__decoration {
        width: 500px;
        height: 500px;
    }

    .hero__decoration::before {
        width: 400px;
        height: 400px;
    }

    .hero__decoration::after {
        width: 600px;
        height: 600px;
    }
}
