/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Lenis */
}
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ═══════════════════════════════════════
   UNIFIED PAGE LOADER
═══════════════════════════════════════ */
#pageLoader {
    position: fixed;
    inset: 0;
    background: #5a0e18;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Higher than everything else */
    transition: opacity 0.9s ease, visibility 0.9s;
}

#pageLoader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner {
    text-align: center;
    overflow: hidden;
}

.loader-line-wrap {
    overflow: hidden;
    line-height: 1.2;
}

.loader-bar-track {
    width: 200px;
    height: 1px;
    background: rgba(248, 246, 241, 0.15);
    margin: 28px auto 0;
    border-radius: 100px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 0%;
    background: #c9a84c;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Lenis base rules */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Global Background System ────────────────────────── */
body {
    background-color: #0a0a0a;
    color: #f0f0f0;
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999999;
    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.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* ── Global Typography ─────────────────────────────── */
h1, h2, h3, h4, .font-serif { font-family: var(--font-serif); }
h1 { font-size: clamp(3.5rem, 8vw, 8rem); font-weight: 900; line-height: 0.9; text-transform: uppercase; }
h2 { font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 700; line-height: 1.0; text-transform: uppercase; }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 600; line-height: 1.1; }

.text-gold { color: var(--clr-gold); }
.text-ivory { color: var(--clr-ivory); }
.text-black { color: var(--clr-black); }
.text-upper { text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Global Layout System ──────────────────────────── */
.section {
    position: relative;
    padding: var(--sp-xl) 5vw;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.transparent-bg { background: transparent !important; }

/* ── Global Card System ────────────────────────────── */
.card-modular {
    background: var(--clr-ivory);
    border: var(--border-thick);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    transition: transform 0.8s var(--ease-luxury), box-shadow 0.8s var(--ease-luxury);
    overflow: hidden;
}

.card-modular:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--shadow-card-hover);
}

/* ── Global Button System ──────────────────────────── */
.btn-cinematic {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: var(--clr-black);
    color: var(--clr-ivory);
    border: var(--border-thick);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.6s var(--ease-luxury);
}

.btn-cinematic:hover {
    background: var(--clr-ivory);
    color: var(--clr-black);
    transform: scale(1.02);
}

.btn-cinematic svg {
    transition: transform 0.6s var(--ease-luxury);
}

.btn-cinematic:hover svg {
    transform: translateX(5px);
}

/* ── Global Transitions ────────────────────────────── */
.line-wrap { overflow: hidden; display: block; }
.line-inner { display: block; transform: translateY(105%); }

/* ── Reset ──────────────────────────────────────────── */
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
img { display: block; max-width: 100%; object-fit: cover; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }



/* ── Mobile overflow prevention — universal ────────────────────── */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    * {
        box-sizing: border-box;
    }
}

/* Prevent flash of unstyled content — page starts invisible until CSS loads */
html { visibility: visible; }
