@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-bg: #0a0a1a;
    --secondary-bg: #0f0f2a;
    --accent-color: #00bfff;
    --accent-secondary: #7b2ff7;
    --accent-tertiary: #00f5d4;
    --text-color: #e8e8f0;
    --text-muted: #8888a0;
    --card-bg: rgba(15, 15, 40, 0.7);
    --gradient-primary: linear-gradient(135deg, #7b2ff7 0%, #00bfff 50%, #00f5d4 100%);
    --gradient-accent: linear-gradient(135deg, #00bfff 0%, #7b2ff7 100%);
    --gradient-card: linear-gradient(145deg, rgba(20, 20, 60, 0.8), rgba(10, 10, 30, 0.9));
    --gradient-dark: linear-gradient(180deg, #0a0a1a 0%, #0f0f2a 50%, #0a0a1a 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ==================== BACKGROUND EFFECTS ==================== */
.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(123, 47, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 30%, rgba(0, 191, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 245, 212, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(123, 47, 247, 0.04) 0%, transparent 40%);
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(180deg, rgba(10, 10, 26, 0.95), rgba(10, 10, 26, 0.8)) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 1.4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-muted) !important;
    position: relative;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 8px 16px !important;
}

.nav-link:hover {
    color: var(--text-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 60%;
}

.navbar-toggler {
    border: 1px solid var(--glass-border);
}

.navbar-toggler-icon {
    filter: brightness(2);
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 50%, rgba(123, 47, 247, 0.1) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 40%, rgba(0, 191, 255, 0.08) 0%, transparent 50%);
}

.hero-content {
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h2 {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

/* Typing animation for hero subtitle */
.typing-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

.typing-text {
    --typing-chars: 22ch; /* fits "Full Stack Developer" */
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    width: 0ch;
    max-width: var(--typing-chars);
    font-family: 'Fira Code', 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    animation: typingLoop 4.8s steps(22, end) infinite, blinkCaret 0.9s step-end infinite;
}

@keyframes typingLoop {
    0% { width: 0ch; }
    55% { width: var(--typing-chars); }
    78% { width: var(--typing-chars); }
    100% { width: 0ch; }
}

@keyframes blinkCaret {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

.hero .lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 500px;
}

/* Binary animation - KEPT AS-IS per user request */
.binary-animation {
    color: rgba(0, 191, 255, 0.1);
    font-family: monospace;
    font-size: 14px;
    z-index: -1;
    user-select: none;
}

/* Profile Image */
.profile-img-wrapper {
    position: relative;
    display: inline-block;
}

.profile-img-wrapper::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: var(--gradient-primary);
    z-index: -1;
    animation: rotateGradient 4s linear infinite;
}

.profile-img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border: 4px solid var(--primary-bg);
}

@keyframes rotateGradient {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ==================== SECTIONS ==================== */
section {
    padding: 100px 0;
    position: relative;
}

/* About section stacked layout */
#about .row {
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

#about .col-lg-6 {
    max-width: 900px;
    width: 100%;
}

/* Skills section stacked layout */
#skills .row {
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

#skills .col-lg-6,
#skills .col-lg-4,
#skills .col-md-6 {
    max-width: 900px;
    width: 100%;
}

section.bg-secondary {
    background: var(--gradient-dark) !important;
}

.section-title {
    position: relative;
    margin-bottom: 4rem;
    text-align: center;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    display: inline-block;
    position: relative;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    overflow: hidden;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(123, 47, 247, 0.15),
        0 0 30px rgba(0, 191, 255, 0.08);
    border-color: rgba(123, 47, 247, 0.3);
}

.card-header {
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.15), rgba(0, 191, 255, 0.1));
    border-bottom: 1px solid var(--glass-border);
    padding: 18px 24px;
}

.card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-header i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-body {
    padding: 24px;
}

.card-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ==================== CERTIFICATIONS ==================== */
.cert-li {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--glass-bg);
    border: 1px solid transparent;
}

.cert-li:hover {
    background: rgba(123, 47, 247, 0.08);
    border-color: rgba(123, 47, 247, 0.2);
    transform: translateX(5px);
}

