/* ==========================================
   PREMIUM LANDING SCREEN
   Apple / Framer Quality Polish
   Do NOT use: typing animation, flashing effects, neon glow,
   overly colorful gradients, complex illustrations, loud motion
   ========================================== */

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    --landing-bg: #050505;
    --landing-text: #FFFFFF;
    --landing-muted: #8A8A8A;
    --landing-accent: rgba(255, 255, 255, 0.12);
    --landing-progress-bg: rgba(255, 255, 255, 0.08);
    --landing-progress-fill: rgba(255, 255, 255, 0.9);
    --landing-glow: rgba(120, 120, 140, 0.15);
}

/* ==========================================
   LANDING SCREEN CONTAINER
   ========================================== */
.landing-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--landing-bg);
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 1.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-screen.transitioning {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
}

/* Cinematic synchronized fade-out for all children */
.landing-screen.transitioning .welcome-block,
.landing-screen.transitioning .loading-feedback {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   AMBIENT BACKGROUND
   Subtle, alive, premium feel
   ========================================== */
.ambient-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.ambient-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 80% 60% at 50% 40%,
        rgba(30, 30, 35, 0.8) 0%,
        transparent 70%
    );
    opacity: 0.6;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: ambientPulse 8s ease-in-out infinite;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: var(--landing-glow);
    top: 20%;
    left: 25%;
    animation-delay: 0s;
}

.glow-2 {
    width: 350px;
    height: 350px;
    background: rgba(100, 100, 120, 0.12);
    bottom: 25%;
    right: 20%;
    animation-delay: 4s;
}

.grain-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    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");
    pointer-events: none;
}

@keyframes ambientPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translate(10px, -10px) scale(1.05);
    }
}

/* ==========================================
   LANDING CONTENT
   ========================================== */
.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    padding: 24px;
    text-align: center;
}

/* ==========================================
   WELCOME BLOCK
   ========================================== */
.welcome-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.welcome-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    font-size: 88px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--landing-text);
    margin: 0;
    opacity: 0;
    transform: translateY(16px);
    will-change: opacity, transform;
}

.welcome-text.visible {
    /* Visible state handled by JS for smooth control */
}

.welcome-text.exiting {
    /* Exiting state handled by JS for smooth control */
}

.welcome-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--landing-muted);
    margin: 0;
    opacity: 0;
    animation: subtitleFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

@keyframes subtitleFadeIn {
    to {
        opacity: 1;
    }
}

/* ==========================================
   LOADING FEEDBACK
   Clear progress indication
   ========================================== */
.loading-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    animation: loadingFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

@keyframes loadingFadeIn {
    to {
        opacity: 1;
    }
}

.progress-container {
    width: 200px;
    height: 3px;
    background: var(--landing-progress-bg);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--landing-progress-fill);
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--landing-text);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    opacity: 0.9;
}

.progress-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--landing-muted);
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   MAIN PORTFOLIO INITIAL STATE
   ========================================== */
.main-portfolio {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
                transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.main-portfolio.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Large Desktop */
@media (min-width: 1400px) {
    .welcome-text {
        font-size: 96px;
    }
    
    .progress-container {
        width: 240px;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .welcome-text {
        font-size: 80px;
        letter-spacing: -1.5px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .welcome-text {
        font-size: 68px;
        letter-spacing: -1.5px;
    }
    
    .welcome-subtitle {
        font-size: 17px;
    }
    
    .landing-content {
        gap: 40px;
    }
    
    .progress-container {
        width: 180px;
    }
}

/* Mobile Landscape / Small Tablet */
@media (max-width: 768px) {
    .welcome-text {
        font-size: 52px;
        letter-spacing: -1px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
    }
    
    .landing-content {
        gap: 36px;
    }
    
    .progress-container {
        width: 160px;
    }
    
    .glow-1, .glow-2 {
        width: 250px;
        height: 250px;
        filter: blur(60px);
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .welcome-text {
        font-size: 44px;
        letter-spacing: -0.5px;
    }
    
    .welcome-subtitle {
        font-size: 15px;
    }
    
    .welcome-block {
        gap: 12px;
    }
    
    .landing-content {
        gap: 32px;
        padding: 20px;
    }
    
    .progress-container {
        width: 140px;
        height: 2px;
    }
    
    .progress-bar::after {
        width: 4px;
        height: 4px;
    }
    
    .progress-text {
        font-size: 11px;
    }
    
    .loading-feedback {
        gap: 12px;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .welcome-text {
        font-size: 38px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
    }
    
    .progress-container {
        width: 120px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .welcome-text,
    .landing-screen,
    .main-portfolio,
    .ambient-glow {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}