:root {
    --brand-1: #6d5efc;
    --brand-2: #4ec9f5;
    --brand-3: #1f2a44;
    --brand-4: #0b1120;
    --brand-5: #eef3ff;
    --brand-6: #ff7a59;
    --text-main: #18212f;
    --text-soft: #5f6b7a;
    --shadow-soft: 0 18px 40px rgba(25, 39, 77, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    margin: 0;
    padding-top: 78px;
    background: linear-gradient(180deg, #f5f7ff 0%, #edf8ff 100%);
    color: var(--text-main);
}

header {
    background: transparent;
}

.navbar {
    background: linear-gradient(135deg, rgba(27, 32, 68, 0.98), rgba(109, 94, 252, 0.92)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(27, 32, 68, 0.2);
}

.navbar-brand,
.navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar-brand {
    min-width: 0;
    white-space: normal;
}

.nav-logo {
    display: block;
    width: auto;
    height: 45px;
    object-fit: contain;
    padding: 0.3rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(5, 12, 35, 0.22);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    opacity: 1;
    transform: translateY(-1px);
    color: var(--brand-2) !important;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.25);
}

.section-shell {
    padding: 5rem 1rem;
}

.hero-panel {
    background: linear-gradient(135deg, rgba(109, 94, 252, 0.12), rgba(78, 201, 245, 0.12));
    border: 1px solid rgba(109, 94, 252, 0.15);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--brand-3);
    line-height: 1.1;
}

.hero-copy .lead {
    color: var(--text-soft);
    font-size: 1.08rem;
    max-width: 620px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(109, 94, 252, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(109, 94, 252, 0.3);
}

.btn-outline-primary {
    border-radius: 999px;
    border-width: 2px;
    color: var(--brand-1);
    border-color: var(--brand-1);
    padding: 0.85rem 1.5rem;
    font-weight: 700;
}

.btn-outline-primary:hover {
    background: var(--brand-1);
    border-color: var(--brand-1);
    color: #fff;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tech-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(109, 94, 252, 0.18);
    background: rgba(255, 255, 255, 0.7);
    color: var(--brand-3);
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(109, 94, 252, 0.08);
    animation: floatTag 5s ease-in-out infinite;
}

.tech-pill:nth-child(2) { animation-delay: 0.5s; }
.tech-pill:nth-child(3) { animation-delay: 1s; }
.tech-pill:nth-child(4) { animation-delay: 1.5s; }
.tech-pill:nth-child(5) { animation-delay: 2s; }

@keyframes floatTag {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
}

.hero-image-wrap {
    position: relative;
    width: min(100%, 480px);
    padding: 1rem;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(109, 94, 252, 0.18), rgba(78, 201, 245, 0.18));
    box-shadow: var(--shadow-soft);
}

.hero-image {
    display: block;
    width: 100%;
    height: 520px;
    object-fit: cover;
    border-radius: 24px;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 45px rgba(31, 42, 68, 0.18);
}

.hero-badge {
    position: absolute;
    right: -12px;
    bottom: 22px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    border-radius: 18px;
    padding: 0.8rem 1rem;
    font-weight: 700;
    box-shadow: 0 18px 30px rgba(109, 94, 252, 0.3);
    animation: pulseBadge 2.4s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.typing-wrapper {
    margin-top: 1rem;
    font-size: clamp(1.1rem, 2vw, 1.65rem);
    font-weight: 800;
    min-height: 3.2rem;
    position: relative;
    display: inline-block;
    color: var(--brand-1);
}

.typing-text-1,
.typing-text-2 {
    display: block;
    min-height: 2.2rem;
}

.typing-text-1 {
    color: var(--brand-1);
    text-shadow: 0 0 18px rgba(109, 94, 252, 0.2);
    animation: cycleText1 6s infinite;
}

.typing-text-2 {
    position: absolute;
    inset: 0;
    color: var(--brand-2);
    text-shadow: 0 0 18px rgba(78, 201, 245, 0.2);
    animation: cycleText2 6s infinite;
}

@keyframes cycleText1 {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
}

@keyframes cycleText2 {
    0%, 45% { opacity: 0; }
    50%, 95% { opacity: 1; }
}

.stat-box {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(109, 94, 252, 0.12);
    border-radius: 18px;
    padding: 1rem 0.8rem;
    box-shadow: 0 10px 25px rgba(31, 42, 68, 0.06);
}

.stat-box h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--brand-1);
    margin-bottom: 0.3rem;
}

.stat-box p {
    color: var(--text-soft);
    margin: 0;
}

