html, body {
    overflow-x: hidden;
}
html {
    scroll-behavior: smooth;
}
:root {
    /* The Nature Palette */
    --forest-deep: #1a2e1a;
    --forest-mid: #2d4a2d;
    --gold: #c9a96e;
    --ivory: #f7f5f0;
    --cream: #f5eedc;
    --cream-glass: rgba(245, 240, 225, 0.7);
    --ink: #0d0d0d;

    /* Typography */
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Jost', sans-serif;

    /* Typography Improvements */
    --font-weight-body: 400;
    --font-weight-bold: 600;
    --font-size-base: 20px;
    --font-size-sm: clamp(18px, 1.2vw, 20px);
    --font-size-md: clamp(20px, 1.5vw, 24px);
    --font-size-lg: clamp(30px, 2vw, 36px);
    --font-size-xl: clamp(36px, 3vw, 48px);

    /* Spacing */
    --section-padding: 100px;
    --content-gap: 80px;
    --container-width: 1200px;
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --content-gap: 40px;
    }
}

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

body {
    background-color: var(--ivory);
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: var(--font-weight-body);
    font-size: var(--font-size-base);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Disable custom cursor on touch devices or small screens */
@media (hover: none) and (pointer: coarse), (max-width: 1024px) {
    body { cursor: auto !important; }
    .cursor, .cursor-follower { display: none !important; }
}

/* Custom Cursor */
.cursor, .cursor-follower {
    display: none !important;
}

.cursor.explore {
    width: 80px;
    height: 80px;
    background: rgba(247, 245, 240, 0.1);
    backdrop-filter: blur(2px);
    border: 1px solid var(--gold);
}

.cursor.explore::after {
    content: 'EXPLORE';
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--ivory);
}

