/* --- Basic Setup & Variables --- */
:root {
    --bg-color: #0b0c10;
    --surface-color: #121418;
    --accent-color: #c5a059; /* Muted Gold */
    --accent-hover: #e0b045;
    --text-primary: #e6e6e6;
    --text-secondary: #9aa0a6;
    --border-color: #1f2228;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    
    --container-width: 1400px;
    --header-height: 80px;
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.8;
    font-size: 16px;
    /* Subtle texture */
    background-image: linear-gradient(to bottom, #0b0c10, #111216); 
    -webkit-font-smoothing: antialiased;
}

/* --- IMAGE PROTECTION & SECURITY --- */
img {
    /* Disable user selection and dragging globally */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;

    /* 
       By default, disable pointer events on images.
       This allows clicks to pass through to the container div.
       Context menus triggered on the div will NOT show "Save Image".
    */
    pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 400;
}

/* --- Header & Navigation --- */
.header {
    width: 100%;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    letter-spacing: 1px;
    color: var(--text-primary);
    z-index: 102; /* Above mobile menu */
    position: relative;
}

.nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color var(--transition-speed) ease;
    position: relative;
}

.nav a:hover {
    color: var(--accent-color);
}

/* Underline effect for text links only */
.nav a:not(.nav-icon-link)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed) ease;
}

.nav a:not(.nav-icon-link)::hover::after {
    width: 100%;
}

/* Icon specific styles */
.nav-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

/* --- Mobile Hamburger Menu --- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 102; /* Above overlay */
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
    width: 30px;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before, .hamburger-inner::after {
    width: 30px;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    content: "";
    display: block;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before { top: -10px; }
.hamburger-inner::after { bottom: -10px; }

/* Hamburger Active State (X shape) */
.mobile-menu-toggle.active .hamburger-inner {
    background-color: transparent;
}
.mobile-menu-toggle.active .hamburger-inner::before {
    transform: translateY(10px) rotate(45deg);
}
.mobile-menu-toggle.active .hamburger-inner::after {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Nav Overlay Styles */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 1.5rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(11, 12, 16, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        z-index: 101;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

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

    .nav a {
        font-size: 1.5rem;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Staggered animation for links */
    .nav.active a {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav.active a:nth-child(1) { transition-delay: 0.1s; }
    .nav.active a:nth-child(2) { transition-delay: 0.2s; }
    .nav.active a:nth-child(3) { transition-delay: 0.3s; }
    .nav.active a:nth-child(4) { transition-delay: 0.4s; }
    .nav.active a:nth-child(5) { transition-delay: 0.5s; }

    .nav-icon {
        width: 32px;
        height: 32px;
    }
}

/* --- Layout --- */
main {
    padding: 0 1.5rem;
}

.content-divider {
    width: 100px;
    height: 1px;
    background-color: var(--border-color);
    margin: 4rem auto;
}

.content-section {
    max-width: 900px;
    margin: 0 auto 5rem;
    text-align: center;
}

.content-section h2 {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 300;
}

/* --- Gear Section --- */
.gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.gear-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.gear-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gear-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-right: 1.5rem;
}

.gear-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.gear-item:hover .gear-title {
    color: var(--accent-color);
}

.gear-description {
    font-size: 0.85rem;
    color: #6c7075;
    margin-top: 0.25rem;
    line-height: 1.4;
    font-weight: 300;
}

.gear-icon {
    color: var(--accent-color);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.gear-item:hover .gear-icon {
    opacity: 1;
}

/* --- Stock Portfolio Section --- */
.stock-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    /* Prevent it from getting too wide, helps 2x2 symmetry */
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.stock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    
    /* Flex Sizing: standardizing width for better alignment */
    flex: 1 1 280px; 
    max-width: 400px;
    width: 100%; /* Ensure full width on mobile */
}

.stock-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.stock-name {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.stock-card:hover .stock-name {
    color: var(--accent-color);
}

.stock-link-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* --- Contact Section --- */
.contact-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.contact-link {
    display: inline-block;
    font-size: 1.6rem;
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-style: italic;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-speed) ease;
}

.contact-link:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* --- Hero Carousel --- */
.hero-carousel {
    max-width: var(--container-width);
    margin: 2rem auto 4rem;
    position: relative;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--surface-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: grab;
}

.carousel-track:active {
    cursor: grabbing;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Important for blocking downloads: The slide div captures the click */
    z-index: 1;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-image: inherit;
    filter: blur(30px) brightness(0.4);
    transform: scale(1.1);
    z-index: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
    /* 
       Pointer events are disabled on images globally (above).
       This ensures the user cannot drag/context-click the image element itself.
       Interactions happen on the .carousel-slide container.
    */
}

.carousel-slide img.loaded {
    opacity: 1;
}

.carousel-controls {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.carousel-button {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.carousel-button:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: scale(1.05);
}

.carousel-nav {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 10;
}

.carousel-indicator {
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicator.current-slide {
    background: #fff;
}

/* --- Gallery Grid --- */
.gallery-section {
    width: 100%;
}

.gallery-wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
}

.gallery-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--surface-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0; 
    transform: translateY(20px);
    transition: transform 0.4s ease, filter 0.4s ease, opacity 0.6s ease;
    width: 100%;
    /* Important: Make the container clickable since the image has pointer-events: none */
    cursor: pointer;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    /* pointer-events: none (inherited from global rule) */
}

.gallery-item img.loaded {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Loading Spinner (Shared) */
.loader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Show spinner when parent has loading class or if specific ID is active */
.loading .loader-spinner,
#lightbox-spinner.active {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.status-message {
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
    width: 100%;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.2rem;
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    /* Use solid black to prevent header text bleed-through */
    background-color: #000;
    justify-content: center;
    align-items: center;
    touch-action: none; /* Critical for custom gestures */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0; /* Hidden initially until loaded */
    
    /* 
       OVERRIDE GLOBAL RULE: 
       Lightbox image MUST receive pointer events for gestures (pinch/pan).
       We will block the context menu via JS in lightbox.js instead.
    */
    pointer-events: auto !important; 
}

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

/* When image is loaded inside lightbox, we set opacity to 1 via JS */
.lightbox-content.loaded {
    opacity: 1;
}

/* Lightbox Spinner Specifics */
#lightbox-spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
    z-index: 1001;
}

/* Lightbox Status & Fallback Button */
.lightbox-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    max-width: 400px;
    z-index: 1001;
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    pointer-events: none; /* Let clicks pass through if just showing text */
}

.lightbox-status.active {
    display: flex;
}

.lightbox-message-text {
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.lightbox-action-btn {
    pointer-events: auto; /* Enable clicking */
    display: inline-block;
    padding: 12px 24px;
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: none; /* Hidden until needed */
}

.lightbox-action-btn.active {
    display: inline-block;
}

.lightbox-action-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    color: var(--text-secondary);
    font-size: 3rem;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
    z-index: 1002;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    background-color: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 0 10px;
    display: flex;
    backdrop-filter: blur(5px);
}

.lightbox-controls button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-controls button:hover {
    color: var(--accent-color);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.disclaimer-text {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #555;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .hero-carousel { aspect-ratio: 16 / 9; }
}

@media (max-width: 768px) {
    .hero-carousel {
        aspect-ratio: 4 / 3;
        margin-top: 1rem;
        width: 100%;
        border-radius: 0;
    }
    .content-section h2 { font-size: 2rem; }
    .gear-grid { grid-template-columns: 1fr; }
    /* Stock Section mobile adjustment */
    .stock-grid { 
        max-width: 100%; 
    }
}