/* 
 * PRISM - Premium Portfolio Design 
 * Theme: Dark Luxury (Deep Green, Gold, Noir)
 */

:root {
    --color-bg: #050A08;
    /* Deepest Jungle Green/Black */
    --color-surface: #0B1410;
    --color-surface-glass: rgba(20, 30, 25, 0.6);
    --color-text-primary: #F0F4F2;
    --color-text-secondary: #A0B0A8;
    --color-accent: #D4AF37;
    /* Metallic Gold */
    --color-accent-glow: rgba(212, 175, 55, 0.3);
    --color-highlight: #00A3E0;
    /* Electric Peacock Blue (Subtle) */

    --font-heading: 'Cinzel', serif;
    --font-body: 'Manrope', sans-serif;
    --font-display: 'Playfair Display', serif;

    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Utilities --- */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* --- Navigation (Glassy Pill) --- */
.pill-nav {
    position: fixed;
    top: 2rem;
    /* Floating at top */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 2rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 50%;
}

/* --- Intro Section --- */
.intro-section {
    padding: 10rem 5%;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    text-align: center;
}

.intro-content {
    max-width: 800px;
}

.intro-content .eyebrow {
    display: block;
    color: var(--color-accent);
    font-family: var(--font-heading);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.intro-content h2 {
    font-size: 3.5rem;
    font-family: var(--font-display);
    margin-bottom: 2rem;
    color: #fff;
}

.intro-content .separator {
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--color-accent), transparent);
    margin: 0 auto 2.5rem;
}

.intro-content p {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* --- Finale Section --- */
.finale-section {
    padding: 10rem 5%;
    background: linear-gradient(to top, #000, var(--color-bg));
    text-align: center;
    position: relative;
    overflow: hidden;
    contain: content;
    /* PERFORMANCE WIN */
}

.finale-content h2 {
    font-size: 4rem;
    font-family: var(--font-display);
    margin-bottom: 2rem;
    color: #fff;
}

.finale-content .highlight {
    font-family: var(--font-heading);
    color: transparent;
    -webkit-text-stroke: 1px var(--color-accent);
    font-style: italic;
    font-weight: 400;
}

.finale-content p {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 4rem;
    line-height: 1.6;
}

.finale-btn {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    background: var(--color-accent);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 2px;
    /* Sharp luxury edge */
    transition: var(--transition);
}

.finale-btn:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.7) contrast(1.1);
    backface-visibility: hidden;
    will-change: transform;
}

/* ... */

.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.6;
    mix-blend-mode: overlay;
    backface-visibility: hidden;
    will-change: opacity;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(5, 10, 8, 0.4) 0%,
            rgba(5, 10, 8, 0.1) 50%,
            var(--color-bg) 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 1rem;
    animation: fadeUp 1.2s ease-out forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.hero-title .highlight {
    display: block;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--color-accent);
    text-shadow: 0 0 20px var(--color-accent-glow);
    font-size: 3.5rem;
    margin-top: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-block;
    padding: 1rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
}

.hero-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
    z-index: 2;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #fff, transparent);
}

/* --- Gallery Section --- */
.gallery-section {
    position: relative;
    padding: 8rem 5%;
    background: var(--color-bg);
    z-index: 2;
    contain: content;
    /* PERFORMANCE WIN: Skips rendering off-screen content */
}

.section-header {
    text-align: center;
    margin-bottom: 6rem;
}

.section-header h2 {
    font-size: 3rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.section-header .separator {
    width: 60px;
    height: 2px;
    background: var(--color-accent);
    margin: 0 auto 1.5rem;
}

.section-header p {
    color: var(--color-text-secondary);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2rem;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 10rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.bird-card {
    display: flex;
    align-items: center;
    gap: 4rem;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    transition: none;
    cursor: default;
}

.bird-card:nth-child(even) {
    flex-direction: row-reverse;
}

/* Remove hover lift effects since it's a layout now */
.bird-card:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.card-image {
    width: 60%;
    height: 600px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* Add a gold border frame effect to images */
.card-image::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    pointer-events: none;
    transition: var(--transition);
}

.bird-card:hover .card-image::after {
    border-color: var(--color-accent);
    transform: scale(0.95);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: saturate(0.9) brightness(0.9);
}

.bird-card:hover .card-image img {
    transform: scale(1.1);
    filter: saturate(1.1) brightness(1.05);
}

.card-content {
    width: 40%;
    padding: 0;
    position: relative;
    text-align: left;
}

/* Align text based on alternation if desired, or keep left */
.bird-card:nth-child(even) .card-content {
    text-align: right;
}

.species-code {
    display: block;
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Add a decorative line to species code */
.species-code::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--color-accent);
    vertical-align: middle;
    margin-right: 1rem;
}

.bird-card:nth-child(even) .species-code::before {
    display: none;
}

.bird-card:nth-child(even) .species-code::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--color-accent);
    vertical-align: middle;
    margin-left: 1rem;
}


.card-content h3 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #fff;
    font-family: var(--font-display);
}

.card-content p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 90%;
}

.bird-card:nth-child(even) .card-content p {
    margin-left: auto;
}

/* --- Reveal Footer Implementation --- */
.page-content {
    position: relative;
    z-index: 2;
    /* Sits above footer */
    background: var(--color-bg);
    /* Opaque background to hide footer until end */
    margin-bottom: 400px;
    /* Must match footer height */
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    /* Shadow to separate from footer */
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 400px;
    /* Fixed height for reveal */
    z-index: 1;
    /* Sits behind content */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #030605;
    /* Slightly darker than main bg */
    color: var(--color-text-secondary);
    padding: 2rem 5%;
}

.footer-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle separator div inside if needed */
    padding-top: 2rem;
}

