@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #060b14;
    --bg2: #0d1526;
    --bg3: #0f1a2e;
    --accent: #00d4ff;
    --accent2: #7c3aed;
    --text: #e2e8f0;
    --muted: #7a8ba0;
    --border: rgba(0, 212, 255, 0.15);
    --card-bg: rgba(13, 21, 38, 0.8);
    --font-main: 'Space Grotesk', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

section, nav, footer { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--accent);
    font-family: var(--font-mono);
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ===== NAVBAR ===== */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    height: 70px;
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
    font-family: var(--font-mono);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-socials { display: flex; gap: 20px; align-items: center; }
.nav-socials a {
    color: var(--muted);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
}
.nav-socials a:hover { color: var(--accent); transform: translateY(-3px); }

/* Upwork nav icon — custom SVG badge */
.nav-upwork {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    color: var(--muted);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 3px;
    padding: 3px 8px;
    text-decoration: none;
    transition: all 0.3s;
}
.nav-upwork:hover {
    color: var(--accent) !important;
    border-color: var(--accent);
    background: rgba(0,212,255,0.06);
    transform: translateY(-2px) !important;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); transition: all 0.3s; }

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px; left: 0; right: 0;
    background: rgba(6, 11, 20, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 30px 5%;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    z-index: 999;
}
.mobile-menu.open { display: flex; }
.mob-link {
    color: var(--muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 18px;
    transition: color 0.3s;
}
.mob-link:hover { color: var(--accent); }

/* ===== SECTIONS ===== */
section { min-height: 100vh; padding: 100px 8% 80px; }

.section-header { margin-bottom: 60px; }
.section-tag {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}
.section-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

/* ===== HOME ===== */
#home {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding-top: 120px;
}

.home-content { flex: 1; max-width: 600px; }

.terminal-tag {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s forwards;
}

.home-title {
    display: flex;
    flex-direction: column;
    font-size: clamp(48px, 7vw, 90px);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 24px;
}
.title-line { opacity: 0; animation: fadeUp 0.6s forwards; }
.title-line:nth-child(1) { animation-delay: 0.3s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }
.title-line.accent { color: var(--accent); }

.typewriter-wrap {
    font-size: clamp(18px, 2.5vw, 26px);
    color: var(--muted);
    margin-bottom: 20px;
    font-family: var(--font-mono);
    opacity: 0;
    animation: fadeUp 0.6s 0.5s forwards;
    min-height: 40px;
}
.tw-cursor { color: var(--accent); }

.home-desc {
    font-size: 17px;
    color: var(--muted);
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeUp 0.6s 0.6s forwards;
    line-height: 1.8;
}

/* ── Consultant badges ── */
.consultant-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.6s 0.65s forwards;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,212,255,0.25);
    color: var(--accent);
    background: rgba(0,212,255,0.05);
}
.badge i { font-size: 10px; }

.home-btns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.6s 0.7s forwards;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    border: none; cursor: pointer;
}
.btn-primary:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,212,255,0.3);
}
.btn-primary.large { padding: 18px 40px; font-size: 16px; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    border: 1px solid var(--accent);
    transition: all 0.3s;
    cursor: pointer;
}
.btn-outline:hover { background: rgba(0,212,255,0.1); transform: translateY(-3px); }

.scroll-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 60px;
    opacity: 0;
    animation: fadeUp 0.6s 0.9s forwards;
}
.scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}
.scroll-line {
    width: 60px; height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:1;width:60px} 50%{opacity:0.4;width:30px} }

.home-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s 0.8s forwards;
}

.car-container { position: relative; width: 100%; max-width: 520px; }
.car-img {
    width: 100%;
    filter: drop-shadow(0 0 40px rgba(0,212,255,0.3));
    animation: carFloat 4s ease-in-out infinite;
}
@keyframes carFloat {
    0%,100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.5deg); }
}
.car-glow {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 70%; height: 20px;
    background: rgba(0,212,255,0.2);
    border-radius: 50%;
    filter: blur(15px);
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100%{opacity:0.6;width:70%} 50%{opacity:1;width:80%} }

.stats-float {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}
.stat-chip {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    transition: all 0.3s;
}
.stat-chip:hover {
    border-color: var(--accent);
    background: rgba(0,212,255,0.1);
    transform: translateY(-3px);
}

/* ===== ABOUT ===== */
#about { padding-top: 100px; }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 80px;
    align-items: start;
}

.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 16px; }
.about-text p strong { color: var(--accent); font-weight: 600; }
.about-intro {
    font-size: 20px !important;
    color: var(--text) !important;
    margin-bottom: 20px !important;
    font-weight: 500;
}

/* Freelance callout */
.freelance-callout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(0,212,255,0.04);
    border: 1px solid rgba(0,212,255,0.2);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 20px 0 28px;
}
.freelance-callout i {
    color: var(--accent);
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}
.freelance-callout p {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.7;
    color: var(--muted);
}
.freelance-callout p strong { color: var(--text) !important; }

.about-tabs { margin-top: 40px; }

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 10px 20px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { width: 100%; }
.tab-btn:hover { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-item {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}
.skill-item i { color: var(--accent); font-size: 16px; }
.skill-item:hover { border-color: var(--accent); background: rgba(0,212,255,0.05); transform: translateX(4px); }

.timeline { display: flex; flex-direction: column; gap: 24px; }
.timeline-item {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--border);
    transition: border-color 0.3s;
}
.timeline-item:hover { border-color: var(--accent); }
.timeline-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}
.timeline-item h4 { color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.timeline-item p { color: var(--muted); font-size: 14px; }

.about-photo-wrap {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.photo-frame {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 340px;
    height: 420px;
}
.photo-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,212,255,0.05), transparent);
    z-index: 1;
    pointer-events: none;
}
.about-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    filter: grayscale(20%);
    transition: filter 0.5s;
}
.about-photo:hover { filter: grayscale(0%); }