/* Typography Utilities */
h1, h2, h3, .serif {
    font-family: var(--font-serif);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.italic {
    font-style: italic;
}

.uppercase { 
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 12px;
    font-weight: var(--font-weight-body);
}

/* Layout */
.section {
    padding: var(--section-padding) 5%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.flex-row {
    display: flex;
    gap: 60px;
    align-items: center;
}

@media (max-width: 768px) {
    .flex-row {
        flex-direction: column !important;
        gap: 30px;
    }
    .nav-meta {
        margin: 0;
        padding: 0;
        justify-content: center;
        width: 100%; /* Center flags on mobile top bar */
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9500;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: transparent;
}

body.menu-open nav {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Elegant Scrolled State: Floating Cream Bar */
nav.scrolled {
    top: 20px;
    width: 90%;
    left: 5%;
    background: var(--cream-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 5%;
    border-radius: 100px;
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-top: 1.5px solid var(--gold);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    -webkit-transform: translateZ(0); /* Safari hardware acceleration */
    transform: translateZ(0);
}

.nav-links {
    display: flex;
    gap: 25px; /* Reduced gap to fit better */
    margin-left: auto;
    margin-right: auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--ivory);
    font-size: 12px; /* Slightly smaller for elegance */
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em; /* Slightly tighter spacing */
    transition: all 0.4s ease;
    position: relative;
    padding: 5px 0;
    white-space: nowrap; /* Prevents disorganized wrapping */
}

/* Link Underline Animation */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Adapt link colors when scrolled or on non-hero pages */
nav.scrolled .nav-links a,
body:not(.has-hero) nav .nav-links a {
    color: var(--forest-deep);
}

.nav-links a:hover {
    color: var(--gold) !important;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px; /* Safety margin from links */
}

nav.scrolled .menu-btn span,
body.has-hero nav:not(.scrolled) .menu-btn span {
    background: var(--ivory);
}

.logo {
    display: none !important;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 30px;
}

.lang-toggle {
    display: flex;
    gap: 10px;
    color: var(--ivory);
    font-size: 12px;
}

.lang-toggle span {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.lang-toggle span.active {
    opacity: 1;
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    width: 32px;
    height: 18px;
    position: relative;
    z-index: 2000;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    height: 1.5px;
    background: var(--ivory);
    position: absolute;
    right: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.menu-btn span:nth-child(1) { top: 0; width: 100%; }
.menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); width: 70%; }
.menu-btn span:nth-child(3) { bottom: 0; width: 100%; }

.menu-btn.active span {
    background: var(--forest-deep) !important;
}

.menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    width: 100%;
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    width: 100%;
}

.mobile-menu {
    position: fixed;
    top: 50%;
    right: 35px;
    width: 240px;
    max-height: 420px;
    background: var(--cream);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px solid rgba(201, 169, 110, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    -webkit-transform: translate(calc(100% + 50px), -50%);
    transform: translate(calc(100% + 50px), -50%);
    -webkit-transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 40px 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll in iOS Safari */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-menu.active {
    -webkit-transform: translate(0, -50%);
    transform: translate(0, -50%);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
    width: 100%;
}

.mobile-menu-links a {
    text-decoration: none;
    color: var(--forest-deep) !important;
    font-size: 14px; /* Slightly adjusted for fit */
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.3s ease;
    padding: 12px 0; /* More compact vertical spacing */
    width: 100%;
    text-align: center;
    display: block;
}

.mobile-menu.active .mobile-menu-links a {
    opacity: 0.8;
    transform: translateY(0);
}

.mobile-menu.active .mobile-menu-links a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu-links a:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu-links a:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-menu-links a:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu.active .mobile-menu-links a:nth-child(5) { transition-delay: 0.5s; }
.mobile-menu.active .mobile-menu-links a:nth-child(6) { transition-delay: 0.6s; }
.mobile-menu.active .mobile-menu-links a:nth-child(7) { transition-delay: 0.7s; }

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
    opacity: 1 !important;
    color: var(--gold);
}

/* Hero Section */
.hero { 
    height: 100vh;
    height: 100dvh; /* Dynamic height for Safari mobile */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    color: var(--ivory);
    position: relative;
    overflow: hidden;
    background: var(--forest-deep);
    padding-top: 150px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.hero-content { 
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 0 20px;
}

.hero-eyebrow { font-size: 14px; letter-spacing: 0.2em;
    margin-bottom: 20px;
    animation: fadeInDown 1.5s ease forwards;
}

.hero h1 {
    font-size: clamp(40px, 6vw, 72px);
    margin-bottom: 20px;
    animation: fadeIn 2s ease forwards;
}

.hero h1 em {
    color: var(--gold);
}

.hero-sub {
    font-size: 18px;
    font-weight: 200;
    margin-bottom: 40px;
    opacity: 0.8;
    animation: fadeInUp 2s ease forwards;
}

.btn { font-size: 14px; font-weight: 400;
    display: inline-block;
    padding: 15px 35px;
    border: 1px solid var(--gold);
    color: var(--gold);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 11px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--gold);
    color: var(--forest-deep);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: var(--gold);
    animation: scrollLine 2s infinite;
}

/* Manifesto Section */
.manifesto {
    text-align: center;
    padding: 120px 5%;
}

.manifesto-text {
    font-size: 32px;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-top: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 48px;
    color: var(--forest-deep);
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--forest-mid);
}

/* Safaris Grid */
.safaris-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 500px;
    gap: 20px;
}

.safari-card {
    position: relative;
    overflow: hidden;
}

.safari-card img,
.safari-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 1s ease;
}

.safari-card:hover img,
.safari-card:hover video {
    transform: scale(1.05);
}

.safari-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(13, 13, 13, 0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.safari-card:hover .safari-overlay {
    opacity: 1;
}

.safari-title {
    color: var(--ivory);
    font-size: 24px;
    margin-bottom: 10px;
}

/* Experience Section (Split Sticky) */
.experience {
    display: flex;
    padding: 0 5%;
    max-width: none;
    gap: 60px;
}

.experience-visual {
    width: 50%;
    height: 100vh;
    position: sticky;
    top: 0;
    border-radius: 16px;
    overflow: hidden;
}

.experience-visual img,
.experience-visual video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.experience-content {
    width: 50%;
    padding: 100px 8%;
}

.experience-item {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.experience-item h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

/* Testimonials */
.testimonials {
    background: var(--ivory);
    text-align: center;
    padding: 120px 5%;
}

.testimonial-text {
    font-size: 28px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.testimonial-author {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Sustainability */
.sustainability {
    background: var(--forest-deep);
    color: var(--ivory);
    display: flex;
    gap: 80px;
    padding: 120px 10%;
}

.sustainability-manifesto {
    flex: 3;
    font-size: 36px;
}

.sustainability-principles {
    flex: 2;
    list-style: none;
}

.sustainability-principles li {
    padding: 20px 0;
    border-bottom: 0.5px solid rgba(247, 245, 240, 0.2);
    font-size: 14px;
}

/* Concierge */
.concierge {
    text-align: center;
    padding: 120px 5%;
}

.concierge-form {
    max-width: 800px;
    margin: 60px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    text-align: left;
}

.input-group label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 5px;
}

input {
    width: 100%;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--forest-mid);
    font-family: var(--font-sans);
    font-weight: var(--font-weight-body);
    outline: none;
}

.form-full {
    grid-column: span 2;
}

.concierge-footer {
    margin-top: 40px;
    font-size: 10px;
    opacity: 0.6;
}

/* Premium Video Styling */
video:not(.hero-video) {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(13, 13, 13, 0.2), 0 0 0 1px rgba(201, 169, 110, 0.1);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--forest-deep);
}

video:not(.hero-video):hover {
    transform: translateY(-5px);
    box-shadow: 0 45px 90px rgba(13, 13, 13, 0.3), 0 0 0 1px rgba(201, 169, 110, 0.3);
}

/* Animations and Reveals */
.reveal {
    opacity: 0;
    -webkit-transform: translateY(30px);
    transform: translateY(30px);
    -webkit-transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    -webkit-backface-visibility: hidden; /* Prevent flicker on Safari */
    backface-visibility: hidden;
}

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

/* Custom Video Controls */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 16px;
    overflow: hidden;
    background: var(--forest-deep);
    box-shadow: 0 30px 60px rgba(13, 13, 13, 0.2);
    /* Safari/WebKit stability fixes */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

/* Safari < 15 aspect-ratio fallback */
@supports not (aspect-ratio: 9/16) {
    .video-container {
        padding-bottom: 177.78%;
        height: 0;
    }
    .video-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.video-container video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(201, 169, 110, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.4);
}

.play-button-overlay::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent var(--ivory);
    margin-left: 5px;
}

.video-container:hover .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--gold);
}

