:root {
    --primary: #0856c8;
    --primary-dark: #064bad;
    --primary-light: #3b82f6;
    --purple: #6c16ac;
    --purple-light: #8b5cf6;
    --text-head: #0856c8;
    --bg-light: #f5f7fa;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Circuit Background Pattern */
.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(8, 86, 200, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(108, 22, 172, 0.04) 0%, transparent 40%);
    z-index: -1;
}

/* Navigation - Enhanced */
.navbar {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark) !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--primary) !important;
}

.nav-link:hover::after {
    width: 60%;
}

/* Hero Section - Enhanced */
.hero {
    min-height: 680px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    right: -100px;
    top: -100px;
}

.hero-content {
    max-width: 52%;
    position: relative;
    z-index: 2;
    padding-top: 60px;
}

.circuit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: white;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.circuit-dot {
    width: 8px;
    height: 8px;
    background: #7dd3fc;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px #7dd3fc; }
    50% { opacity: 0.5; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: clamp(2rem, 2.4vw + 1.6rem, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    color: white;
    animation: fadeInUp 1.2s ease;
}

.hero h1 .highlight {
    color: #7dd3fc;
    display: block;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 480px;
    animation: fadeInUp 1.5s ease;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 1.8s ease;
}

.btn-white {
    background: white;
    color: var(--primary) !important;
    font-weight: 600;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: var(--primary) !important;
}

.btn-outline-white {
    background: transparent;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-weight: 600;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-white:hover {
    background: white;
    color: var(--primary) !important;
    border-color: white;
}

.hero-social {
    display: flex;
    gap: 0.8rem;
    animation: fadeInUp 2s ease;
}

.hero-social a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.hero-social a:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-3px);
}

/* PCB Visual - Enhanced */
.hero-visual {
    max-width: 48%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    z-index: 2;
    align-self: stretch;
    padding-top: 90px;
    animation: fadeInRight 1.5s ease;
}

.hero-profile-img {
    width: min(540px, 43vw);
    max-height: 640px;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.22));
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.pcb-board {
    width: 380px;
    height: 380px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    position: relative;
    backdrop-filter: blur(5px);
}

.pcb-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.05) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(255,255,255,0.05) 50%, transparent 51%);
    background-size: 30px 30px;
}

.pcb-cpu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
    box-shadow: 0 0 30px rgba(125, 211, 252, 0.3);
}

.pcb-trace {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
}

.t1 { width: 65px; height: 2px; top: 50%; left: calc(50% - 70px); }
.t2 { width: 65px; height: 2px; top: 50%; right: calc(50% - 70px); }
.t3 { width: 2px; height: 65px; left: 50%; top: calc(50% - 65px); }
.t4 { width: 2px; height: 65px; left: 50%; bottom: calc(50% - 65px); }

.pcb-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #7dd3fc;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.n1 { top: 18%; left: 22%; }
.n2 { top: 18%; right: 22%; }
.n3 { bottom: 18%; left: 28%; }
.n4 { bottom: 18%; right: 28%; }
.n5 { top: 50%; left: 12%; }
.n6 { top: 50%; right: 12%; }

.pcb-component {
    position: absolute;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.c1 { top: 22%; left: 8%; }
.c2 { top: 22%; right: 8%; }
.c3 { bottom: 22%; left: 8%; }
.c4 { bottom: 22%; right: 8%; }

/* Social Bar */
.social-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.4rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.social-bar a {
    color: var(--primary);
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.social-bar a:hover {
    color: var(--purple);
    transform: translateY(-3px);
}

.social-bar img {
    width: 26px;
    filter: brightness(0) saturate(100%) invert(28%) sepia(91%) saturate(745%) hue-rotate(180deg);
}

/* Sections */
section {
    padding: 5.5rem 0;
}

.section-white {
    background-color: var(--white);
}

.section-light {
    background-color: var(--bg-light);
}

.section-gradient {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
}

.section-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.section-title .highlight {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-gradient .section-title {
    color: white;
}

.section-gradient .section-title .highlight {
    color: #7dd3fc;
}

/* Make all text white in gradient section */
.section-gradient .project-card h3,
.section-gradient .project-card .project-role,
.section-gradient .project-card .project-desc {
    color: white;
}

.section-gradient .project-card .project-tech span {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* About Section - Enhanced */
.about-frame {
    display: inline-block;
    position: relative;
}

.frame-inner {
    width: 300px;
    height: 340px;
    background: var(--bg-light);
    border: 3px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.frame-inner::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--primary);
    border-radius: 12px;
    opacity: 0.3;
}

.about-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.frame-inner .award-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    color: #78350f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 15px rgba(251, 191, 36, 0.4);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.6rem 0;
}

.stat-box {
    text-align: center;
    min-width: 0;
    padding: 0.75rem 0.55rem;
    background: var(--bg-light);
    border-radius: 10px;
}

.stat-num {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-muted);
}

.btn-download {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white !important;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(8, 86, 200, 0.35);
    color: white;
}

/* Credentials - Enhanced */
.credential-card {
    height: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.credential-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.credential-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(8, 86, 200, 0.08), rgba(108, 22, 172, 0.1));
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-size: 2rem;
}

