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

:root {
    --bg: #0A0A0A;
    --text: #F5F5F0;
    --muted: #888888;
    --accent: #C8B89A;
    --font: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Custom cursor ── */

body.has-cursor,
body.has-cursor * {
    cursor: none;
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(245, 245, 240, 0.35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease, width 0.25s ease, height 0.25s ease;
}

/* ── Film grain overlay ── */

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ── Mouse-following glow ── */

.glow {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
    background: radial-gradient(
        circle 400px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(200, 184, 154, 0.05) 0%,
        transparent 100%
    );
}

.glow.active {
    opacity: 1;
}

/* ── Gradient orbs ── */

.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 3s ease;
}

body:not(.loading) .orb {
    opacity: 1;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(30, 30, 80, 0.12) 0%, transparent 70%);
    top: -15%;
    right: -10%;
    filter: blur(60px);
    animation: drift1 28s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(50, 25, 55, 0.08) 0%, transparent 70%);
    bottom: -15%;
    left: -10%;
    filter: blur(60px);
    animation: drift2 34s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(200, 184, 154, 0.04) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    filter: blur(50px);
    animation: drift3 22s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-5vw, 4vh); }
    50% { transform: translate(3vw, 8vh); }
    75% { transform: translate(6vw, -2vh); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(6vw, -5vh); }
    50% { transform: translate(-4vw, -8vh); }
    75% { transform: translate(-2vw, 3vh); }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(8vw, -4vh) scale(1.1); }
    66% { transform: translate(-6vw, 6vh) scale(0.9); }
}

/* ── Scroll container ── */

.scroll-container {
    height: 280vh;
}

/* ── Hero section ── */

.hero {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Logo ── */

.logo {
    width: clamp(220px, 55vw, 520px);
    height: auto;
    opacity: 0;
    transform: scale(0.97);
    will-change: opacity, transform, filter;
}

body:not(.loading) .logo {
    animation: logoReveal 2.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.97);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
}

/* ── Scroll rings ── */

.scroll-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 1;
}

.scroll-ring-2 {
    border-color: rgba(245, 245, 240, 0.15);
}

/* ── Scroll indicator ── */

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    color: var(--text);
    opacity: 0;
    z-index: 3;
    transition: opacity 0.8s ease;
    will-change: opacity, transform;
}

.scroll-indicator.visible {
    animation: scrollPulse 3s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }
    50% {
        opacity: 0.55;
        transform: translateY(6px);
    }
}

.scroll-indicator.hidden {
    opacity: 0 !important;
    animation: none;
    transition: opacity 0.6s ease;
}

/* ── Footer ── */

footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 3rem 2rem 2.5rem;
    background-color: var(--bg);
}

footer .divider {
    width: clamp(40px, 8vw, 80px);
    height: 1px;
    background-color: var(--accent);
    opacity: 0.15;
}

footer p {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .glow {
        display: none;
    }

    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    body::after {
        opacity: 0.02;
    }

    .orb-1 { width: 350px; height: 350px; }
    .orb-2 { width: 300px; height: 300px; }
    .orb-3 { width: 250px; height: 250px; }

    .scroll-indicator {
        bottom: 1.5rem;
    }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .logo {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .orb { opacity: 1; }
}