.video-container.playing .play-button-overlay {
    opacity: 0;
    visibility: hidden;
}

/* Animations */
@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Reveal Animation Class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s ease;
}

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

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .safaris-grid {
        grid-template-columns: 1fr 1fr;
        height: auto;
    }
    .safari-card {
        height: 450px;
    }
}
@media (max-width: 768px) {
    .safaris-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    nav {
        background: transparent !important;
        padding: 15px 5% !important;
        height: 80px !important;
        top: 0 !important;
        width: 100% !important;
        left: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-pack: justify !important;
        -webkit-justify-content: space-between !important;
        justify-content: space-between !important;
        -webkit-box-align: center !important;
        -webkit-align-items: center !important;
        align-items: center !important;
        box-sizing: border-box !important;
        position: fixed !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    nav.scrolled {
        width: 100% !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        background: rgba(0, 0, 0, 0.4) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
        padding: 15px 5% !important;
        box-sizing: border-box !important;
        border: none !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .logo {
        display: none !important;
    }

    .nav-links {
        display: none !important;
    }

    .menu-btn {
        position: relative !important;
        right: 0 !important;
        top: 0 !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        width: 30px !important;
        height: 20px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -webkit-flex-direction: column !important;
        flex-direction: column !important;
        -webkit-box-pack: justify !important;
        -webkit-justify-content: space-between !important;
        justify-content: space-between !important;
        -webkit-box-align: end !important;
        -webkit-align-items: flex-end !important;
        align-items: flex-end !important;
        padding: 0 !important;
        z-index: 10001 !important;
        -webkit-appearance: none;
        outline: none;
    }

    .menu-btn::before {
        display: none !important;
    }

    .menu-btn span {
        display: block !important;
        position: relative !important;
        width: 28px !important;
        height: 2px !important;
        background: #ffffff !important;
        margin: 0 !important;
        -webkit-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        -webkit-transform-origin: center right !important;
        transform-origin: center right !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }

    .menu-btn.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .menu-btn.active span:nth-child(1) {
        -webkit-transform: translateY(-2px) rotate(-45deg) !important;
        transform: translateY(-2px) rotate(-45deg) !important;
    }

    .menu-btn.active span:nth-child(3) {
        -webkit-transform: translateY(2px) rotate(45deg) !important;
        transform: translateY(2px) rotate(45deg) !important;
    }

    .hero h1 {
        font-size: 42px;
    }

    .manifesto-text {
        font-size: 24px;
    }

    .stats {
        flex-direction: column;
        gap: 40px;
    }

    .safaris-grid {
        grid-template-columns: 1fr;
    }

    .safari-card:first-child {
        grid-column: span 1;
    }

    .experience {
        flex-direction: column;
        padding: var(--section-padding) 5%;
    }

    .experience-visual, .experience-content {
        width: 100%;
    }

    .experience-visual {
        height: 40vh;
        position: relative;
    }

    .sustainability {
        flex-direction: column;
        gap: 40px;
        padding: 60px 5%;
    }

    .sustainability-manifesto {
        font-size: 28px;
    }

    .concierge-form {
        grid-template-columns: 1fr;
        margin-top: 40px;
    }

    .form-full {
        grid-column: auto;
    }

    .btn { font-size: 14px; font-weight: 400;
        padding: 12px 25px;
        font-size: 10px;
    }
}

/* Floating WhatsApp Button */
.whatsapp-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
    background: transparent !important;
    -webkit-animation: floatUp 3s ease-in-out infinite;
    animation: floatUp 3s ease-in-out infinite;
    width: 120px;
    height: 120px;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.whatsapp-container.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(100px) !important; /* Forces it to hide even with animation */
}

@-webkit-keyframes floatUp {
    0%, 100% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        filter: drop-shadow(0 4px 20px rgba(201, 168, 76, 0.5));
    }
    50% {
        -webkit-transform: translateY(-8px);
        transform: translateY(-8px);
        filter: drop-shadow(0 16px 32px rgba(201, 168, 76, 0.8));
    }
}

