/* ============================================
   LEGENDS OF ANDOLIN - CUSTOM STYLES
   ============================================ */

/* === BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    background-color: #001a2b;
}

/* === HERO BACKGROUND === */
.hero-bg {
    width: 100%;
    height: 100%;
    background-image: url('assets/images/art/hero_valenna_v3.jpg?v=7');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transform-origin: center top;
    animation: kenBurns 30s ease-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1.0);
    }

    100% {
        transform: scale(1.15);
    }
}

/* === MIST ANIMATION === */
.mist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('https://raw.githubusercontent.com/danielstuart14/CSS_FOG_ANIMATION/master/fog1.png') repeat-x;
    background-size: 50% 100%;
    opacity: 0.4;
    animation: drift 60s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* === PARTICLES === */
.particles-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 0 5px #d4af37;
    animation: floatUp var(--duration, 10s) linear infinite;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
        transform: translateY(80vh) scale(1.2);
    }

    100% {
        transform: translateY(-10vh) scale(0.5);
        opacity: 0;
    }
}

/* === NAVIGATION BAR === */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    transition: all 0.4s ease;
    border-bottom: 1px solid transparent;
}

.nav-bar.scrolled {
    padding: 1rem 2rem;
    background: rgba(0, 26, 43, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-bar.hovered {
    background: rgba(0, 26, 43, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-link {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    color: white;
    margin-left: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    position: relative;
    opacity: 0.8;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    color: #d4af37;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: #d4af37;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* === PAGE HEADERS === */
.page-header {
    height: 60vh;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-bg-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7) sepia(0.2);
    transform: scale(1.1);
    animation: slowPan 30s ease-in-out infinite alternate;
}

@keyframes slowPan {
    from {
        transform: scale(1.1) translateY(0);
    }

    to {
        transform: scale(1.15) translateY(-20px);
    }
}

/* === GLASSMORPHISM PANEL === */
.glass-panel {
    background: rgba(0, 51, 78, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* === CTA BUTTON === */
.cta-button {
    position: relative;
    padding: 1rem 3rem;
    font-family: 'Cinzel', serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #00334e;
    background: linear-gradient(135deg, #d4af37 0%, #f4d47d 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px 0 rgba(212, 175, 55, 0.4);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px 0 rgba(212, 175, 55, 0.6);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* === BOOK CARDS === */
.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-cover-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.book-cover-wrapper:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
}

.book-cover-wrapper:hover::before {
    opacity: 1;
}

.book-cover {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.book-info {
    padding: 0 1rem;
}

/* === BUY BUTTON === */
.buy-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #00334e;
    background: linear-gradient(135deg, #d4af37 0%, #f4d47d 100%);
    border: 2px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.buy-button:hover {
    background: transparent;
    border-color: #d4af37;
    color: #d4af37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.buy-button:active {
    transform: translateY(0);
}

/* === SUBSCRIBE BUTTON === */
.subscribe-button {
    padding: 0.75rem 2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #00334e;
    background: linear-gradient(135deg, #d4af37 0%, #f4d47d 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    white-space: nowrap;
}

.subscribe-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.subscribe-button:active {
    transform: translateY(0);
}

/* === SCROLL REVEAL ANIMATIONS === */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === HERO ANIMATIONS === */
.animate-fade-in {
    animation: fadeIn 1.2s ease-out forwards;
}

.animate-fade-in-delay-1 {
    opacity: 0;
    animation: fadeIn 1.2s ease-out 0.3s forwards;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 1.2s ease-out 0.6s forwards;
}

.animate-fade-in-delay-3 {
    opacity: 0;
    animation: fadeIn 1.2s ease-out 0.9s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === TEXT EFFECTS === */
h1,
h2,
h3 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

/* === RESPONSIVE TYPOGRAPHY === */
@media (max-width: 768px) {
    .cta-button {
        font-size: 1rem;
        padding: 0.875rem 2rem;
    }

    .nav-bar {
        padding: 0.5rem 1rem;
    }

    .book-cover-wrapper {
        max-width: 280px;
    }

    .hero-bg {
        background-image: url('assets/images/art/hero_valenna_mobile.jpg?v=1');
        background-attachment: scroll;
        background-position: center top;
    }
}

@media (max-width: 640px) {
    .hero-bg {
        background-attachment: scroll;
    }
}

/* === FOOTER STYLING === */
.site-footer {
    background-image: url('assets/images/art/paintinglandscapewithship.jpg');
    background-size: cover;
    background-position: center bottom;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 26, 43, 0.9);
    /* Deep ocean overlay */
    z-index: 0;
}

.site-footer>* {
    position: relative;
    z-index: 1;
}

/* === AUDIO PLAYER STYLING === */
#audio-player {
    transition: all 0.3s ease;
}

#audio-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

/* === SMOOTH TRANSITIONS === */
a,
button {
    transition: all 0.3s ease;
}

/* === SELECTION STYLING === */
::selection {
    background-color: #d4af37;
    color: #00334e;
}

::-moz-selection {
    background-color: #d4af37;
    color: #00334e;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #001a2b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00334e 0%, #d4af37 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37 0%, #f4d47d 100%);
}

/* === LOADING OPTIMIZATION === */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* === ACCESSIBILITY === */
.focus-visible:focus {
    outline: 2px solid #d4af37;
    outline-offset: 4px;
}

/* === PRINT STYLES === */
@media print {
    .hero-bg {
        display: none;
    }

    #audio-player {
        display: none;
    }
}

/* === LIGHTBOX STYLES === */
.lightbox {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 26, 43, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #d4af37;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #f4d47d;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.lightbox-trigger {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lightbox-trigger:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}