:root {
    /* Dream Theme Colors - Moonlight palette */
    --dream-bg: #a7b5e9;
    --dream-text: #f0f2fa;
    --dream-dark: #6d7ab5;
    --dream-accent: #e8e8f0;
    --dream-accent-dark: #c5c7e0;
    --dream-cloud: rgba(173, 184, 235, 0.65); /* Light blue instead of pure white */
    --dream-fog: rgba(173, 184, 235, 0.5);
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    
    /* Animation Timing - Match lunar cycle concept */
    --drift-slow: 29.5s; /* Lunar month in seconds */
    --drift-medium: 14.8s; /* Half lunar month */
    --drift-fast: 7.4s; /* Quarter lunar month */

    /* Adding more atmospheric variables */
    --glow-subtle: 0 0 30px rgba(232, 232, 240, 0.2);
    --glow-medium: 0 0 40px rgba(232, 232, 240, 0.4);
    --particle-color: rgba(232, 232, 240, 0.4);
}

/* Base styles */
html {
    box-sizing: border-box;
    height: 100%;
    font-size: 16px;
}

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

body {
    font-family: var(--font-body);
    background: var(--dream-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dream-text);
    position: relative;
    overflow: hidden;
    cursor: none;
}

/* Hide cursor globally */
body {
    cursor: none;
}

/* Re-hide cursor on hoverable elements */
button:hover,
a:hover,
input:hover,
textarea:hover {
    cursor: none;
}

/* Enhance visual texture */
.noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.06;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: overlay;
}

.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(167, 181, 233, 0.03) 51%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 6;
    opacity: 0.15;
}

/* Dream particles */
.particles-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--particle-color);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle var(--drift-slow) infinite ease-in-out;
}

/* Dream clouds - Make them more visible */
.dream-clouds {
    position: fixed;
    inset: 0;
    z-index: 1; /* Increased from 0 */
    overflow: hidden;
    pointer-events: none;
}

.dream-cloud {
    position: absolute;
    background: rgba(173, 184, 235, 0.65); /* Using light blue */
    border-radius: 50%;
    filter: blur(100px);
    animation: cloudFloat var(--drift-slow) infinite alternate ease-in-out;
    mix-blend-mode: soft-light;
    opacity: 0.6 !important; /* Increased visibility for portfolio */
}

.cloud-1 {
    width: 800px; /* Increased size */
    height: 800px;
    top: -200px;
    left: -100px;
    animation-delay: -2s;
    opacity: 0.4;
    filter: blur(120px);
}

.cloud-2 {
    width: 1200px; /* Increased size */
    height: 1200px;
    bottom: -300px;
    right: -200px;
    animation-delay: -7s;
    opacity: 0.35;
    filter: blur(150px);
}

.cloud-3 {
    width: 900px; /* Increased size */
    height: 900px;
    top: 20%;
    left: -250px;
    animation-delay: -5s;
    opacity: 0.3;
    filter: blur(130px);
}

.cloud-4 {
    width: 700px; /* Increased size */
    height: 700px;
    bottom: 5%;
    right: 20%;
    animation-delay: -9s;
    opacity: 0.45;
    filter: blur(140px);
}

/* Border cloud animation */
.border-cloud {
    mix-blend-mode: screen;
    animation: borderCloudFloat var(--drift-slow) infinite alternate-reverse ease-in-out;
}

@keyframes borderCloudFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.1); }
}

/* Ensure clouds appear behind content */
.mooncut-container {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(400px, 1fr);
    gap: 4rem;
    min-height: 100vh;
    padding: 10vh 8vw;
    max-width: 2000px;
    margin: 0 auto;
    z-index: 2; /* Keep above clouds */
    position: relative;
}

.content-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 2rem;
}

.visual-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Logo styling - Color inverted SVG */
.mooncut-logo {
    width: 180px;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    animation: subtle-pulse 8s infinite alternate ease-in-out;
}

@keyframes subtle-pulse {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}

/* Error display - Cleaner typography */
.error-display {
    margin-bottom: 2rem;
}