@keyframes floatUp {
    0%, 100% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        filter: drop-shadow(0 4px 20px rgba(201, 168, 76, 0.5));
    }
    50% {
        -webkit-transform: translateY(-8px);
        transform: translateY(-8px);
        filter: drop-shadow(0 16px 32px rgba(201, 168, 76, 0.8));
    }
}

.botao-whatsapp-refugio {
    display: block;
    width: 100%;
    height: 100%;
    background-image: url('images/botao_screen.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-indent: -9999px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.standard-logo {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

.botao-whatsapp-refugio:hover {
    transform: scale(1.1) rotate(5deg);
}

@media (max-width: 768px) {
    .whatsapp-container {
        bottom: 20px;
        right: 20px;
        width: 85px;
        height: 85px;
    }
}


.watermark { position: absolute; right: -100px; bottom: -100px; width: 600px; height: 600px; opacity: 0.03; pointer-events: none; z-index: -1; filter: brightness(0) invert(1); transform: rotate(-15deg); }
@media (max-width: 768px) { .watermark { width: 300px; height: 300px; right: -50px; bottom: -50px; } }

/* Restore logo visibility */
.logo { display: flex; }



/* Accordion (Details/Summary) Styles */
.accordion {
    max-width: 800px;
    margin: 60px auto;
}

.accordion details {
    border-bottom: 1px solid rgba(26, 46, 26, 0.1);
    padding: 20px 0;
    transition: all 0.3s ease;
}

.accordion summary {
    list-style: none;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--forest-deep);
    outline: none;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::after {
    content: "+";
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 24px;
    color: var(--gold);
    transition: transform 0.3s ease;
}

.accordion details[open] summary::after {
 transform: rotate(45deg);
}

.accordion .content {
 padding: 20px 0;
 font-size: 17px;
 opacity: 0.8;
 line-height: 1.6;
 animation: fadeIn 0.5s ease forwards;
}

.accordion .content ul {
 list-style: none;
 margin-top: 15px;
}

.accordion .content li {
 margin-bottom: 12px;
 padding-left: 25px;
 position: relative;
}

.accordion .content li::before {
 content: \—\;
 position: absolute;
 left: 0;
 color: var(--gold);
}
.footer-logo { 
    display: inline-block;          /* Safari needs explicit block context */
    height: 55px;
    width: auto;
    max-width: 120px;               /* Prevent Safari from stretching */
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.92;
    background: transparent !important;
    -webkit-backface-visibility: hidden; /* Fixes Safari rendering glitch */
    backface-visibility: hidden;
    -webkit-filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.25));
    filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.25));
}
.footer-logo:hover {
    transform: scale(1.05);
    opacity: 1;
    -webkit-filter: drop-shadow(0 0 12px rgba(201, 169, 110, 0.5));
    filter: drop-shadow(0 0 12px rgba(201, 169, 110, 0.5));
}