.section-title {
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    color: var(--brand-3);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-soft);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.cta-section {
    background: linear-gradient(135deg, #e9edff 0%, #e8f7fb 100%);
    border-top: 1px solid rgba(109, 94, 252, 0.1);
    border-bottom: 1px solid rgba(109, 94, 252, 0.1);
    color: var(--brand-3);
}

.cta-section h2 {
    color: var(--brand-3);
    font-weight: 800;
}

.cta-section p {
    color: var(--text-soft);
}

.card {
    border: none;
    border-radius: 22px;
    box-shadow: 0 16px 32px rgba(31, 42, 68, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.skill-card {
    border: 1px solid rgba(109, 94, 252, 0.1);
    background: linear-gradient(180deg, #fff, #f5f7ff);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 30px rgba(98, 107, 194, 0.12);
}

.page-hero {
    padding: 4rem 0 2rem;
}

.page-badge {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: rgba(109, 94, 252, 0.12);
    color: var(--brand-1);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.info-card {
    background: linear-gradient(135deg, #ffffff, #f3f7ff);
    border: 1px solid rgba(109, 94, 252, 0.1);
    border-radius: 24px;
    box-shadow: 0 18px 30px rgba(31, 42, 68, 0.06);
    padding: 2rem;
}

.contact-list-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(109, 94, 252, 0.08);
    margin-bottom: 1rem;
}

.contact-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background: linear-gradient(135deg, rgba(109, 94, 252, 0.14), rgba(78, 201, 245, 0.14));
    color: var(--brand-1);
    font-size: 1.3rem;
}

.project-card {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 35px rgba(31, 42, 68, 0.08);
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 40px rgba(31, 42, 68, 0.12);
}

.project-badge {
    display: inline-flex;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(78, 201, 245, 0.12);
    color: #0a6f8a;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.form-control {
    border-radius: 14px;
    border: 1px solid rgba(109, 94, 252, 0.15);
    background: #f7f9ff;
    padding: 0.9rem 1rem;
}

form .btn-primary {
    width: 100%;
    border-radius: 14px;
}

footer {
    background: linear-gradient(135deg, #0c1427 0%, #171f38 100%);
    color: #fff;
    padding: 3rem 0 2rem;
    text-align: left;
}

footer a {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
}

footer a:hover {
    opacity: 1;
    color: var(--brand-2);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    transition: transform 0.2s ease, background 0.2s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    background: rgba(109, 94, 252, 0.2);
}

@media (max-width: 768px) {
    body {
        padding-top: 66px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar .container {
        align-items: center;
        flex-wrap: wrap !important;
    }

    .navbar-brand {
        flex: 1 1 0;
        width: 0;
        max-width: none;
        margin-right: 0.75rem;
        font-size: 0.95rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .nav-logo {
        width: auto;
        height: 45px;
    }

    .navbar-toggler {
        flex: 0 0 auto;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        margin-top: 0.75rem;
        padding: 0.45rem;
        text-align: center;
        background: rgba(10, 16, 45, 0.38);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 16px;
        box-shadow: 0 14px 28px rgba(8, 12, 35, 0.2);
    }

    .navbar-nav {
        align-items: center;
    }

    .navbar-nav .nav-link {
        padding: 0.65rem 0;
        text-align: center;
    }

    .hero-visual {
        min-height: auto;
        margin-top: 1.5rem;
    }

    .hero-image-wrap {
        width: min(100%, 320px);
        padding: 0.75rem;
        border-radius: 24px;
    }

    .hero-image-wrap > img {
        display: block;
        width: 100%;
        max-width: none !important;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
    }

    .hero-badge {
        right: -4px;
        bottom: 12px;
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .section-shell {
        padding: 4rem 1rem;
    }

    .hero-panel {
        border-radius: 20px;
    }

    .hero-copy h1 {
        font-size: clamp(2.15rem, 10vw, 3rem);
    }

    .hero-copy .lead {
        font-size: 1rem;
    }

    .tech-stack {
        justify-content: center;
        gap: 0.5rem;
    }

    .tech-pill {
        padding: 0.55rem 0.8rem;
    }

    .stat-box {
        padding: 0.8rem 0.35rem;
    }

    .stat-box h3 {
        font-size: 1.35rem;
    }

    .stat-box p {
        font-size: 0.8rem;
    }

    .info-card,
    .project-card .card-body {
        padding: 1.25rem !important;
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    footer {
        text-align: center;
    }

    footer .social-links,
    footer .d-flex {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding-top: 2.5rem;
    }

    .page-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .hero-copy .btn {
        width: 100%;
    }

    .hero-copy .d-flex {
        gap: 0.65rem !important;
    }

    .typing-wrapper {
        font-size: 1rem;
    }

    .contact-list-item {
        align-items: flex-start;
        padding: 0.85rem;
    }

    .contact-icon {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-right: 0.75rem;
    }
}
