:root {
    --bg-white: #FFFFFF;
    --navy: #0A2342;
    --yellow: #FFC300;
    --charcoal: #1A1A1A;
}

/* --- GLOBAL RESETS & MOBILE SAFETY --- */
* {
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

body {
    background-color: var(--bg-white);
    color: var(--charcoal);
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
    font-family: 'DM Serif Display', serif;
}

/* --- ENTRANCE TRANSITION --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--navy);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

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

.preloader-logo {
    color: white;
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards 0.3s;
}

@media (min-width: 768px) {
    .preloader-logo { font-size: 3rem; }
}

.preloader-line {
    width: 0;
    height: 4px;
    background-color: var(--yellow);
    margin-top: 1rem;
    animation: growLine 1s cubic-bezier(0.19, 1, 0.22, 1) forwards 0.8s;
}

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

@keyframes growLine {
    to { width: 160px; }
}

@media (min-width: 768px) {
    @keyframes growLine { to { width: 200px; } }
}

/* --- HERO ENTRANCE ANIMATIONS --- */
.hero-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.5s; }
.delay-4 { transition-delay: 0.7s; }

/* --- GRAIN TEXTURE --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    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)'/%3E%3C/svg%3E");
}

/* --- ABSTRACT ORGANIC SHAPES (constrained for mobile) --- */
.blob-1 {
    position: absolute;
    width: 400px;
    height: 400px;
    background-color: var(--navy);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: -100px;
    right: -200px;
    z-index: -1;
    opacity: 0.04;
    animation: morph 8s ease-in-out infinite;
}

.blob-2 {
    position: absolute;
    width: 350px;
    height: 350px;
    background-color: var(--yellow);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    bottom: 10%;
    left: -200px;
    z-index: -1;
    opacity: 0.1;
    animation: morph 10s ease-in-out infinite alternate;
}

@media (min-width: 768px) {
    .blob-1 { width: 600px; height: 600px; }
    .blob-2 { width: 500px; height: 500px; }
}

@keyframes morph {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* --- EDITORIAL TEXT OVERLAP (desktop only) --- */
.text-overlap {
    display: inline-block;
}

@media (min-width: 768px) {
    .md\:text-overlap {
        margin-top: -1.5rem;
        margin-left: 2rem;
        position: relative;
        z-index: 10;
    }
}

/* --- GALLERY IMAGE STYLING --- */
.gallery-img {
    border-radius: 50%;
    box-shadow: 0 15px 30px rgba(0,0,0,0.35);
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease, border-color 0.5s ease;
    object-fit: cover;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
}

@media (min-width: 768px) {
    .gallery-img {
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        border-width: 4px;
    }
}

.gallery-img:hover {
    transform: scale(1.05) translateY(-10px);
    border-color: var(--yellow);
    z-index: 20;
}

/* Disable hover scale on touch devices to avoid sticky hover states */
@media (hover: none) {
    .gallery-img:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* --- MOBILE-ONLY REFINEMENTS --- */
@media (max-width: 767px) {
    /* Ensure no element breaks the viewport */
    h1, h2, h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Comfortable tap targets (min 44px) */
    a, button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Nav link tap targets */
    nav a {
        min-height: auto;
    }

    /* Prevent preloader issues on small screens */
    .preloader {
        height: 100dvh;
    }

    /* Stacked gallery spacing */
    .gallery-img {
        max-width: 100%;
    }
}