.cert-li a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.cert-li a:hover {
    color: var(--accent-color);
}

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ==================== SKILLS ==================== */
.skill-item {
    margin-bottom: 22px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.skill-name span:last-child {
    color: var(--text-muted);
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease-in-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== PROJECTS ==================== */
.project-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    margin-bottom: 14px;
    transition: all 0.3s;
}

.project-link:hover {
    color: var(--accent-tertiary);
    transform: translateX(4px);
}

.project-link i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tech-tags .badge {
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.2), rgba(0, 191, 255, 0.2)) !important;
    color: var(--accent-color) !important;
    border: 1px solid rgba(0, 191, 255, 0.15);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ==================== CONTACT FORM ==================== */
.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(123, 47, 247, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(123, 47, 247, 0.15), 0 0 20px rgba(123, 47, 247, 0.05);
    color: var(--text-color);
}

.btn-primary {
    background: var(--gradient-accent);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px 36px;
    border-radius: 10px;
    transition: all 0.3s;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--gradient-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(123, 47, 247, 0.35), 0 0 40px rgba(0, 191, 255, 0.15);
}

form {
    color: #ffffff;
}

/* ==================== FOOTER ==================== */
footer {
    background: linear-gradient(180deg, var(--secondary-bg), var(--primary-bg));
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--gradient-accent);
    color: #fff;
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(123, 47, 247, 0.3);
}

/* ==================== LOADING SCREEN ==================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a, #0f0f2a);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.starter-animation {
    position: relative;
    width: 600px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.name-container {
    position: relative;
    display: flex;
    gap: 20px;
}

.letter {
    position: relative;
    width: 80px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(123, 47, 247, 0.5));
    opacity: 0;
    transform: translateY(20px);
    animation: letterAppear 0.8s forwards;
}

.letter:nth-child(1) { animation-delay: 0.2s; }
.letter:nth-child(2) { animation-delay: 0.4s; }
.letter:nth-child(3) { animation-delay: 0.6s; }
.letter:nth-child(4) { animation-delay: 0.8s; }

@keyframes letterAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glow-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 47, 247, 0.3) 0%, rgba(0, 191, 255, 0.1) 40%, transparent 70%);
    filter: blur(15px);
    opacity: 0;
    animation: glowPulse 2s infinite 1.5s;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.binary-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.binary-digit {
    position: absolute;
    color: rgba(123, 47, 247, 0.15);
    font-family: monospace;
    font-size: 14px;
    user-select: none;
}

.circuit-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7b2ff7, #00bfff, transparent);
    opacity: 0;
    animation: circuitFlow 3s infinite;
}

.circuit-line:nth-child(1) {
    top: 20%;
    animation-delay: 0.5s;
}

.circuit-line:nth-child(2) {
    bottom: 20%;
    animation-delay: 1s;
}

@keyframes circuitFlow {
    0% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(100%); }
}

.loader {
    position: absolute;
    bottom: 30px;
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--gradient-primary);
    box-shadow: 0 0 15px rgba(123, 47, 247, 0.5);
    animation: loading 2s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(123, 47, 247, 0.6);
    opacity: 0;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7b2ff7, #00bfff, transparent);
    box-shadow: 0 0 15px rgba(123, 47, 247, 0.5);
    opacity: 0;
    animation: scan 4s infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ==================== LINKS ==================== */
a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-color);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-accent);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ==================== SELECTION ==================== */
::selection {
    background: rgba(123, 47, 247, 0.3);
    color: #fff;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .row {
        display: flex;
        flex-direction: column-reverse;
    }

    .btn-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .hero h1 {
        text-align: center;
    }

    .hero h2,
    .hero .lead {
        text-align: center;
        max-width: 100%;
    }

    .typing-wrap {
        width: 100%;
        justify-content: center;
    }

    .profile-img {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 60px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .starter-animation {
        width: 100%;
        height: 200px;
        transform: scale(0.8);
    }

    .letter {
        width: 60px;
        height: 90px;
        font-size: 3.5rem;
    }

    .name-container {
        gap: 10px;
    }

    .loader {
        width: 150px;
        bottom: 20px;
    }

    .profile-img {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .starter-animation {
        transform: scale(0.7);
        height: 180px;
    }

    .letter {
        width: 50px;
        height: 75px;
        font-size: 3rem;
    }

    .name-container {
        gap: 8px;
    }

    .loader {
        width: 120px;
        bottom: 15px;
    }

    .binary-digit {
        font-size: 10px;
    }

    .profile-img {
        width: 180px;
        height: 180px;
    }
}
