/* ============================================================
   Portfolio — Front-End Stylesheet
   Modern White Glassmorphic | Accent Blue #3b82f6
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

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

:root {
    --bg:         #fbfbfb;
    --glass:      rgba(255,255,255,0.78);
    --border:     rgba(0,0,0,0.06);
    --blue:       #3b82f6;
    --blue-light: rgba(59,130,246,0.1);
    --text:       #1a1a1a;
    --muted:      #64748b;
    --radius-lg:  24px;
    --radius-md:  16px;
    --radius-sm:  12px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── HEADER ──────────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 18px 8%;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 1000;
    background: rgba(251,251,251,0.82);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.03);
}

.logo {
    font-size: 20px; font-weight: 900;
    color: var(--text); text-decoration: none;
    letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px;
}
.logo-accent {
    width: 8px; height: 8px;
    background: var(--blue); border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}

.navbar { display: flex; align-items: center; gap: 8px; }
.navbar a {
    font-size: 14px; font-weight: 500;
    color: var(--muted); text-decoration: none;
    padding: 8px 16px; border-radius: var(--radius-sm);
    transition: .25s;
}
.navbar a:hover, .navbar a.active {
    color: var(--blue); background: var(--blue-light);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    font-size: 26px; color: var(--text);
    padding: 4px;
}

/* Mobile nav drawer */
.mobile-nav {
    display: none;
    position: fixed; top: 0; right: 0;
    width: 70%; max-width: 320px; height: 100vh;
    background: #ffffff; /* Solid background for mobile clarity */
    border-left: 1px solid var(--border);
    z-index: 5000; /* Increased to stay above all elements */
    padding: 80px 30px 30px;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    flex-direction: column;
    gap: 8px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius-sm);
    color: var(--muted); text-decoration: none;
    font-size: 15px; font-weight: 600;
    transition: .2s;
}
.mobile-nav a:hover, .mobile-nav a.active {
    color: var(--blue); background: var(--blue-light);
}
.mobile-nav-close {
    position: absolute; top: 20px; right: 20px;
    background: none; border: none; cursor: pointer;
    font-size: 28px; color: var(--muted);
}
.nav-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); 
    z-index: 4000; /* Sits between content and drawer */
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.nav-overlay.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ── SECTION BASE ────────────────────────────────────────── */
section {
    min-height: 100vh;
    padding: 120px 8% 80px;
}

.section-heading {
    text-align: center;
    margin-bottom: 64px;
}
.section-heading h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900; color: var(--text);
    letter-spacing: -1.5px; line-height: 1.1;
}
.section-heading h2 span { color: var(--blue); }
.section-heading p {
    font-size: 16px; color: var(--muted);
    margin-top: 10px;
}

/* ── HOME SECTION ────────────────────────────────────────── */
.home {
    display: flex; align-items: center;
    background:
        radial-gradient(circle at 75% 25%, rgba(59,130,246,0.07) 0%, transparent 45%),
        radial-gradient(circle at 20% 75%, rgba(59,130,246,0.04) 0%, transparent 40%),
        var(--bg);
}

.home-inner {
    display: flex; align-items: center;
    gap: 60px; width: 100%;
}

.home-content { flex: 1; }

.home-content .greeting {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700;
    color: var(--blue);
    background: var(--blue-light);
    padding: 7px 16px; border-radius: 40px;
    margin-bottom: 22px;
    letter-spacing: 0.5px;
    opacity: 0; animation: fadeUp .6s .2s ease forwards;
}

.home-content h1 {
    font-size: clamp(36px, 5.5vw, 72px);
    font-weight: 900; color: var(--text);
    letter-spacing: -3px; line-height: 1.0;
    margin-bottom: 14px;
    opacity: 0; animation: fadeUp .7s .4s ease forwards;
}

.home-content .type-line {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 600; color: var(--muted);
    margin-bottom: 22px;
    opacity: 0; animation: fadeUp .7s .6s ease forwards;
}
.home-content .type-line .text { color: var(--blue); }

