/* ==========================================================================
   MAIN.CSS - Global Styles, Design Tokens, Typography, Utility & Footer
   ========================================================================== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    background: #050505;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Utility for Screen Readers (Accessibility 100) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === ROOT VARIABLES (COMPLETE THEME PRESERVED) === */
:root {
    --primary: #00d2ff;
    --secondary: #8a2be2;
    --accent: #ff007f;
    --dark: #020205;
    --light: #f5f5f7;
    --terminal-text: #00ff41;
    --success: #00ffb3;
    --neon-blue: #00d2ff;
    --neon-pink: #ff007f;
    --neon-green: #00ff41;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.terminal-text, .prompt, .command, .tag, .skill-badge, code, pre, .terminal-command {
    font-family: 'JetBrains Mono', monospace;
}

body {
    background: #080b14 !important;
    color: var(--light);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Off-Screen Section Optimization for Butter-Smooth 144Hz Scrolling */
#about,
#skills,
#projects,
#freelance,
#achievements,
#contact {
    content-visibility: auto;
    contain-intrinsic-size: 1px 700px;
}

/* Isolate Repaint Boundaries on Heavy Cards */
.project-card,
.freelance-card,
.cert-card,
.coding-profile-card,
.skill-icon-card {
    contain: layout style;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Terminal scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #030308; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary), var(--secondary)); border-radius: 4px; }

/* === ACTIVE CINEMATIC BACKGROUND CANVAS & LAYERS === */
#background-canvas {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important;
    pointer-events: none !important;
    background: transparent !important;
}

.ambient-glow-layer {
    display: block !important;
}

.fog-vapor-layer {
    display: block !important;
}

.cinematic-vignette {
    display: block !important;
}

/* === SECTIONS & TITLES === */
section { 
    padding: 5rem 5%;
    background: transparent !important;
}

.section-title { 
    font-size: clamp(1.8rem, 4vw, 2.5rem); 
    font-weight: 800; 
    margin-bottom: 2.5rem; 
    position: relative; 
    display: block; 
    width: fit-content; 
    margin-left: auto; 
    margin-right: auto; 
    text-align: center; 
}

.section-title::after { 
    content: ''; 
    position: absolute; 
    bottom: -10px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 60%; 
    height: 3px; 
    background: linear-gradient(90deg, var(--primary), var(--secondary)); 
    animation: expand 2s ease-in-out infinite alternate; 
}

@keyframes expand { from { width: 40%; } to { width: 80%; } }

/* All Subheadings Centered Across Sections */
.section-subtitle,
.about-subtitle,
.skills-subtitle,
.contact-info h3,
.contact-info > p,
.contact-form h3,
.coding-profiles-title {
    text-align: center !important;
}

.about-content { display: flex; gap: 3rem; align-items: center; }
.about-text { flex: 1; }
.about-text p { margin-bottom: 1.5rem; font-size: 1.05rem; }

/* Buttons */
.cta-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn { padding: 0.8rem 1.6rem; border-radius: 6px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-align: center; min-height: 44px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #ffffff; border: none; box-shadow: 0 0 10px rgba(0, 210, 255, 0.2); }
.btn-primary:hover { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #ffffff; box-shadow: 0 0 20px rgba(138, 43, 226, 0.4), 0 0 40px rgba(0, 210, 255, 0.2); transform: translateY(-3px); }
.btn-secondary { background-color: rgba(10, 12, 24, 0.5); color: var(--primary); border: 2px solid var(--primary); backdrop-filter: blur(10px); }
.btn-secondary:hover { background-color: var(--primary); color: var(--dark); box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); transform: translateY(-3px); }

/* Contact Section */
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-info h3 { font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--primary); font-weight: 700; }
.social-links { display: flex; gap: 0.9rem; margin-top: 1.5rem; flex-wrap: wrap; }
.social-icon { 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    background: rgba(13, 20, 36, 0.92); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: var(--primary); 
    font-size: 1.3rem; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    text-decoration: none; 
    border: 1px solid rgba(0, 247, 255, 0.35); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1); 
}
.social-icon:hover { 
    background: rgba(20, 32, 58, 0.98); 
    border-color: var(--primary); 
    color: var(--primary); 
    transform: translateY(-4px) scale(1.08); 
    box-shadow: 0 6px 20px rgba(0, 247, 255, 0.45), inset 0 0 10px rgba(0, 247, 255, 0.2); 
}
.social-icon img, .social-icon .social-img-icon { 
    width: 26px; 
    height: 26px; 
    object-fit: contain; 
    border-radius: 4px; 
    transition: transform 0.3s ease; 
    display: block; 
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); 
}
.social-icon:hover img, .social-icon:hover .social-img-icon { 
    transform: scale(1.15); 
}
.terminal-command { background: rgba(0, 0, 0, 0.3); padding: 1rem; border-radius: 8px; margin-bottom: 1rem; border-left: 3px solid var(--primary); }
.command-line { display: flex; align-items: center; margin-bottom: 0.5rem; }
.prompt { color: var(--terminal-text); margin-right: 0.5rem; }
.command { color: var(--light); }
.contact-form { background: rgba(20, 20, 30, 0.7); border: 1px solid rgba(0, 247, 255, 0.2); border-radius: 14px; padding: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.85rem 1rem; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(0, 247, 255, 0.2); border-radius: 8px; color: var(--light); font-size: 0.95rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 10px rgba(0, 247, 255, 0.15); }

/* Footer */
footer { text-align: center; padding: 2rem; background: rgba(10, 10, 20, 0.95); border-top: 1px solid rgba(0, 247, 255, 0.3); margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }

/* Live Visitor & Page Views Counter Pill */
.visitor-counter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(18, 18, 36, 0.9);
    border: 1px solid rgba(0, 247, 255, 0.35);
    padding: 0.45rem 1.1rem;
    border-radius: 30px;
    font-size: 0.88rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 247, 255, 0.2);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease;
}

.visitor-counter-pill:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: var(--primary);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: livePulse 1.6s infinite alternate;
}

@keyframes livePulse {
    from { opacity: 0.4; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.2); }
}
