/*
 * VibeCreAI Base Styles
 * Core styles, variables, and foundational elements
 */

/* Font Face Declarations */
@font-face {
    font-family: 'Born2bSportyFont';
    src: url('../fonts/Born2bSportyFS.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'MinecraftFont';
    src: url('../fonts/MinecraftRegular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'MinecraftFont';
    src: url('../fonts/MinecraftItalic.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

/* CSS Custom Properties (Variables) */
:root {
    --primary-color: #00ffff;
    --secondary-color: #ff00ff;
    --accent-color: #2bb4db;
    --dark-bg: #0a0a0a;
    --text-color: #ffffff;
    --neon-glow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(43, 180, 219, 0.4);
}

/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

body {
    font-family: 'MinecraftFont', 'Courier New', 'Lucida Console', monospace;
    background: var(--dark-bg);
    color: var(--text-color);
    min-width: 380px; /* Minimum website width */
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Container and Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.section-title {
    font-family: 'Born2bSportyFont', 'MinecraftFont', 'Courier New', monospace;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 60px;
    color: #ffffff;
    position: relative;
    cursor: default;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    width: 100%;
    letter-spacing: 0.05em;
    text-shadow:
        -1px 1px 0 #252525,
        -2px 2px 0 #252525,
        -3px 3px 0 #252525,
        -4px 4px 0 #252525,
        -5px 5px 0 #252525,
        -6px 6px 0 #252525,
        -7px 7px 0 #252525,
        -8px 8px 0 #252525,
        -9px 9px 0 #252525,
        -10px 10px 20px rgba(37, 37, 37, 0.5);
}

.section-subtitle {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 40px;
    margin-top: -30px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    letter-spacing: 0.05em;
}

.contact-subtitle {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 40px;
    margin-top: -30px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    letter-spacing: 0.05em;
}

/* Loading Screen Base Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-text {
    font-family: 'Born2bSportyFont', 'MinecraftFont', 'Courier New', monospace;
    font-size: 3rem;
    color: #ffffff;
    text-shadow: none;
    letter-spacing: 0.2em;
}

.loading-gauge {
    width: clamp(240px, 60vw, 420px);
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading-track {
    --gauge-height: 20px;
    position: relative;
    height: var(--gauge-height);
    border-radius: calc(var(--gauge-height) / 2);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 12px, transparent 12px) 0 0 / 16px 100%,
        rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.8),
        0 0 12px rgba(0, 255, 255, 0.15);
    overflow: hidden;
}

.loading-track.flash {
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(0, 255, 255, 0.4),
        0 0 32px rgba(0, 255, 255, 0.25);
}

.loading-fill {
    position: absolute;
    inset: 2px;
    border-radius: calc(var(--gauge-height) / 2);
    background: #00ffff;
    width: 0%;
}

.loading-cap {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 12px;
    height: calc(var(--gauge-height) - 6px);
    border-radius: 999px;
    opacity: 0.2;
    background: rgba(255, 255, 255, 0.4);
}

.loading-metrics {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'MinecraftFont', 'Courier New', 'Lucida Console', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.85);
}

.loading-percent {
    font-family: 'Born2bSportyFont', 'MinecraftFont', 'Courier New', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.loading-label {
    opacity: 0.8;
    text-transform: uppercase;
    display: inline-block;
    text-align: right;
    line-height: 1.1;
}

@media (max-width: 480px) {
    .loading-gauge {
        width: 80vw;
    }
}

/* Utility Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.perspective-container {
    perspective: 1000px;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* Base Button Styles */
.cta-button {
    font-family: 'Born2bSportyFont', 'MinecraftFont', 'Courier New', monospace;
    font-size: 1.1rem;
    padding: 10px 20px;
    width: 120px;
    text-align: center;
    background: #0000007d;
    color: var(--primary-color);
    border: 3.15px solid var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(30px);
    border-radius: 0;
    clip-path: polygon(
        8px 0, 100% 0, 100% calc(100% - 8px), 
        calc(100% - 8px) 100%, 0 100%, 0 8px
    );
    box-shadow: 
        -3px 0 0 0 var(--primary-color),
        0 3px 0 0 var(--primary-color);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.3s ease;
    z-index: -1;
}

.cta-button:hover {
    color: var(--dark-bg);
    box-shadow: 
        -3px 0 0 0 var(--primary-color),
        0 3px 0 0 var(--primary-color),
        var(--neon-glow);
}

.cta-button:hover::before {
    left: 0;
}

.cta-button.secondary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cta-button.secondary::before {
    background: var(--primary-color);
}

.cta-button.secondary:hover {
    box-shadow: var(--neon-glow);
    color: var(--dark-bg);
}

/* Typography and Text Styles */
.tagline {
    font-family: 'Born2bSportyFont', 'MinecraftFont', 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--primary-color);
    min-height: 2.5rem;
    line-height: 1.4;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
}

.tagline:hover {
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary-color) 80%, transparent);
    transform: scale(1.02);
}

.tagline::after {
    content: '< / >';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    opacity: 0;
    color: color-mix(in srgb, var(--primary-color) 50%, transparent);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tagline:hover::after {
    opacity: 1;
}

.tagline .dud {
    color: color-mix(in srgb, var(--primary-color) 50%, transparent);
    opacity: 0.6;
}

/* Tagline Container */
/* Removed cursor: pointer from tagline-container - now only on programmer character */
#programmer-character {
    cursor: default;
}

/* Particle System Base */
.particle {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    z-index: 3;
}

/* Canvas Elements */
#neural-network,
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.1;
}

/* Dinosaur Animation Styles */
.programmer-container {
    position: relative;
    height: 156px;
    margin: 2px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    width: 264px;
    overflow: visible;
}

/* Screen flicker background */
.programmer-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.1), rgba(0, 255, 255, 0.05));
    border-radius: 10px;
    animation: screenFlicker 3s ease-in-out infinite;
    z-index: -1;
}

