/* Index Interface Styles */
/* Uses variables from main.css */

:root {
    --loader-size: min(280px, 40vw);
    /* Adjusted minimum font size to prevent overflow when forcing one line */
    --font-size-xl: clamp(1.8rem, 5vw, 4rem);
    --font-size-lg: clamp(1.3rem, 3.5vw, 1.8rem);
    --font-size-md: clamp(1.1rem, 3vw, 1.5rem);
    --font-size-sm: clamp(0.9rem, 2.2vw, 1.1rem);
    --spacing-xl: clamp(3rem, 5vw, 4.5rem);
    --spacing-lg: clamp(2.5rem, 4vw, 3.5rem);
    --spacing-md: clamp(1.5rem, 2.5vw, 3rem);
    --spacing-sm: clamp(0.8rem, 1.5vw, 1.5rem);
    
    /* Override with light theme colors */
    --cosmic-glow: 0 0 50px rgba(234, 88, 12, 0.3), 0 0 100px rgba(146, 64, 14, 0.2), 0 0 150px rgba(234, 88, 12, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-secondary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Exo 2', sans-serif;
    padding: var(--spacing-md);
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(3px 3px at 15% 25%, var(--primary-medium), transparent),
        radial-gradient(2px 2px at 35% 65%, var(--primary-dark), transparent),
        radial-gradient(1px 1px at 55% 15%, var(--primary-light), transparent),
        radial-gradient(2px 2px at 85% 45%, var(--primary-medium), transparent),
        radial-gradient(1px 1px at 25% 85%, var(--primary-light), transparent),
        radial-gradient(3px 3px at 75% 10%, var(--primary-medium), transparent),
        radial-gradient(2px 2px at 10% 60%, var(--primary-dark), transparent),
        radial-gradient(1px 1px at 90% 85%, var(--primary-light), transparent);
    background-size: 600px 600px, 400px 400px, 300px 300px, 500px 500px, 350px 350px, 450px 450px, 380px 380px, 320px 320px;
    animation: cosmicStarfield 80s linear infinite;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 800px 400px at 30% 70%, rgba(234, 88, 12, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 600px 300px at 70% 30%, rgba(146, 64, 14, 0.03) 0%, transparent 50%);
    animation: nebulaDrift 40s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    max-width: min(90vw, 1000px);
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
}

.loader {
    position: relative;
    width: var(--loader-size);
    height: var(--loader-size);
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transform: perspective(1200px) rotateX(20deg);
    filter: drop-shadow(var(--cosmic-glow));
    /* Added margin top to fine tune the "touching" effect if needed */
    margin-top: 10px;
}

.circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, 
        transparent 0deg, 
        var(--primary-light) 45deg,
        var(--primary-medium) 90deg, 
        var(--primary-dark) 135deg,
        var(--primary-medium) 180deg,
        var(--primary-light) 225deg,
        var(--primary-medium) 270deg,
        var(--primary-dark) 315deg,
        transparent 360deg);
    animation: hyperRotate3d 4s linear infinite;
    transform-style: preserve-3d;
    box-shadow: 
        0 0 40px rgba(234, 88, 12, 0.3),
        0 0 80px rgba(146, 64, 14, 0.2),
        inset 0 0 40px rgba(234, 88, 12, 0.1);
}

.circle:nth-child(2) {
    animation-delay: -2s;
    filter: blur(12px) brightness(1.2);
    transform: rotateY(90deg) rotateX(45deg);
    width: 110%;
    height: 110%;
    background: conic-gradient(from 180deg, 
        transparent 0deg, 
        var(--primary-medium) 60deg,
        var(--primary-dark) 120deg, 
        var(--primary-light) 180deg,
        var(--primary-medium) 240deg,
        var(--primary-dark) 300deg,
        transparent 360deg);
}

.circle:nth-child(3) {
    animation-delay: -1s;
    filter: blur(6px) brightness(1.1);
    transform: rotateX(60deg) rotateZ(45deg);
    width: 130%;
    height: 130%;
    background: conic-gradient(from 90deg, 
        transparent 0deg, 
        var(--primary-light) 45deg,
        var(--primary-medium) 90deg,
        var(--primary-dark) 135deg,
        var(--primary-medium) 180deg,
        var(--primary-light) 225deg,
        var(--primary-dark) 270deg,
        var(--primary-medium) 315deg,
        transparent 360deg);
}