.error-code {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 4.5rem);
    font-weight: 300;
    margin: 0;
    color: var(--dream-accent);
    letter-spacing: 0.05em;
    position: relative;
}

.error-code::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    text-shadow: 0 0 15px var(--dream-accent);
    opacity: 0;
    animation: codeGlow 8s infinite;
}

@keyframes codeGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

.error-message {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 4vw, 2rem);
    margin: 1.5rem 0 0.5rem;
    color: var(--dream-accent);
    font-weight: 300;
    letter-spacing: 0.05em;
}

.error-info {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--dream-accent);
    margin: 1rem 0;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Buffer dots - Circular arrangement */
.buffer-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
}

.buffer-dots {
    position: relative;
    width: 80px;
    height: 80px;
}

.dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--dream-accent);
    border-radius: 50%;
    opacity: 0.6;
}

/* Position dots in a circle */
.dot:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.dot:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.dot:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.dot:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }
.dot:nth-child(5) { top: 14%; right: 14%; }
.dot:nth-child(6) { bottom: 14%; right: 14%; }
.dot:nth-child(7) { bottom: 14%; left: 14%; }
.dot:nth-child(8) { top: 14%; left: 14%; }

.buffer-text {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--dream-accent);
    letter-spacing: 2px;
    margin-top: 1.5rem;
    opacity: 0.7;
    text-transform: uppercase;
}

/* Buttons - Ethereal style */
.action-buttons {
    position: relative;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.dream-button {
    position: relative;
    padding: 0.8rem 2.5rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid var(--dream-accent);
    border-radius: 30px;
    color: var(--dream-accent);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    overflow: hidden;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(232, 232, 240, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(232, 232, 240, 0.2);
    background: rgba(232, 232, 240, 0.05);
}

.dream-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 232, 240, 0.1), transparent);
    transition: left 0.7s;
}

.dream-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 232, 240, 0.1), transparent);
    animation: shimmerEffect 6s infinite;
}

@keyframes shimmerEffect {
    0% { transform: translateX(0%); }
    20% { transform: translateX(200%); }
    100% { transform: translateX(200%); }
}

.dream-button:hover {
    background: rgba(232, 232, 240, 0.15); /* Slightly brighter hover */
    box-shadow: 0 0 15px rgba(232, 232, 240, 0.4); /* Stronger glow */
    transform: translateY(-2px); /* Subtle lift */
}

.dream-button:active {
    transform: translateY(1px); /* Subtle press */
}

.dream-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--dream-bg), 0 0 0 4px var(--dream-accent);
}

/* Info bar */
.info-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.8em;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1000;
    background: none;
    backdrop-filter: none;
}

/* Brand header with logo */
.brand-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    z-index: 10;
}

.header-logo {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.brand-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--dream-accent);
    margin: 0;
}

/* Enhanced moon buffering animation */
.moon-buffer {
    position: relative;
    width: min(500px, 50vw);
    height: min(500px, 50vw);
    margin: 0 auto;
    box-shadow: inset -10px -10px 50px rgba(173, 184, 235, 0.2);
}

.moon-cycle {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-phase {
    width: 140px; /* Increased from 100px */
    height: 140px; /* Increased from 100px */
    background: var(--dream-accent);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(232, 232, 240, 0.6); /* Stronger base glow */
    animation: moonPhases 29.5s infinite linear, moonGlow 10s infinite alternate ease-in-out;
}

.moon-phase::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 140px; /* Match the moon size */
    background: var(--dream-bg);
    border-radius: 50%;
    transform: translateX(70px); /* Adjusted for size */
    animation: moonCycle 29.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.orbit-line {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(232, 232, 240, 0.1);
    box-shadow: 
        0 0 30px rgba(232, 232, 240, 0.05),
        inset 0 0 30px rgba(232, 232, 240, 0.05);
    border-radius: 50%;
}

.buffer-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: orbitRotation 29.5s infinite linear;
}

