:root {
    --fl-primary: #5956e9;
    --fl-primary-dark: #4a47d4;
    --fl-dark: #111827;
    --fl-card: #ffffff;
    --fl-card-soft: #f8fafc;
    --fl-text: #1f2937;
    --fl-muted: #6b7280;
    --fl-border: #e5e7eb;
    --fl-shell: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    height: 100%;
}

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--fl-text);
    background: var(--fl-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #111827 0%, #1f2937 40%, #312e81 70%, #111827 100%);
    background-size: 400% 400%;
    animation: gradientShift 14s ease infinite;
}

.bg-gradient::before,
.bg-gradient::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .35;
    animation: floatOrb 10s ease-in-out infinite alternate;
}

.bg-gradient::before {
    width: 420px;
    height: 420px;
    background: rgba(89, 86, 233, .35);
    top: -80px;
    right: 8%;
}

.bg-gradient::after {
    width: 360px;
    height: 360px;
    background: rgba(129, 140, 248, .25);
    bottom: -60px;
    left: 6%;
    animation-delay: -4s;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatOrb {
    from { transform: translateY(0); }
    to { transform: translateY(24px); }
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--fl-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .45s ease, visibility .45s ease;
}

.preloader.hidden { opacity: 0; visibility: hidden; }

.preloader-ring {
    width: 54px;
    height: 54px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: var(--fl-primary);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.vcard {
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 100vh;
    height: 100vh;
    background: rgba(17, 24, 39, 0.96);
    border: none;
    border-right: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    animation: cardIn .8s ease both;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.vcard-photo {
    padding: 1.75rem 1.25rem 0;
    text-align: center;
}

.vcard-photo img {
    width: min(100%, 270px);
    height: 270px;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto;
    border-radius: 24px;
    background: #fff;
    border: 4px solid rgba(89, 86, 233, .25);
}

.vcard-body {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
    color: #fff;
}

.vcard-body h1 {
    margin: 0 0 .35rem;
    font-size: 1.55rem;
    font-weight: 800;
}

.vcard-role {
    color: #c7d2fe;
    font-size: .92rem;
    min-height: 1.4rem;
    margin-bottom: 1rem;
}

.vcard-social {
    display: flex;
    justify-content: center;
    gap: .65rem;
    margin-bottom: 1.25rem;
}

.vcard-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c7d2fe;
    transition: .25s;
}

.vcard-social a:hover {
    background: var(--fl-primary);
    border-color: var(--fl-primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background: var(--fl-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .85rem 1.45rem;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: transform .2s, box-shadow .2s;
}

.btn-primary:hover {
    background: var(--fl-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(89, 86, 233, .35);
}

.content-wrap {
    animation: contentIn .9s ease .15s both;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow: hidden;
}

@keyframes contentIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: 1.25rem;
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: .75rem;
    backdrop-filter: blur(10px);
}

.section-nav button {
    flex: 1 1 auto;
    min-width: 96px;
    border: none;
    background: transparent;
    color: #c7d2fe;
    border-radius: 12px;
    padding: .75rem .85rem;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: .25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.section-nav button:hover,
.section-nav button.active {
    background: var(--fl-primary);
    color: #fff;
}

.content-card {
    background: var(--fl-card);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    padding: 2rem;
    animation-duration: .55s;
    animation-fill-mode: both;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.page.active { display: block; }
.page.enter-fade { animation-name: pageFadeIn; }
.page.leave-fade { animation-name: pageFadeOut; }

.page-head {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--fl-border);
}

.kicker {
    color: var(--fl-primary);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .35rem;
}

.page-head h2 {
    margin: 0 0 .5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
}

.page-head p {
    margin: 0;
    color: var(--fl-muted);
    max-width: 680px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.about-grid h3 {
    margin: 0 0 1rem;
    font-size: 1.45rem;
    font-weight: 800;
}

.about-grid p { color: var(--fl-muted); margin: 0; }

.skill-card + .skill-card { margin-top: 1rem; }

.skill-card .label {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: .45rem;
    font-size: .9rem;
}

.skill-card .bar {
    height: 8px;
    background: #eef2ff;
    border-radius: 999px;
    overflow: hidden;
}

.skill-card .bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--fl-primary), #818cf8);
    border-radius: 999px;
    transition: width 1.2s ease;
}

.skill-card.animate .bar span { width: var(--percent); }

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.service-card {
    background: var(--fl-card-soft);
    border: 1px solid var(--fl-border);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    transition: transform .25s, box-shadow .25s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(89, 86, 233, .12);
}

.service-card i {
    font-size: 1.75rem;
    color: var(--fl-primary);
    margin-bottom: .85rem;
    display: inline-block;
}

.service-card h4 { margin: 0 0 .65rem; font-size: 1rem; }
.service-card p { margin: 0; color: var(--fl-muted); font-size: .88rem; }

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    border: 1px solid var(--fl-border);
    background: #fff;
    color: var(--fl-muted);
    font-weight: 600;
    padding: .5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: .82rem;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--fl-primary);
    border-color: var(--fl-primary);
    color: #fff;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 11;
    background: #e5e7eb;
}

.portfolio-item.hidden { display: none; }

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.portfolio-item:hover img { transform: scale(1.05); }

.portfolio-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(17,24,39,.88));
    color: #fff;
}