.inner-circle {
    position: absolute;
    width: 60%;
    height: 60%;
    background: 
        radial-gradient(circle at center, 
            var(--bg-primary) 0%, 
            var(--bg-secondary) 40%,
            var(--bg-tertiary) 70%, 
            var(--bg-primary) 100%);
    border-radius: 50%;
    border: 4px solid transparent;
    background-clip: padding-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(30px);
    box-shadow: 
        0 0 60px rgba(234, 88, 12, 0.2),
        0 0 120px rgba(146, 64, 14, 0.15),
        inset 0 0 30px rgba(234, 88, 12, 0.1),
        inset 0 0 60px rgba(146, 64, 14, 0.05);
    position: relative;
}

.inner-circle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: var(--gradient-primary);
    border-radius: 50%;
    z-index: -1;
    animation: gradientRotate 3s linear infinite;
}

.progress-text {
    color: var(--primary-darker);
    font-size: var(--font-size-lg);
    font-weight: 900;
    font-family: 'Orbitron', monospace;
    text-shadow: 
        0 0 15px rgba(234, 88, 12, 0.5),
        0 0 30px rgba(146, 64, 14, 0.3),
        0 0 45px rgba(234, 88, 12, 0.2);
    transform: translateZ(15px);
    animation: quantumPulse 2.5s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

.company-name {
    font-size: var(--font-size-xl);
    font-weight: 900;
    text-align: center;
    letter-spacing: 6px;
    background: var(--gradient-primary);
    background-size: 600% 600%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    width: 100%;
    /* Enforce one line */
    white-space: nowrap; 
    word-wrap: normal;
    animation: epicGradientShift 6s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(234, 88, 12, 0.3);
    transform: perspective(1200px) rotateX(15deg) translateZ(40px);
    transform-style: preserve-3d;
    font-family: 'Orbitron', sans-serif;
    filter: drop-shadow(0 0 20px rgba(146, 64, 14, 0.2));
}

.company-tagline {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    text-align: center;
    padding: 0 var(--spacing-sm);
    text-shadow: 
        0 0 15px rgba(234, 88, 12, 0.2),
        0 0 30px rgba(146, 64, 14, 0.1);
    transform: perspective(1200px) rotateX(8deg) translateZ(20px);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    letter-spacing: 1px;
    
    /* MODIFIED: Negative margin to pull the loader up to touch the text */
    /* Cancels out the container gap and pulls it closer */
    margin-bottom: calc(var(--spacing-md) * -1);
    z-index: 10; /* Ensure text sits visually above any glowing spillover */
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
    text-align: center;
    transform-style: preserve-3d;
}

.status-message {
    color: var(--text-primary);
    font-size: var(--font-size-md);
    min-height: 1.8em;
    animation: hyperfadeInOut3d 0.6s ease-in-out;
    text-shadow: 
        0 0 20px rgba(234, 88, 12, 0.2),
        0 0 40px rgba(146, 64, 14, 0.1);
    transform: perspective(1200px) rotateX(12deg) translateZ(25px);
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}

.secondary-status {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-style: italic;
    text-shadow: 
        0 0 15px rgba(234, 88, 12, 0.15),
        0 0 25px rgba(146, 64, 14, 0.1);
    transform: perspective(1200px) rotateX(8deg) translateZ(15px);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    opacity: 0.9;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
    padding: 0 var(--spacing-sm);
    width: 100%;
    transform-style: preserve-3d;
}

.tech-word {
    color: var(--text-primary);
    background: linear-gradient(135deg, 
        rgba(254, 215, 170, 0.3) 0%, 
        rgba(234, 88, 12, 0.2) 25%,
        rgba(146, 64, 14, 0.3) 50%,
        rgba(254, 215, 170, 0.2) 75%,
        rgba(234, 88, 12, 0.3) 100%);
    padding: calc(var(--spacing-sm) * 0.7) calc(var(--spacing-md) * 1.2);
    border-radius: 30px;
    font-size: var(--font-size-sm);
    animation: cosmicFadeIn3d 0.8s ease-in-out forwards;
    opacity: 0;
    white-space: nowrap;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    background-clip: padding-box;
    text-shadow: 
        0 0 10px rgba(234, 88, 12, 0.2),
        0 0 20px rgba(146, 64, 14, 0.1);
    transform: perspective(1200px) rotateX(15deg) translateZ(8px);
    transform-style: preserve-3d;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.tech-word::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 30px;
    z-index: -1;
    opacity: 0.6;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

.tech-word:hover {
    transform: perspective(1200px) rotateX(15deg) translateZ(20px) scale(1.08);
    background: linear-gradient(135deg, 
        rgba(254, 215, 170, 0.5) 0%, 
        rgba(234, 88, 12, 0.4) 25%,
        rgba(146, 64, 14, 0.5) 50%,
        rgba(254, 215, 170, 0.4) 75%,
        rgba(234, 88, 12, 0.5) 100%);
    box-shadow: var(--shadow-medium);
    color: var(--primary-darker);
}

@keyframes cosmicStarfield {
    from { transform: translateY(0) translateX(0); }
    to { transform: translateY(-600px) translateX(-200px); }
}

@keyframes nebulaDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, -50px) rotate(2deg); }
}