.buffer-dots .dot {
    --orbit-radius: calc(min(500px, 50vw) / 2);
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--dream-accent);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(232, 232, 240, 0.5);
}

/* Fixed orbital positions using precise math */
.dot:nth-child(1) { transform: translateX(-50%) translateY(-50%) rotate(0deg) translateY(var(--orbit-radius)); }
.dot:nth-child(2) { transform: translateX(-50%) translateY(-50%) rotate(45deg) translateY(var(--orbit-radius)); }
.dot:nth-child(3) { transform: translateX(-50%) translateY(-50%) rotate(90deg) translateY(var(--orbit-radius)); }
.dot:nth-child(4) { transform: translateX(-50%) translateY(-50%) rotate(135deg) translateY(var(--orbit-radius)); }
.dot:nth-child(5) { transform: translateX(-50%) translateY(-50%) rotate(180deg) translateY(var(--orbit-radius)); }
.dot:nth-child(6) { transform: translateX(-50%) translateY(-50%) rotate(225deg) translateY(var(--orbit-radius)); }
.dot:nth-child(7) { transform: translateX(-50%) translateY(-50%) rotate(270deg) translateY(var(--orbit-radius)); }
.dot:nth-child(8) { transform: translateX(-50%) translateY(-50%) rotate(315deg) translateY(var(--orbit-radius)); }

.cycle-count {
    position: absolute;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--dream-accent);
    opacity: 0.7;
    bottom: 0;
    right: 0;
}

/* Dream fragment quote */
.dream-fragment {
    margin: 2.5rem 0;
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--dream-accent);
    opacity: 0.9;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* Dream Fragment - Hidden element that appears on idle */
.hidden-dream-fragment {
    position: fixed;
    bottom: 10%;
    right: 10%;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--dream-accent);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 2s, transform 2s;
    text-align: right;
    max-width: 20ch;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.idle .hidden-dream-fragment {
    opacity: 0.3;
    transform: translateY(0);
}

/* Moon phase animations */
@keyframes moonPhases {
    0%, 100% { box-shadow: 0 0 25px rgba(232, 232, 240, 0.6); }
    50% { box-shadow: 0 0 35px rgba(232, 232, 240, 0.9); } /* More intense pulse */
}

@keyframes moonCycle {
    0% { transform: translateX(140px); } /* Adjusted for size */
    25% { transform: translateX(70px); } /* Adjusted for size */
    50% { transform: translateX(0); }
    75% { transform: translateX(-70px); } /* Adjusted for size */
    100% { transform: translateX(-140px); } /* Adjusted for size */
}

@keyframes orbitRotation {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

@keyframes moonGlow {
    0%, 100% { 
        box-shadow: var(--glow-subtle);
    }
    50% { 
        box-shadow: var(--glow-medium);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glitchText {
    0%, 100% { opacity: 0.7; transform: translateX(0); }
    25% { opacity: 0.4; transform: translateX(-2px); }
    75% { opacity: 0.2; transform: translateX(2px); }
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    25% {
        opacity: var(--particle-opacity, 0.4);
    }
    75% {
        opacity: var(--particle-opacity, 0.4);
    }
    100% {
        opacity: 0;
        transform: translateY(var(--float-y, -100px)) translateX(var(--float-x, 0));
    }
}

@keyframes subtle-button-pulse {
    0%, 100% { 
        box-shadow: none; 
    }
    50% { 
        box-shadow: 0 0 20px rgba(232, 232, 240, 0.1);
    }
}

/* Force cloud visibility with !important */
@keyframes cloudFloat {
    0% { transform: translate(0, 0); opacity: 0.5 !important; }
    100% { transform: translate(40px, -20px); opacity: 0.5 !important; }
}

/* Dream video overlay */
.dream-video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-in-out;
}

.dream-video-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.dream-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
    transition: opacity 1.5s ease-in-out;
    display: none; /* Hide by default */
}

.dream-video.loaded {
    opacity: 0.8;
}

.signal-loss {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, var(--dream-bg));
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    z-index: 5;
}

