/* ============================================
   CRITICAL.CSS — Sisicaya Resort 2026
   Above-the-fold: Variables, Splash, Nav, Safe Areas
   ============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Colors */
    --color-primary: #003d82;
    --color-primary-deep: #0a1628;
    --color-primary-bright: #0066cc;
    --color-primary-light: #e8f0fe;
    --color-accent: #d4a853;
    --color-accent-light: #f0c75e;
    --color-bg: #f8f6f3;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    --color-border: rgba(0, 0, 0, 0.06);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-light: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-blur: 20px;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(0, 102, 204, 0.15);

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Nav heights */
    --nav-height: 72px;
    --bottom-nav-height: 64px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
}

/* --- Splash Screen --- */
.splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(135deg, var(--color-primary-deep) 0%, #001a3d 50%, var(--color-primary) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash__logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: splashPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(212, 168, 83, 0.4));
}

.splash__brand {
    margin-top: var(--space-lg);
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash__brand span {
    display: block;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--color-accent);
    margin-top: var(--space-xs);
}

.splash__progress {
    margin-top: var(--space-xl);
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.splash__progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    border-radius: var(--radius-full);
    animation: splashLoad 2s ease-in-out forwards;
}

@keyframes splashPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes splashLoad {
    0% {
        width: 0%;
    }

    30% {
        width: 45%;
    }

    60% {
        width: 70%;
    }

    90% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

/* --- Navigation (Desktop) --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-md) 0;
    padding-top: calc(var(--space-md) + var(--safe-top));
    transition: all var(--transition-base);
}

.nav.scrolled {
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    padding: var(--space-sm) 0;
    padding-top: calc(var(--space-sm) + var(--safe-top));
}

.nav__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.nav__logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-fast);
}

.nav__logo:hover .nav__logo-img {
    transform: scale(1.05);
}

.nav__logo-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.nav__logo-text span {
    display: block;
    font-size: 0.65rem;
    font-weight: 300;
    color: var(--color-accent);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

.nav__link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav__link:hover,
.nav__link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Hamburger (tablet) */
.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
    z-index: 1001;
}

.nav__hamburger span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition-base);
}

.nav__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Bottom Navigation Bar (Mobile) --- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: var(--safe-bottom);
}

.bottom-nav__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: transform var(--transition-fast);
}

.bottom-nav__item.active,
.bottom-nav__item:active {
    color: var(--color-accent);
}

.bottom-nav__item.active svg {
    transform: scale(1.1);
}

/* --- Audio Toggle Button --- */
.audio-toggle {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.audio-toggle:hover {
    background: rgba(10, 22, 40, 0.95);
    transform: scale(1.08);
    box-shadow: var(--shadow-xl);
}

.audio-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.audio-toggle .audio-icon-on {
    display: none;
}

.audio-toggle.playing .audio-icon-off {
    display: none;
}

.audio-toggle.playing .audio-icon-on {
    display: block;
}

/* --- Language Toggle Button --- */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
}

.lang-toggle__flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-toggle__label {
    font-family: var(--font-body);
}

/* Mobile fixed lang toggle */
.lang-toggle--mobile {
    position: fixed;
    top: var(--space-md);
    right: 70px;
    z-index: 1001;
    display: none;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
    .nav__hamburger {
        display: flex;
    }

    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100dvh;
        flex-direction: column;
        background: rgba(10, 22, 40, 0.97);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        padding: 100px var(--space-xl) var(--space-xl);
        gap: var(--space-xs);
        transition: right var(--transition-base);
    }

    .nav__links.open {
        right: 0;
    }

    .nav__link {
        font-size: 0.9rem;
        padding: var(--space-md) var(--space-lg);
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .nav__logo-text {
        font-size: 1rem;
    }

    .nav__logo-img {
        width: 40px;
        height: 40px;
    }

    /* Show bottom nav */
    .bottom-nav {
        display: block;
    }

    /* Hide desktop nav links entirely on mobile */
    .nav__hamburger {
        display: none;
    }

    .nav__links {
        display: none;
    }

    /* Audio toggle above bottom nav */
    .audio-toggle {
        bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-md));
        right: var(--space-md);
        width: 46px;
        height: 46px;
    }

    .audio-toggle svg {
        width: 20px;
        height: 20px;
    }

    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    }
}

@media (max-width: 480px) {
    .nav__logo-text {
        font-size: 0.9rem;
    }

    .splash__brand {
        font-size: 1.4rem;
    }

    .splash__logo {
        width: 90px;
        height: 90px;
    }
}