.footer-col {
    flex: 1;
}

.footer-col.center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-col.right {
    text-align: right;
}

.footer h4 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.5;
}

.footer-link {
    display: block;
    color: #fff;
    font-size: 1.2rem;
    font-family: var(--font-display);
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--color-accent);
    transform: translateX(5px);
}

.footer-col.right .footer-link:hover {
    transform: translateX(-5px);
}

.footer-logo {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    background: linear-gradient(to right, #fff, var(--color-text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer p {
    font-size: 0.8rem;
    line-height: 1.6;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer .copyright {
    margin-top: 1rem;
    font-size: 0.7rem;
}

/* Reduce margin on smaller screens */
@media (max-width: 768px) {
    .page-content {
        margin-bottom: 600px;
        /* Taller footer on mobile */
    }

    .footer {
        height: 600px;
        align-items: flex-start;
        padding-top: 4rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-col.right {
        text-align: center;
    }
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.fade-up-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {

    .bird-card,
    .bird-card:nth-child(even) {
        flex-direction: column;
        gap: 2rem;
    }

    .card-image {
        width: 100%;
        height: 500px;
    }

    .card-content,
    .bird-card:nth-child(even) .card-content {
        width: 100%;
        text-align: center;
        padding: 0 1rem;
    }

    .bird-card:nth-child(even) .card-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .species-code::before,
    .bird-card:nth-child(even) .species-code::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .pill-nav {
        width: 90%;
        justify-content: space-between;
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.7rem;
        letter-spacing: 0.05em;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-title .highlight {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 6rem;
    }

    .card-content h3 {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero-title .highlight {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .card-image {
        height: 350px;
    }

    .finale-content h2 {
        font-size: 2.5rem;
    }
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

.preloader.hidden {
    transform: translateY(-100%);
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-accent);
    letter-spacing: 0.5em;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.loader-line {
    width: 0;
    height: 1px;
    background: var(--color-text-primary);
    animation: loadLine 1.5s ease-in-out forwards;
}

@keyframes loadLine {
    0% {
        width: 0;
    }

    100% {
        width: 200px;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* --- Custom Cursor --- */
.cursor,
.cursor-follower {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, opacity 0.3s;
    mix-blend-mode: difference;
}

.cursor {
    width: 8px;
    height: 8px;
    background: #fff;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.15s, top 0.1s, left 0.1s;
}

.cursor.hovered {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.5;
}

.cursor-follower.hovered {
    transform: translate(-50%, -50%) scale(1.5);
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

/* --- Ultra-Premium: UV Vision Simulator --- */
.nav-btn {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--color-accent);
    color: #000;
    box-shadow: 0 0 15px var(--color-accent-glow);
}

/* UV Active State */
body.uv-active {
    --color-bg: #000;
    --color-text-primary: #D1FF00;
    /* Neon Lime */
    --color-accent: #FF00FF;
    /* Neon Magenta */
}

body.uv-active .hero-video {
    filter: invert(1) hue-rotate(180deg) saturate(3);
}

body.uv-active img {
    filter: invert(1) hue-rotate(200deg) contrast(1.5) saturate(2);
    box-shadow: 0 0 20px rgba(209, 255, 0, 0.5);
}

body.uv-active .tech-meta,
body.uv-active .coordinates {
    color: #00FFFF;
    /* Cyan */
    text-shadow: 0 0 5px #00FFFF;
}

/* FIX: Ensure hover doesn't break UV mode */
body.uv-active .bird-card:hover .card-image img {
    filter: invert(1) hue-rotate(200deg) contrast(1.5) saturate(3) !important;
    box-shadow: 0 0 30px rgba(209, 255, 0, 0.8);
}

/* Scanline Effect for UV Mode */
body.uv-active::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    animation: scanlines 0.2s linear infinite;
}

/* --- Ultra-Premium: 3D Tilt --- */
.bird-card {
    perspective: 1000px;
    /* Enable 3D space */
    transform-style: preserve-3d;
}

.card-image,
.card-content {
    transition: transform 0.1s ease-out;
    /* Smooth but fast return */
    transform-style: preserve-3d;
    /* Keep children 3D */
}

/* Z-Depth for elements to pop during tilt */
.card-image img {
    transform: translateZ(0px);
    /* Base */
}

.tech-tag,
.tech-crosshair {
    transform: translateZ(40px);
    /* Pop out */
}

.card-content h3 {
    transform: translateZ(30px);
}

/* --- Premium Complexity: Film Grain --- */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.6;
    mix-blend-mode: overlay;
    backface-visibility: hidden;
    will-change: opacity;
    /* Optimizes for the opacity fade if any, or just composition */
    transform: translateZ(0);
    /* Force GPU */
}

/* --- Premium Complexity: Tech Decorators --- */
.hero-decorators {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tech-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
}

.vertical-left {
    left: 10%;
    top: 0;
    bottom: 0;
    width: 1px;
}

.vertical-right {
    right: 10%;
    top: 0;
    bottom: 0;
    width: 1px;
}

.coordinates {
    position: absolute;
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--color-accent);
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.top-right {
    top: 5rem;
    right: 12%;
}

.bottom-left {
    bottom: 5rem;
    left: 12%;
}

/* Bird Card Tech Details */
.tech-crosshair {
    position: absolute;
    width: 20px;
    height: 20px;
    border-top: 1px solid var(--color-accent);
    border-right: 1px solid var(--color-accent);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bird-card:hover .tech-crosshair {
    opacity: 1;
}

.tech-tag {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-family: monospace;
    font-size: 0.7rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
}

.tech-meta {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    opacity: 0.6;
    letter-spacing: 0.1em;
    display: block;
}

@media (hover: none) {

    .cursor,
    .cursor-follower {
        display: none;
    }
}