.home-content p {
    font-size: 16px; color: var(--muted);
    max-width: 520px; line-height: 1.8;
    margin-bottom: 36px;
    opacity: 0; animation: fadeUp .7s .7s ease forwards;
}

.home-actions {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 40px;
    opacity: 0; animation: fadeUp .7s .9s ease forwards;
}

.btn-box {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px;
    background: var(--text); color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700;
    text-decoration: none; border: none; cursor: pointer;
    transition: .3s; font-family: inherit;
}
.btn-box:hover {
    background: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(59,130,246,0.3);
}
.btn-outline {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 28px;
    background: transparent; color: var(--text);
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700;
    text-decoration: none; transition: .3s; font-family: inherit;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

.home-sci {
    display: flex; gap: 12px;
    opacity: 0; animation: fadeUp .7s 1.1s ease forwards;
}
.home-sci a {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1.5px solid var(--border);
    border-radius: 12px; font-size: 20px; color: var(--muted);
    text-decoration: none;
    transition: .3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.home-sci a:hover {
    background: var(--blue); color: #fff;
    border-color: var(--blue);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(59,130,246,0.3);
}

/* Profile image - right side */
.home-image {
    flex: 0 0 auto;
    opacity: 0; animation: fadeLeft .8s .4s ease forwards;
}
.home-image-frame {
    width: clamp(280px, 28vw, 400px);
    height: clamp(280px, 28vw, 400px);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: var(--blue-light);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(59,130,246,0.2);
    position: relative;
}
.home-image-frame img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.home-image-frame .no-photo {
    font-size: 80px; color: var(--blue); opacity: 0.4;
}

/* ── ABOUT SECTION ───────────────────────────────────────── */
.about {
    display: flex; align-items: center;
    background: #fff;
}
.about-inner {
    display: flex; align-items: center;
    gap: 80px; width: 100%;
}
.about-image {
    flex: 0 0 auto;
    opacity: 0; animation: fadeRight .8s .3s ease forwards;
}
.about-frame {
    width: clamp(260px, 25vw, 380px);
    height: clamp(260px, 25vw, 380px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--blue-light);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.08);
}
.about-frame img { width: 100%; height: 100%; object-fit: cover; }
.about-frame .no-photo { font-size: 80px; color: var(--blue); opacity: 0.4; }

.about-content { flex: 1; }
.about-content h2 {
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900; letter-spacing: -1.5px;
    line-height: 1.1; margin-bottom: 10px;
    opacity: 0; animation: fadeUp .7s .4s ease forwards;
}
.about-content .role-tag {
    display: inline-block;
    font-size: 15px; font-weight: 700; color: var(--blue);
    background: var(--blue-light); padding: 6px 16px;
    border-radius: 40px; margin-bottom: 22px;
    opacity: 0; animation: fadeUp .7s .5s ease forwards;
}
.about-content p {
    font-size: 16px; color: var(--muted);
    line-height: 1.9; margin-bottom: 32px;
    opacity: 0; animation: fadeUp .7s .7s ease forwards;
}
.about-actions {
    display: flex; gap: 14px; flex-wrap: wrap;
    opacity: 0; animation: fadeUp .7s .9s ease forwards;
}

/* ── SKILLS ──────────────────────────────────────────────── */
.skills { background: var(--bg); }
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}
.skill-card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    transition: .35s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    opacity: 0; animation: fadeUp .6s .3s ease forwards;
}
.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--blue);
    box-shadow: 0 20px 40px rgba(59,130,246,0.12);
}
.skill-card i { font-size: 48px; color: var(--blue); display: block; margin-bottom: 14px; }
.skill-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.skill-level-bar { background: #e5e7eb; border-radius: 20px; height: 5px; margin: 0 auto; max-width: 120px; }
.skill-level-fill { height: 100%; border-radius: 20px; background: var(--blue); }

/* ── PORTFOLIO ───────────────────────────────────────────── */
.portfolio { background: #fff; }
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}
.project-card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: .35s ease;
    opacity: 0; animation: fadeUp .6s .3s ease forwards;
}
.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.10);
    border-color: var(--blue);
}
.project-card img {
    width: 100%; height: 220px; object-fit: cover;
    transition: transform .5s ease;
}
.project-card:hover img { transform: scale(1.07); }
.project-info { padding: 24px; }
.project-category {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--blue); margin-bottom: 8px;
    display: block;
}
.project-info h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.5px; }
.project-info p  { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.project-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--blue); text-decoration: none;
    font-size: 14px; font-weight: 700; transition: gap .2s;
}
.project-link:hover { gap: 10px; }

