/* === BASE & VARIABLES === */
:root {
    /* Warm Beige Palette */
    --color-bg: #f5efe6;
    --color-surface: #ebe3d6;
    --color-surface-soft: #ddd4c5;

    --color-primary: #7e1624;
    /* Aged Wine */
    --color-primary-light: #9b1e2e;
    --color-accent: #9e7a2e;
    /* Warm Antique Gold */
    --color-accent-soft: rgba(158, 122, 46, 0.1);

    --color-text: #3b2e24;
    --color-text-dim: #6b5a4a;
    --color-text-muted: #a0917e;

    /* Premium Typography Pairing */
    --font-heading: 'Playfair Display', 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --glass-bg: rgba(245, 239, 230, 0.92);
    --glass-border: rgba(158, 122, 46, 0.15);
    --glass-shadow: 0 40px 80px rgba(60, 40, 20, 0.08);

    --safe-area: 8%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg);
    overflow-x: hidden;
    width: 100%;
}

body {
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 300;
    /* Lighter body weight for premium feel */
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    background-color: var(--color-bg);

    /* Organic Stone & Fine Noise Texture */
    background-image:
        radial-gradient(circle at 50% -20%, rgba(158, 122, 46, 0.04), transparent),
        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.025'/%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* Optimization for Mobile Scrolling */
@media (max-width: 968px) {
    body {
        background-attachment: scroll;
        /* Prevents lag/jitter on mobile */
    }
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-accent);
}

a {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: inherit;
    text-decoration: none;
}

/* Accessibility - visible focus ring for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

img {
    max-width: 100%;
    display: block;
    filter: brightness(1) contrast(1.05);
    /* Clean images for light theme */
}

/* Custom Scrollbar - Premium Thin Gold */
::-webkit-scrollbar {
    width: 6px;
    /* Thinner */
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(158, 122, 46, 0.4);
    /* Softer gold */
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
    /* Full gold on hover */
}

/* === PRELOADER === */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 99999;
    /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.loader-text {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 1s ease forwards;
}

.loader-line {
    width: 0;
    height: 1px;
    background: var(--color-accent);
    margin: 0 auto;
    animation: lineGrow 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lineGrow {
    to {
        width: 100%;
    }
}