@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Syne+Mono&display=swap');

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

:root {
    --white: #ffffff;
    --smoke-1: #f8f8f8;
    --smoke-2: #e8e8e8;
    --smoke-3: #d0d0d0;
    --smoke-4: #b8b8b8;
    --smoke-5: #a0a0a0;
    --smoke-6: #888888;
    --text-primary: #888888;
    --text-secondary: #a8a8a8;
    --bg: #fafafa;
}

body {
    font-family: 'Instrument Serif', Georgia, serif;
    background: var(--bg);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

/* Background clouds layer */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background:
        /* Central gradient */
        radial-gradient(ellipse 80% 70% at 50% 50%, rgba(255,255,255,0.6) 0%, transparent 50%),
        /* Cloud clusters */
        radial-gradient(ellipse 50% 40% at 15% 20%, var(--smoke-2) 0%, transparent 60%),
        radial-gradient(ellipse 45% 35% at 85% 25%, var(--smoke-3) 0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 10% 75%, var(--smoke-2) 0%, transparent 50%),
        radial-gradient(ellipse 40% 50% at 90% 80%, var(--smoke-3) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 25% 50%, var(--smoke-1) 0%, transparent 45%),
        radial-gradient(ellipse 50% 55% at 75% 55%, var(--smoke-2) 0%, transparent 50%),
        /* Edge clouds */
        radial-gradient(ellipse 70% 30% at 0% 40%, var(--smoke-3) 0%, transparent 60%),
        radial-gradient(ellipse 70% 30% at 100% 60%, var(--smoke-3) 0%, transparent 60%),
        radial-gradient(ellipse 100% 40% at 50% 0%, var(--smoke-2) 0%, transparent 50%),
        radial-gradient(ellipse 100% 40% at 50% 100%, var(--smoke-2) 0%, transparent 50%),
        /* Base gradient */
        linear-gradient(180deg, var(--smoke-1) 0%, var(--bg) 30%, var(--bg) 70%, var(--smoke-1) 100%);
    animation: cloudsDrift 30s ease-in-out infinite alternate;
}

@keyframes cloudsDrift {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(1.02) translate(-0.5%, 0.3%);
        opacity: 0.95;
    }
    100% {
        transform: scale(1.01) translate(0.3%, -0.2%);
        opacity: 1;
    }
}

/* Custom cursor - 2px dot with white stroke */
.cursor-dot {
    position: fixed;
    width: 2px;
    height: 2px;
    background: var(--smoke-6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    box-shadow: 0 0 0 1px var(--white);
}

.cursor-dot.hidden {
    opacity: 0;
}

/* Cursor halo - blurred ring */
.cursor-halo {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--smoke-6);
    box-shadow: 0 0 0 2px var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    filter: blur(2px);
    transition: opacity 0.3s ease;
}

.cursor-halo.hidden {
    opacity: 0;
}

/* Cursor trail particles */
.cursor-trail {
    position: fixed;
    width: 3px;
    height: 3px;
    background: var(--smoke-5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Intro - ethereal fog emergence */
.intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(232, 232, 232, 0.85) 0%, rgba(250, 250, 250, 0.9) 70%),
        radial-gradient(ellipse 100% 80% at 20% 30%, rgba(208, 208, 208, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse 90% 70% at 80% 70%, rgba(208, 208, 208, 0.5) 0%, transparent 45%),
        rgba(250, 250, 250, 0.92);
    opacity: 1;
    transition: opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 100;
}

.cloudy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 60% 50% at 45% 45%, rgba(255,255,255,0.8) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 60% 55%, var(--smoke-1) 0%, transparent 40%),
        radial-gradient(ellipse 50% 40% at 30% 60%, var(--smoke-2) 0%, transparent 45%),
        radial-gradient(ellipse 40% 35% at 70% 40%, var(--smoke-2) 0%, transparent 40%);
    animation: mistDrift 12s ease-in-out infinite alternate;
}

@keyframes mistDrift {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.8;
    }
    25% {
        transform: scale(1.06) translate(-1.5%, 1%);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.03) translate(0.5%, -1%);
        opacity: 0.7;
    }
    75% {
        transform: scale(1.08) translate(1%, 0.5%);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.04) translate(-0.5%, -0.5%);
        opacity: 0.65;
    }
}

/* Subtle breathing pulse on intro */
.intro::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.4) 0%, transparent 50%);
    animation: introPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes introPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

/* Grain texture overlay */
.intro::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.intro.fade-out {
    opacity: 0;
}