/* Sponsor logo — larger, color-accurate, Safari-hardened */
.footer-logo-sponsor {
    display: inline-block;          /* Safari needs explicit block context */
    height: 85px;
    width: auto;
    max-width: 160px;               /* Prevent Safari from stretching */
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    background: transparent !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-filter: none;           /* Safari: explicit none, no !important conflict */
    filter: none;
}
.footer-logo-sponsor:hover {
    transform: scale(1.05);
    opacity: 1;
}

.nav-transfers { color: var(--gold) !important; }

footer {
    text-align: center;
    padding: 25px 5%;
    background-color: var(--forest-deep);
    color: var(--ivory);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    will-change: transform;
}

footer div[style*="display: flex"] {
    margin-bottom: 15px !important;
    gap: 30px !important;
}

/* Social icon size normalizer — covers both 50px (old) and 36px (new) */
footer a[style*="width: 50px"],
footer a[style*="width: 36px"] {
    width: 36px !important;
    height: 36px !important;
}

/* Only apply to the copyright span, not contact text spans */
footer > span {
    display: block;
    font-size: 10px;
    opacity: 0.5;
    letter-spacing: 0.15em;
}

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

main {
    padding-bottom: 180px; /* Space for the thinner fixed footer */
}

/* --- COMPREHENSIVE MOBILE OVERRIDES --- */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    /* Override large inline font sizes */
    h1, h2, h1[style], h2[style], .serif[style] {
        font-size: clamp(28px, 6vw, 36px) !important;
    }
    
    h3, h3[style] {
        font-size: clamp(22px, 5vw, 26px) !important;
    }
    
    /* Force grids to single column */
    .grid-2, .grid-3, [style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* Override inline paddings/margins that are too large */
    [style*="padding-top: 160px"] {
        padding-top: 80px !important;
    }
    
    /* Ensure media doesn't overflow */
    .video-container, iframe, img, video {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Adjust section paddings */
    .section, .concierge {
        padding: 60px 5% !important;
    }
    
    /* Reveal wrappers should not force horizontal overflow */
    .reveal[style] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Footer Reveal for Mobile */


    footer {
        padding: 20px 5% !important;
        background-color: var(--forest-deep) !important;
    }

    main {
        padding-bottom: 220px !important;
    }

    .nav-meta {
        gap: 15px !important;
    }
}

.flag-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    cursor: pointer;
}
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lang-toggle span.active .flag-icon {
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
.lang-toggle a {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.lang-toggle a:hover {
    opacity: 1;
    transform: translateY(-2px);
}


/* PDF Portfolio Button Styling */
.pdf-btn {
    display: none !important;
}

/* Footer Redesign & Safari Stability */
footer {
    width: 100%;
    background-color: var(--forest-deep);
    padding: 60px 4% 40px;
    position: relative;
    z-index: 10;
}

.footer-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: var(--container-width);
    margin: 0 auto 30px;
}

.footer-contact-grid {
    display: -webkit-flex;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    flex: 1;
}

.footer-column {
    text-align: left;
}

.footer-column p {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.footer-column a, .footer-column span {
    color: var(--ivory);
    font-size: 12px;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.footer-column a:hover {
    opacity: 1;
}

.footer-insta-group {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 12px;
}

.footer-insta-icon {
    display: block;
    width: 28px;
    height: 28px;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.footer-insta-icon:hover {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

.footer-insta-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-sponsors {
    display: -webkit-flex;
    display: flex;
    gap: 30px;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.footer-sponsors img[alt="Cadastur"] {
    border-radius: 8px;
}

.footer-copyright {
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid rgba(247, 245, 240, 0.05);
    padding-top: 30px;
}

.footer-copyright span {
    font-size: 10px;
    opacity: 0.5;
}

/* Safari < 14.1 Gap Fallback */
@supports not (gap: 1px) {
    .footer-container > * { margin: 15px; }
    .footer-contact-grid > * { margin: 10px 20px; }
    .footer-insta-group > * { margin-right: 12px; }
    .footer-sponsors > * { margin-left: 20px; }
}

@media (max-width: 768px) {
    .footer-container {
        -webkit-flex-direction: column;
        flex-direction: column;
        text-align: center;
    }
    .footer-contact-grid {
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 25px;
    }
    .footer-column {
        text-align: center;
    }
    .footer-insta-group {
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 8px;
    }
}

/* Portfolio Print Template (Hidden in Browser) */
#portfolio-template {
    display: none;
    background: var(--ivory);
    color: var(--forest-deep);
    width: 210mm;
    margin: 0 auto;
    font-family: var(--font-sans);
}

/* When body has .printing class, hide site and show portfolio */
body.printing > *:not(#portfolio-template) {
    display: none !important;
    visibility: hidden !important;
}

body.printing #portfolio-template {
    display: block !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background-color: var(--ivory) !important;
    overflow: visible !important;
}

/* Force A4 page size on ALL browsers including iOS Safari */
@page {
    size: A4 portrait;
    margin: 0;
}

/* Print-Specific Styles */
@media print {
    /* Force colors and backgrounds */
    html, body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background-color: #f7f5f0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
    }

    /* Explicitly hide every site element — iOS Safari ignores *:not() */
    nav, footer, main, header,
    .whatsapp-container, .cursor, .cursor-follower,
    .mobile-menu, .pdf-btn, .reveal {
        display: none !important;
        visibility: hidden !important;
    }

    /* Also hide body children that are not the portfolio */
    body > *:not(#portfolio-template) {
        display: none !important;
    }

    /* Show ONLY the portfolio template */
    #portfolio-template {
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: var(--ivory) !important;
    }

    #portfolio-template * {
        visibility: visible !important;
    }

    /* Remove gaps between pages */
    .portfolio-page {
        margin: 0 !important;
        padding: 12mm 15mm !important;
        border: none !important;
        width: 210mm !important;
        max-height: 297mm !important;    /* A4 max — never overflow into blank page */
        overflow: hidden !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid !important;
        break-inside: avoid !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;   /* top-aligned — avoids blank pages on iOS */
        position: relative !important;
    }

    .portfolio-page:last-of-type {
        page-break-after: auto !important;
    }

    .portfolio-cover {
        background-color: var(--ivory) !important;
        color: var(--forest-deep) !important;
    }


    /* Force images to show */
    .portfolio-image {
        display: block !important;
        max-width: 100% !important;
    }

    /* Safari/WebKit: force sponsor images to correct size in PDF */
    .footer-logo-sponsor,
    img[alt="Brasil"] {
        display: inline-block !important;
        height: 60px !important;
        width: auto !important;
        max-width: 150px !important;
        object-fit: contain !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        -webkit-filter: none !important;
        filter: none !important;
    }

    img[alt="Cadastur"] {
        display: inline-block !important;
        height: 45px !important;
        width: auto !important;
        max-width: 120px !important;
        object-fit: contain !important;
        border-radius: 6px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .footer-logo {
        display: inline-block !important;
        height: 55px !important;
        width: auto !important;
        max-width: 120px !important;
        -webkit-filter: none !important;
        filter: none !important;
    }



    .no-print, .pdf-btn, .whatsapp-container, nav, footer, .cursor {
        display: none !important;
    }
}

/* Portfolio Content Styling (Optimized for PDF) */
.portfolio-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--ivory);
    color: var(--forest-deep);
}

.portfolio-cover {
    background-color: var(--ivory);
    color: var(--forest-deep);
    text-align: center;
    justify-content: space-between;
    padding: 60mm 20mm;
    border: 1px solid rgba(0,0,0,0.05);
}

.portfolio-cover h1 {
    font-size: 60px;
    margin-top: 20px;
}

.portfolio-cover .logo-large {
    height: 150px;
    width: auto;
    object-fit: contain;
    margin-bottom: 30px;
}

.portfolio-section-title {
    font-family: var(--font-serif);
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 5px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.portfolio-image {
    width: 100%;
    height: 65mm;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.portfolio-text {
    font-size: 18px;
    line-height: 1.6;
}

.portfolio-footer {
    position: absolute;
    bottom: 20mm;
    left: 20mm;
    right: 20mm;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    border-top: 0.5px solid rgba(0,0,0,0.1);
    padding-top: 10px;
    opacity: 0.6;
}

/* Hide on mobile if necessary, or adjust */
/* Show Portfolio text on mobile too */
@media (max-width: 768px) {
    .pdf-btn {
        padding: 6px 12px;
        font-size: 9px;
    }
}