/* Glow effect behind character */
.programmer-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 268px;
    height: 268px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: typingGlow 4s ease-in-out infinite;
    z-index: -1;
}

/* Adjust programmer character position for desktop */
@media (min-width: 769px) {
    .programmer-container {
        margin-bottom: 10px;
    }
}

.programmer-character {
    width: 220px;
    height: 220px;
    margin-bottom: 25px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: filter 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Programmer character breathing animation */
@keyframes breathingAnimation {
    0% { opacity: 1; }
    25% { opacity: 0.9; }
    50% { opacity: 0.8; }
    75% { opacity: 0.9; }
    100% { opacity: 1; }
}

/* Screen flicker animation */
@keyframes screenFlicker {
    0%, 100% { 
        opacity: 0.1;
        transform: scale(1);
    }
    20% { 
        opacity: 0.2;
        transform: scale(1.02);
    }
    40% { 
        opacity: 0.15;
        transform: scale(0.98);
    }
    60% { 
        opacity: 0.25;
        transform: scale(1.01);
    }
    80% { 
        opacity: 0.1;
        transform: scale(1);
    }
}

/* Typing glow effect */
@keyframes typingGlow {
    0%, 100% { 
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }
    25% { 
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1.1);
    }
    50% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.95);
    }
    75% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Typing gesture animation */
@keyframes typingGesture {
    0%, 100% { 
        transform: translateX(0) scale(1) rotate(0deg);
    }
    15% { 
        transform: translateX(-0.3px) scale(0.99) rotate(-0.2deg);
    }
    30% { 
        transform: translateX(0.3px) scale(1.01) rotate(0.2deg);
    }
    45% { 
        transform: translateX(-0.15px) scale(0.995) rotate(-0.1deg);
    }
    60% { 
        transform: translateX(0.15px) scale(1.005) rotate(0.1deg);
    }
    75% { 
        transform: translateX(-0.1px) scale(0.998) rotate(-0.05deg);
    }
    90% { 
        transform: translateX(0.1px) scale(1.002) rotate(0.05deg);
    }
}

/* Matrix rain code symbols */
.programmer-container .code-symbol {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: color-mix(in srgb, var(--primary-color) 80%, transparent);
    pointer-events: none;
    z-index: 1;
    text-shadow: 0 0 5px color-mix(in srgb, var(--primary-color) 60%, transparent);
    opacity: 0;
    animation-fill-mode: both;
}

.programmer-container .code-symbol:nth-child(1) {
    bottom: -20px;
    left: 30px;
    animation: matrixRise 3s linear infinite;
    animation-delay: 0s;
}

.programmer-container .code-symbol:nth-child(2) {
    bottom: -20px;
    right: 40px;
    animation: matrixRise 4s linear infinite;
    animation-delay: 0.8s;
}

.programmer-container .code-symbol:nth-child(3) {
    bottom: -20px;
    left: 60px;
    animation: matrixRise 3.5s linear infinite;
    animation-delay: 1.5s;
}

.programmer-container .code-symbol:nth-child(4) {
    bottom: -20px;
    right: 70px;
    animation: matrixRise 2.8s linear infinite;
    animation-delay: 2.2s;
}

.programmer-container .code-symbol:nth-child(5) {
    bottom: -32px;
    left: 15px;
    animation: matrixRise 3.6s linear infinite;
    animation-delay: 2.8s;
}

.programmer-container .code-symbol:nth-child(6) {
    bottom: -34px;
    right: 25px;
    animation: matrixRise 3.2s linear infinite;
    animation-delay: 1.2s;
}

.programmer-container .code-symbol:nth-child(7) {
    bottom: -38px;
    left: 85px;
    animation: matrixRise 3.9s linear infinite;
    animation-delay: 3.4s;
}

.programmer-container .code-symbol:nth-child(8) {
    bottom: -42px;
    right: 60px;
    animation: matrixRise 3.3s linear infinite;
    animation-delay: 1.9s;
}

.programmer-container .code-symbol:nth-child(9) {
    bottom: -48px;
    left: 45px;
    animation: matrixRise 3.7s linear infinite;
    animation-delay: 0.6s;
}

.programmer-container .code-symbol:nth-child(10) {
    bottom: -50px;
    right: 100px;
    animation: matrixRise 4.1s linear infinite;
    animation-delay: 2.5s;
}

/* Matrix rain falling animation */
@keyframes matrixRise {
    0% { 
        transform: translateY(0);
        opacity: 0;
    }
    10% { 
        opacity: 0.8;
    }
    90% { 
        opacity: 0.4;
    }
    100% { 
        transform: translateY(-140px);
        opacity: 0;
    }
}