.signal-loss.active {
    opacity: 1;
}

/* Dream preview button */
.view-dream-button {
    background: rgba(232, 232, 240, 0.05);
    border-color: var(--dream-accent);
    margin-top: 1rem;
}

.view-dream-button:hover {
    background: rgba(232, 232, 240, 0.1);
}

/* Dream echo glitch effect */
.dream-echo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: min(90%, 600px);
    height: min(90%, 400px);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s, transform 0.5s;
    pointer-events: none;
    overflow: hidden;
}

.dream-echo-container.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.dream-echo-frame {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--dream-bg);
    border: 1px solid rgba(232, 232, 240, 0.3);
    box-shadow: 0 0 30px rgba(232, 232, 240, 0.2);
    overflow: hidden;
}

.dream-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    mix-blend-mode: screen;
}

.dream-video.active {
    opacity: 0.9;
}

/* Glitch layers */
.glitch-layer {
    position: absolute;
    inset: 0;
    background: var(--dream-bg);
    mix-blend-mode: difference;
    opacity: 0;
    transform: translateX(0);
    pointer-events: none;
}

.dream-echo-container.glitching .glitch-layer:nth-child(1) {
    animation: safeGlitchLayer1 3s ease-in-out infinite; /* 3s instead of 0.2s */
}

.dream-echo-container.glitching .glitch-layer:nth-child(2) {
    animation: safeGlitchLayer2 4s ease-in-out infinite; /* 4s instead of 0.3s */
}

.dream-echo-container.glitching .glitch-layer:nth-child(3) {
    animation: safeGlitchLayer3 5s ease-in-out infinite; /* 5s instead of 0.17s */
    mix-blend-mode: color-dodge;
}

@keyframes safeGlitchLayer1 {
    0%, 90%, 100% { opacity: 0; transform: translateX(0); }
    95% { opacity: 0.2; transform: translateX(-5px); }
}

@keyframes safeGlitchLayer2 {
    0%, 85%, 100% { opacity: 0; transform: translateY(0); }
    90% { opacity: 0.15; transform: translateY(3px); }
}

@keyframes safeGlitchLayer3 {
    0%, 80%, 100% { opacity: 0; transform: translateX(0); }
    85% { opacity: 0.1; transform: translateX(5px); }
}

/* VHS Dream overlay positioned over the moon buffer */
.vhs-dream-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Keep it circular like the moon */
    overflow: hidden;
    opacity: 0;
    z-index: 20; /* Above the moon and orbit elements */
    pointer-events: none;
    transition: opacity 2s ease-in-out;
}

.vhs-dream-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Video positioned to fill the container */
.dream-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    z-index: 1;
}

/* VHS Effect Layers */
.color-shift-r, 
.color-shift-g, 
.color-shift-b {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 1s ease-in-out;
}

.color-shift-r {
    background: rgba(255, 0, 0, 0.3);
    transform: translateX(-3px);
}

.color-shift-g {
    background: rgba(0, 255, 0, 0.3);
    transform: translateY(2px);
}

.color-shift-b {
    background: rgba(0, 0, 255, 0.3);
    transform: translateX(3px);
}

.vhs-static {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    z-index: 4;
    transition: opacity 1s ease-in-out;
}

/* VHS Glitch Animation Classes */
.vhs-dream-overlay.vhs-glitch .color-shift-r {
    opacity: 0.5;
    animation: colorShiftRed 7s ease-in-out infinite;
}

.vhs-dream-overlay.vhs-glitch .color-shift-g {
    opacity: 0.5;
    animation: colorShiftGreen 5s ease-in-out infinite;
}

.vhs-dream-overlay.vhs-glitch .color-shift-b {
    opacity: 0.5;
    animation: colorShiftBlue 8s ease-in-out infinite;
}

/* Animation keyframes for VHS effects */
@keyframes colorShiftRed {
    0%, 100% { transform: translateX(-2px) translateY(0); }
    25% { transform: translateX(-5px) translateY(1px); }
    50% { transform: translateX(-3px) translateY(-2px); }
    75% { transform: translateX(-1px) translateY(2px); }
}