/* ── GALLERY ─────────────────────────────────────────────── */
.gallery { background: var(--bg); }
.gallery-masonry {
    columns: 3; column-gap: 20px;
}
.gallery-photo {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    cursor: pointer;
}
.gallery-photo img {
    width: 100%; display: block;
    transition: transform .4s ease;
}
.gallery-photo:hover img { transform: scale(1.04); }
.gallery-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    padding: 20px 16px 14px;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.gallery-photo:hover .gallery-overlay { transform: translateY(0); }
.gallery-overlay p { color: #fff; font-size: 13px; font-weight: 600; }
.gallery-overlay span { color: rgba(255,255,255,0.7); font-size: 12px; display: flex; align-items: center; gap: 4px; }

/* ── CONTACT ─────────────────────────────────────────────── */
.contact { background: #fff; }
.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 60px;
    max-width: 960px; margin: 0 auto;
}
.contact-info h3 { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.contact-info p  { font-size: 15px; color: var(--muted); line-height: 1.8; margin-bottom: 32px; }
.contact-detail {
    display: flex; align-items: flex-start; gap: 14px;
    margin-bottom: 20px;
}
.contact-detail-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: var(--blue-light); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--blue);
}
.contact-detail h4 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.contact-detail p  { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 2px; }

.contact-form-wrap {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04);
}
.contact-form-wrap .form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.input-field {
    width: 100%; padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #fff; color: var(--text);
    outline: none; transition: .2s;
    margin-bottom: 16px;
    display: block;
}
.input-field:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
textarea.input-field { resize: none; min-height: 130px; }
.success-banner {
    background: #f0fdf4; color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 600;
    margin-bottom: 20px;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp   { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeLeft { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeRight{ from { opacity:0; transform:translateX(-40px); } to { opacity:1; transform:translateX(0); } }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .home-inner { gap: 40px; }
    .about-inner { gap: 50px; }
    .gallery-masonry { columns: 2; }
    .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Critical Mobile Blur Fix: Remove intensive backdrop filters that cause lag/blur on mobile CPUs */
    * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

    section { padding: 100px 6% 60px; }

    /* Fix Header for Mobile: Use solid background for touch priority */
    .header { 
        padding: 15px 6%; 
        background: #ffffff; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }

    /* Navbar Visibility Fix */
    .navbar { display: none; }
    .nav-toggle { display: block; z-index: 5001; }
    .mobile-nav { display: flex; }
    .nav-overlay { display: block; }

    /* Home Layout Optimization */
    .home-inner { flex-direction: column-reverse; text-align: center; gap: 30px; }
    .home-content p { max-width: 100%; }
    .home-actions { justify-content: center; }
    .home-sci { justify-content: center; }
    .home-image-frame { width: 220px; height: 220px; margin: 0 auto; }

    /* About Layout Optimization */
    .about-inner { flex-direction: column; text-align: center; gap: 36px; }
    .about-frame  { width: 220px; height: 220px; margin: 0 auto; }
    .about-actions { justify-content: center; }

    /* Grid Optimizations */
    .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .portfolio-grid { grid-template-columns: 1fr; gap: 20px; }
    .gallery-masonry { columns: 2; }

    /* Contact Form Optimization */
    .contact-form-wrap .form-row { grid-template-columns: 1fr; }
    .contact-form-wrap { padding: 20px; }
}

@media (max-width: 480px) {
    .home-content h1 { letter-spacing: -1.5px; font-size: 32px; }
    .skills-grid { grid-template-columns: 1fr; }
    .gallery-masonry { columns: 1; }
    .btn-box, .btn-outline { width: 100%; justify-content: center; }
}