/* FIXED: Smooth continuous rotation without visible restart glitch */
/* Uses a 50% waypoint to oscillate the tilt while maintaining a linear Z-spin */
@keyframes hyperRotate3d {
    0% { 
        transform: rotateZ(0deg) rotateY(0deg) rotateX(0deg);
        filter: hue-rotate(0deg) brightness(1);
    }
    50% { 
        transform: rotateZ(180deg) rotateY(45deg) rotateX(15deg);
        filter: hue-rotate(60deg) brightness(1.2);
    }
    100% { 
        transform: rotateZ(360deg) rotateY(0deg) rotateX(0deg);
        filter: hue-rotate(0deg) brightness(1);
    }
}

@keyframes gradientRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(359.99deg); }
}

@keyframes quantumPulse {
    0% { 
        transform: translateZ(15px) scale(1);
        text-shadow: 
            0 0 15px rgba(234, 88, 12, 0.5),
            0 0 30px rgba(146, 64, 14, 0.3),
            0 0 45px rgba(234, 88, 12, 0.2);
    }
    100% { 
        transform: translateZ(25px) scale(1.1);
        text-shadow: 
            0 0 25px rgba(234, 88, 12, 0.7),
            0 0 40px rgba(146, 64, 14, 0.5),
            0 0 55px rgba(234, 88, 12, 0.3);
    }
}

@keyframes epicGradientShift {
    0% { background-position: 0% 50%; filter: hue-rotate(0deg); }
    25% { background-position: 100% 50%; filter: hue-rotate(15deg); }
    50% { background-position: 100% 100%; filter: hue-rotate(30deg); }
    75% { background-position: 0% 100%; filter: hue-rotate(45deg); }
    100% { background-position: 0% 50%; filter: hue-rotate(60deg); }
}

@keyframes hyperfadeInOut3d {
    0% { 
        opacity: 0; 
        transform: perspective(1200px) rotateX(12deg) translateZ(25px) translateY(20px) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: perspective(1200px) rotateX(12deg) translateZ(25px) translateY(0) scale(1);
    }
}

@keyframes cosmicFadeIn3d {
    to { 
        opacity: 1;
        transform: perspective(1200px) rotateX(15deg) translateZ(8px);
    }
}

@keyframes borderGlow {
    0% { opacity: 0.6; filter: blur(1px); }
    100% { opacity: 0.9; filter: blur(0px); }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm);
    }

    .company-name, .company-tagline, .status-container, .tech-stack {
        width: 100%;
    }

    .loader {
        margin: var(--spacing-sm) 0;
    }
}

/* Ultra-wide Screens */
@media (min-width: 1920px) {
    :root {
        --loader-size: 350px;
    }
}

/* Small Screens */
@media (max-width: 360px) {
    :root {
        --loader-size: 200px;
    }

    .tech-stack {
        gap: calc(var(--spacing-sm) * 0.6);
    }

    .tech-word {
        padding: calc(var(--spacing-sm) * 0.5) calc(var(--spacing-sm) * 1);
    }
}

/* Print Media */
@media print {
    body {
        background: var(--bg-primary);
    }
    
    .loader, .circle {
        animation: none;
    }
}