@keyframes colorShiftGreen {
    0%, 100% { transform: translateX(0) translateY(2px); }
    25% { transform: translateX(2px) translateY(4px); }
    50% { transform: translateX(0) translateY(0); }
    75% { transform: translateX(-2px) translateY(3px); }
}

@keyframes colorShiftBlue {
    0%, 100% { transform: translateX(2px) translateY(0); }
    25% { transform: translateX(4px) translateY(-2px); }
    50% { transform: translateX(1px) translateY(1px); }
    75% { transform: translateX(3px) translateY(0); }
}

/* Loading indicator styles */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dream-accent);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    z-index: 10;
}

.video-loading.active {
    opacity: 1;
}

.dream-video {
    opacity: 0;
    transition: opacity 1s ease;
}

.dream-video.loaded {
    opacity: 0.8;
}

/* Dream fade overlay */
.dream-fade-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--dream-bg) 85%
    );
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: 10;
    animation: fadeIn 2s forwards;
}

/* TV Effects */
.tv-static-bg {
    mix-blend-mode: screen;
    transition: opacity 0.1s ease-out;
}

.dream-video {
    transition: opacity 0.1s ease-out !important;
}

.vhs-dream-overlay {
    transition: opacity 0.2s ease-out;
}

.tv-power-flash {
    mix-blend-mode: screen;
}

/* Portfolio showcase enhancements */
.dream-meta {
    position: relative;
    overflow: hidden;
}

.dream-meta::after {
    content: '';
    position: absolute;
    height: 1px;
    bottom: -4px;
    left: 0;
    width: 100%;
    background: var(--dream-accent);
    opacity: 0.5;
    transform: translateX(-100%);
    animation: lineReveal 8s var(--drift-slow) infinite;
}

@keyframes lineReveal {
    0%, 20% { transform: translateX(-100%); }
    40%, 70% { transform: translateX(0); }
    90%, 100% { transform: translateX(100%); }
}

/* Media queries */
@media (max-width: 1200px) {
    .mooncut-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 15vh 4vw 4vw 4vw;
    }
    
    .content-side {
        text-align: center;
        padding-right: 0;
    }
    
    .moon-buffer {
        width: min(400px, 80vw);
        height: min(400px, 80vw);
    }
}

@media (max-width: 768px) {
    :root {
        --drift-slow: 20s;
        --drift-medium: 10s;
        --drift-fast: 5s;
    }

    .dream-cloud {
        filter: blur(60px) !important;
    }

    .border-cloud {
        display: none;
    }

    .mooncut-container {
        padding: 5vh 4vw;
        gap: 2rem;
    }

    .error-code {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .error-message {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }

    .dream-fragment {
        font-size: 0.9rem;
        margin: 1.5rem 0;
    }

    .moon-buffer {
        width: min(300px, 80vw);
        height: min(300px, 80vw);
    }
}

@media (max-width: 480px) {
    .dream-cloud:not(.cloud-1):not(.cloud-2) {
        display: none;
    }

    .brand-header {
        padding: 1rem;
    }

    .mooncut-container {
        padding: 3vh 3vw;
    }

    .info-bar {
        font-size: 0.55rem;
    }
}

/* Additional media query for very small screens */
@media (max-width: 360px) {
    .moon-buffer {
        width: min(200px, 90vw);
        height: min(200px, 90vw);
    }

    .brand-title {
        font-size: 1rem;
    }
}

/* Enhanced cursor trail */
.cursor-trail {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: screen;
    box-shadow: 0 0 20px var(--dream-accent-glow);
}

.cursor-trail-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    cursor: none;
}

.cursor-trail-dot {
    position: absolute;
    border-radius: 50%;
    background: var(--dream-accent);
    box-shadow: 0 0 15px var(--dream-accent-glow);
    mix-blend-mode: screen;
    will-change: transform;
    transform-origin: center;
    backdrop-filter: blur(2px);
}