.portfolio-overlay h4 { margin: 0 0 .15rem; font-size: .95rem; }
.portfolio-overlay span { font-size: .78rem; opacity: .85; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.pricing-card {
    background: var(--fl-card-soft);
    border: 1px solid var(--fl-border);
    border-radius: 18px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    position: relative;
    height: auto;
}

.pricing-card.featured {
    border-color: var(--fl-primary);
    box-shadow: 0 20px 50px rgba(89, 86, 233, .15);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fl-primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .35rem .85rem;
    border-radius: 999px;
}

.pricing-card h4 { margin: 0 0 .5rem; }
.pricing-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--fl-primary);
    margin: .5rem 0 1rem;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    text-align: left;
}

.pricing-card li {
    padding: .35rem 0;
    color: var(--fl-muted);
    font-size: .86rem;
    border-bottom: 1px solid #f3f4f6;
}

.pricing-card li::before {
    content: '✓';
    color: var(--fl-primary);
    font-weight: 700;
    margin-right: .5rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.testimonial-card {
    background: var(--fl-card-soft);
    border: 1px solid var(--fl-border);
    border-radius: 16px;
    padding: 1.35rem;
}

.testimonial-card h4 { margin: 0 0 .15rem; font-size: .95rem; }
.testimonial-card span { color: var(--fl-primary); font-size: .78rem; font-weight: 600; }
.testimonial-card p { color: var(--fl-muted); font-size: .88rem; margin: .85rem 0 0; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
    margin-top: 1.5rem;
}

.stat-box {
    text-align: center;
    padding: 1rem .75rem;
    border-radius: 14px;
    background: var(--fl-card-soft);
    border: 1px solid var(--fl-border);
    height: auto;
    align-self: start;
}

.stat-box i {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(89, 86, 233, .12);
    color: var(--fl-primary);
    margin-bottom: .55rem;
}

.stat-box strong {
    display: block;
    font-size: 1.45rem;
    color: var(--fl-primary);
    line-height: 1.1;
}

.stat-box span {
    display: block;
    color: var(--fl-muted);
    font-size: .78rem;
    line-height: 1.3;
}

.experience-list { max-width: 100%; }

.experience-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--fl-border);
}

.experience-item:last-child { border-bottom: none; }

.experience-num {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--fl-primary);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.experience-item h4 { margin: 0 0 .15rem; font-size: 1rem; }
.experience-item .company { color: var(--fl-primary); font-weight: 600; margin-bottom: .45rem; font-size: .88rem; }
.experience-item p { margin: 0; color: var(--fl-muted); font-size: .88rem; }

.cta-box {
    background: linear-gradient(135deg, var(--fl-primary), #818cf8);
    border-radius: 20px;
    padding: 2.5rem 1.75rem;
    text-align: center;
    color: #fff;
}

.cta-box h3 { margin: 0 0 .75rem; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.cta-box p {
    margin: 0 auto 1.25rem;
    color: rgba(255,255,255,.88);
    max-width: 520px;
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 120;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(17,24,39,.92);
    color: #fff;
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        padding-top: 4.5rem;
    }

    .vcard {
        position: relative;
        top: 0;
        min-height: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .content-wrap {
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 1rem;
    }

    .content-card {
        min-height: 520px;
    }
    .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .app-shell.collapsed .vcard { display: none; }

    .about-grid,
    .services-grid,
    .portfolio-grid,
    .pricing-grid,
    .testimonials-grid,
    .stats-row { grid-template-columns: 1fr; }

    .section-nav button { min-width: calc(50% - .5rem); }
}