/* Title - refined serif with breathing */
.title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.02em;
    text-align: center;
    opacity: 0;
    z-index: 50;
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--smoke-6);
    white-space: nowrap;
}

.title.show {
    opacity: 1;
}

.title.hide {
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Countdown - minimal monospace */
.countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Syne Mono', monospace;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 400;
    opacity: 0;
    z-index: 40;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--smoke-5);
    letter-spacing: 0.5em;
}

.countdown.show {
    opacity: 0.6;
}

.countdown.hide {
    opacity: 0;
}

/* Three.js Canvas */
#sphereCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    opacity: 1;
    pointer-events: none;
}

/* Verb container */
.verb-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    pointer-events: none;
}

/* Verb - elegant serif */
.verb {
    position: relative;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.04em;
    text-align: center;
    opacity: 0;
    z-index: 31;
    transition: opacity 3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--smoke-6);
    padding: 0 2rem;
}

.verb.show {
    opacity: 1;
}

.verb.hide {
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Truth text - whisper at the threshold */
.truth-text {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Syne Mono', monospace;
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    text-align: center;
    opacity: 0;
    z-index: 31;
    transition: opacity 4s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--smoke-5);
    max-width: 90%;
    pointer-events: none;
}

.truth-text.show {
    opacity: 0.4;
}

.truth-text.hide {
    opacity: 0;
}

/* Scroll overlay - inverts screen gradually from bottom up */
.scroll-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--white);
    z-index: 5000;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 1;
    will-change: height;
}

.scroll-overlay.draining {
    bottom: auto;
    top: 0;
}

/* Fullscreen button - bottom left */
.fullscreen-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: none;
    z-index: 200;
    opacity: 0.6;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fullscreen-btn:hover {
    opacity: 0.9;
}

/* Square corners icon */
.fullscreen-btn::before,
.fullscreen-btn::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1.5px solid var(--smoke-6);
}

.fullscreen-btn::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.fullscreen-btn::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* When fullscreen, show exit icon (inverted corners) */
.fullscreen-btn.is-fullscreen::before {
    top: auto;
    bottom: 4px;
    left: auto;
    right: 4px;
    border: 1.5px solid var(--smoke-6);
    border-left: none;
    border-top: none;
}

.fullscreen-btn.is-fullscreen::after {
    bottom: auto;
    top: 4px;
    right: auto;
    left: 4px;
    border: 1.5px solid var(--smoke-6);
    border-right: none;
    border-bottom: none;
}

/* Footer - barely there */
.footer {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 200;
}

.about-link {
    font-family: 'Syne Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    opacity: 0.6;
    color: var(--smoke-6);
    cursor: pointer;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.about-link:hover {
    opacity: 0.9;
    border-bottom-color: var(--smoke-5);
}

/* About Modal - contemplative space */
.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.96);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-modal.active {
    opacity: 1;
    pointer-events: all;
}

.about-content {
    max-width: 480px;
    padding: 4rem 3rem;
    text-align: left;
    position: relative;
}

.about-modal.active .about-content {
    animation: revealUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.about-close {
    position: absolute;
    top: 0;
    right: 0;
    font-family: 'Syne Mono', monospace;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--smoke-5);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-close:hover {
    opacity: 0.8;
}

.about-content h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.02em;
    margin-bottom: 2.5rem;
    color: var(--smoke-6);
}

.about-text {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.9;
    letter-spacing: 0.01em;
    color: var(--smoke-5);
    margin-bottom: 1.8rem;
}

.about-text:last-child {
    margin-bottom: 2rem;
}

.about-twitter {
    display: inline-block;
    font-family: 'Syne Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--smoke-6);
    text-decoration: none;
    border-bottom: 1px solid var(--smoke-5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: 2px;
}

.about-twitter:hover {
    color: var(--smoke-5);
    border-bottom-color: var(--smoke-6);
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        padding: 0 2rem;
        white-space: normal;
    }
    
    .footer {
        top: 1.5rem;
        left: 1.5rem;
    }
    
    .fullscreen-btn {
        top: 1.5rem;
        right: 1.5rem;
    }
    
    .about-link {
        font-size: 0.6rem;
    }
    
    .about-content {
        padding: 3rem 2rem;
        max-width: 90%;
    }
    
    .truth-text {
        bottom: 4.5rem;
    }
    
    .verb {
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .about-content {
        padding: 2.5rem 1.5rem;
    }
    
    .about-content h2 {
        margin-bottom: 2rem;
    }
    
    .about-text {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
}