.interest-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.interest-tags span {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--muted);
    transition: all 0.3s;
    cursor: default;
}
.interest-tags span:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

/* ===== SECURITY WORK ===== */
#security {
    padding-top: 100px;
    min-height: auto;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 20px;
}

.security-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.security-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.security-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,212,255,0.1);
}
.security-card:hover::before { opacity: 1; }

.security-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.security-icon {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.security-icon i { color: var(--accent); font-size: 20px; }

.severity-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.sev-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 700;
}
.sev-critical { background: rgba(192,57,43,0.2); color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.sev-high { background: rgba(230,126,34,0.15); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.sev-medium { background: rgba(241,196,15,0.1); color: #f1c40f; border: 1px solid rgba(241,196,15,0.2); }
.sev-green { background: rgba(39,174,96,0.1); color: #2ecc71; border: 1px solid rgba(39,174,96,0.2); }

.security-card h3 {
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}
.security-card .card-desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
}

.security-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
}
.meta-row i { color: var(--accent); font-size: 10px; width: 12px; }
.meta-row span { color: var(--text); }

.security-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* ===== PROJECTS ===== */
#projects {
    padding-top: 100px;
    min-height: auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,212,255,0.1);
}
.project-card.featured { border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.04); }

.project-top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-icon i { font-size: 28px; color: var(--accent); }
.project-links { display: flex; gap: 12px; }
.project-links a { color: var(--muted); font-size: 18px; text-decoration: none; transition: color 0.3s, transform 0.3s; }
.project-links a:hover { color: var(--accent); transform: translateY(-2px); }

.project-card h3 { color: var(--text); font-size: 18px; font-weight: 600; }
.project-card p { color: var(--muted); font-size: 14px; line-height: 1.7; flex: 1; }

.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.project-tags span { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 1px; }

.projects-cta { display: flex; justify-content: center; margin-top: 50px; }

/* ===== CONTACT ===== */
#contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 70vh;
    padding-top: 100px;
}

.contact-content { max-width: 600px; }
.contact-desc { font-size: 18px; color: var(--muted); margin-bottom: 40px; line-height: 1.8; }

.contact-socials { display: flex; gap: 30px; margin-top: 30px; flex-wrap: wrap; }
.contact-socials a {
    color: var(--muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s, transform 0.3s;
}
.contact-socials a:hover { color: var(--accent); transform: translateY(-3px); }

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 30px 5%;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
}
footer strong { color: var(--accent); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .about-grid { grid-template-columns: 1fr; gap: 50px; }
    .about-photo-wrap { position: static; align-items: center; flex-direction: row; gap: 30px; flex-wrap: wrap; }
    .photo-frame { max-width: 280px; height: 350px; flex-shrink: 0; }
    .interest-tags { justify-content: flex-start; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .security-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #navbar { padding: 0 5%; }
    .nav-links, .nav-socials { display: none; }
    .hamburger { display: flex; }

    section { padding: 80px 5% 60px; }

    #home { flex-direction: column-reverse; padding-top: 100px; min-height: auto; gap: 40px; text-align: center; }
    .home-content { max-width: 100%; }
    .home-btns { justify-content: center; }
    .consultant-badges { justify-content: center; }
    .scroll-indicator { justify-content: center; }
    .terminal-tag { text-align: left; }

    .home-visual { width: 100%; }
    .car-img { max-width: 380px; margin: 0 auto; display: block; }
    .stats-float { justify-content: center; }

    .about-grid { gap: 40px; }
    .about-photo-wrap { flex-direction: column; align-items: center; }
    .photo-frame { max-width: 260px; height: 320px; margin: 0 auto; }
    .interest-tags { justify-content: center; }

    .security-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }

    .section-title { font-size: 36px; }
    .contact-socials { gap: 20px; }
}

@media (max-width: 480px) {
    #navbar { padding: 0 4%; height: 60px; }
    .nav-logo { font-size: 16px; }

    section { padding: 70px 4% 50px; }

    #home { gap: 30px; padding-top: 90px; }
    .home-title { font-size: 48px; }
    .typewriter-wrap { font-size: 16px; }
    .home-desc { font-size: 15px; }
    .home-btns { flex-direction: column; align-items: center; gap: 14px; }
    .btn-primary, .btn-outline { width: 100%; max-width: 280px; text-align: center; justify-content: center; }
    .stat-chip { font-size: 12px; padding: 6px 14px; }

    .photo-frame { max-width: 220px; height: 280px; }

    .tab-nav { gap: 0; overflow-x: auto; }
    .tab-btn { padding: 10px 14px; font-size: 12px; white-space: nowrap; }

    .skills-grid { grid-template-columns: 1fr; }

    .project-card, .security-card { padding: 20px; }

    .section-title { font-size: 30px; }
    .section-tag { font-size: 12px; }

    .contact-desc { font-size: 16px; }
    .contact-socials { flex-direction: column; gap: 16px; align-items: flex-start; }
    .btn-primary.large { width: 100%; max-width: 280px; justify-content: center; }
}