.credential-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 0.6rem;
}

.credential-body {
    padding: 1.6rem;
}

.credential-type {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.credential-card h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.credential-source {
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.credential-card p:last-child {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Skills - Enhanced */
.skill-category {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(8, 86, 200, 0.1), rgba(108, 22, 172, 0.1));
    border: 2px solid var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    color: var(--text-dark);
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-point {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tools - Enhanced */
.tool-group {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.8rem;
    transition: all 0.3s ease;
}

.tool-group:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.tool-group h4 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--primary);
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-tag {
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.tool-tag:hover {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    border-color: transparent;
}

/* Projects - Enhanced Grid */
.project-carousel {
    padding: 0 3.5rem 3rem;
}

.project-carousel .carousel-inner {
    overflow: visible;
}

.project-carousel .carousel-indicators {
    bottom: -3rem;
    margin-bottom: 0;
}

.project-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    opacity: 0.55;
}

.project-carousel .carousel-indicators .active {
    opacity: 1;
}

.project-carousel .carousel-control-prev,
.project-carousel .carousel-control-next {
    width: 3rem;
}

.project-carousel .carousel-control-prev {
    left: -0.5rem;
}

.project-carousel .carousel-control-next {
    right: -0.5rem;
}

.section-gradient .project-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    height: 100%;
}

.section-gradient .project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    background: white;
}

.section-gradient .project-img {
    aspect-ratio: 16 / 10;
    min-height: 190px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.section-gradient .project-img::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.section-gradient .project-img i {
    font-size: 3.2rem;
    color: white;
}

.section-gradient .project-img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.section-gradient .project-content {
    padding: 1.8rem;
    position: relative;
}

.section-gradient .project-card .project-badge {
    position: absolute;
    top: -12px;
    right: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 10px rgba(8, 86, 200, 0.3);
}

.section-gradient .project-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.section-gradient .project-card .project-role {
    font-size: 0.85rem;
    color: var(--purple);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.section-gradient .project-card .project-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.section-gradient .project-card .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.section-gradient .project-card .project-tech span {
    background: rgba(108, 22, 172, 0.08);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--purple);
    font-weight: 500;
}

/* Contact - Enhanced */
.contact-form .form-control {
    background: var(--white);
    border: 2px solid var(--border);
    color: var(--text-dark);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(8, 86, 200, 0.1);
}

.contact-form .form-control::placeholder {
    color: var(--text-muted);
}

/* Footer - Enhanced */
footer {
    background: #1e1e3f;
    color: white;
    padding: 2.5rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.footer-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.footer-copy p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

.footer-copy i {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 991px) {
    .hero {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 120px 5% 60px;
    }
    
    .hero-content {
        max-width: 100%;
        padding-top: 0;
    }

    .hero-subtitle {
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-visual {
        max-width: 100%;
        margin-top: 2.5rem;
        align-self: center;
        padding-top: 0;
    }

    .hero-profile-img {
        width: min(390px, 88vw);
        max-height: 470px;
    }

    .stats-row {
        grid-template-columns: repeat(2, minmax(0, 150px));
        justify-content: center;
    }

    .project-carousel {
        padding: 0 2.5rem 3rem;
    }
    
    .pcb-board {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 767px) {
    .section-title {
        font-size: 1.9rem;
    }
    
    .stats-row {
        gap: 0.6rem;
    }

    .stat-box {
        padding: 0.7rem 0.45rem;
    }

    .stat-num {
        font-size: 1.45rem;
    }

    .stat-label {
        font-size: 0.68rem;
    }

    .project-carousel {
        padding: 0 0 3rem;
    }

    .project-carousel .carousel-control-prev,
    .project-carousel .carousel-control-next {
        top: auto;
        bottom: -0.4rem;
        width: 2.6rem;
        height: 2.6rem;
    }

    .project-carousel .carousel-control-prev {
        left: 1rem;
    }

    .project-carousel .carousel-control-next {
        right: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}
