:root {
    --bg-color: #0A0A0A;
    --accent-color: #00E5FF;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --metallic-silver: #E0E0E0;
    --transition-speed: 1s;
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
}

body {
    color: var(--text-primary);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: "wdth" 100;
    font-weight: 200;
    cursor: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Scrollable override for dashboards/admin */
body.scrollable {
    overflow-y: auto !important;
    position: relative !important;
    height: auto !important;
    min-height: 100vh;
    cursor: auto !important;
}

html.scrollable {
    overflow-y: auto !important;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-in-out;
}

.loader-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Device Restriction Logic */
#mobile-restriction {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    background: var(--bg-color);
    z-index: 200;
}

@media (max-width: 1023px) {
    #story-container {
        display: none !important;
    }
    #mobile-restriction {
        display: block;
    }
    body {
        cursor: auto; /* Show cursor on mobile */
    }
}

#story-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    z-index: 100;
}

#story-container::-webkit-scrollbar {
    display: none;
}

.story-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Typography */
h1 {
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 200;
    line-height: 1.1;
    max-width: 1200px;
    letter-spacing: -0.02em;
}

.reveal-text {
    opacity: 0;
    filter: blur(20px);
    transform: translateY(30px);
    transition: all var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

.story-section.active .reveal-text {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Specific Section Styles */
#section-1 {
    flex-direction: column;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    opacity: 0.6;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-secondary);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 0; }
    50% { transform: translate(-50%, 5px); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

/* Counter */
.spots-counter {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    letter-spacing: 0.3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.5s;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.story-section.active .spots-counter {
    opacity: 1;
    transform: translateY(0);
}

/* Hidden Message */
#hidden-message {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { transform: translate(0); text-shadow: none; }
    2% { transform: translate(-2px, 2px); text-shadow: 2px 0 var(--accent-color); }
    4% { transform: translate(2px, -2px); text-shadow: -2px 0 #ff00c1; }
    6% { transform: translate(0); text-shadow: none; }
    100% { transform: translate(0); }
}

.distortion-active {
    filter: url(#glitch-filter);
    animation: jitter 0.2s infinite;
}

@keyframes jitter {
    0% { transform: translate(0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

/* Mobile Restriction UI Styles */
.mobile-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
    scroll-snap-align: start;
}

.mobile-section h1 {
    font-size: 2rem;
    font-weight: 200;
    opacity: 0;
    transition: opacity 1s ease;
    max-width: 80%;
}

.mobile-counter p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

.mobile-section.active h1 {
    opacity: 1;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #000;
    border: 1px solid #333;
}

.qr-placeholder {
    color: var(--accent-color);
}

.email-link {
    border-top: 1px solid #222;
    padding-top: 2rem;
}

#email-send-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

#email-send-form input {
    flex: 1;
    background: #000;
    border: 1px solid #333;
    padding: 0.8rem;
    color: white;
    outline: none;
}

#email-send-form button {
    padding: 0.8rem 1.5rem;
    background: var(--metallic-silver);
    border: none;
    font-weight: 200;
    cursor: pointer;
}

.device-icon {
    margin-top: 2rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    opacity: 0.5;
}

.mobile-btns {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.mobile-btn {
    padding: 1rem;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    border: none;
    cursor: pointer;
}

.mobile-btn.primary {
    background: var(--accent-color);
    color: black;
}

.mobile-btn.secondary {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

/* Button & Form */
.glow-button {
    margin-top: 3rem;
    padding: 1.2rem 3.5rem;
    background: transparent;
    border: 1px solid var(--metallic-silver);
    color: var(--text-primary);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.2rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.glow-button:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
    transform: scale(1.05);
}

#form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.form-container {
    background: #141414;
    padding: 4rem;
    width: 100%;
    max-width: 600px;
    border: 1px solid #222;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2.5rem;
    cursor: pointer;
}

.form-container h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.form-container p {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.input-group {
    position: relative;
    margin-bottom: 2.5rem;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    padding: 0.8rem 0;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-group label {
    position: absolute;
    top: 0.8rem;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -1.2rem;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent-color);
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--accent-color);
    border: none;
    color: black;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-btn:hover {
    transform: translateY(-5px);
}

/* Global Effects */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
    opacity: 0.04;
    pointer-events: none;
    z-index: 50;
}

/* Dual Cursor System */
.cursor-ring {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1), 
                height 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.6s ease,
                background-color 0.6s ease,
                box-shadow 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, width, height;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
}

.cursor-text {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    color: var(--text-primary);
    opacity: 0.7;
    transition: opacity 0.5s ease;
    pointer-events: none;
    white-space: nowrap;
    position: absolute;
    top: -20px;
}

/* Sectional Variations (Delayed via JS class swap) */
.cursor-ring.state-scroll { width: 30px; height: 30px; }
.cursor-ring.state-observe { width: 50px; height: 50px; border-color: rgba(255,255,255,0.5); }
.cursor-ring.state-restricted { width: 40px; height: 40px; border-color: #ff3b3b; box-shadow: 0 0 10px rgba(255,59,59,0.2); }
.cursor-ring.state-limited { width: 60px; height: 60px; border-color: var(--accent-color); animation: cursor-pulse 2s infinite; }
.cursor-ring.state-enter { width: 80px; height: 80px; border-color: var(--accent-color); }

.cursor-ring.state-enter .cursor-text {
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    color: var(--accent-color);
}

/* Interactive States */
.cursor-ring.hover {
    width: 90px;
    height: 90px;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.cursor-ring.hover .cursor-text {
    top: 50%;
    transform: translateY(-50%);
    color: black;
    opacity: 1;
    font-weight: 700;
}

.cursor-ring.click {
    transform: translate(-50%, -50%) scale(0.8);
}

@keyframes cursor-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* Word Reveal Logic */
.word {
    display: inline-block;
}

/* Parallax Background */
.story-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.02) 0%, transparent 80%);
    z-index: -1;
}
