/* ========== THEME ========== */
:root {
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --card: #111c33;
    --border: #1e2b47;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #0078d4;
    --accent: #38bdf8;
    --gradient: linear-gradient(135deg, #0078d4, #38bdf8);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --radius: 14px;
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-alt: #eef4fb;
    --card: #ffffff;
    --border: #dbe4ef;
    --text: #0f172a;
    --muted: #475569;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
.container { width: 90%; max-width: 1150px; margin: 0 auto; }

/* ========== SCROLL PROGRESS ========== */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--gradient); z-index: 1001;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 18px 0; transition: all 0.3s;
}
.navbar.scrolled {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-link {
    color: var(--muted); font-weight: 500; font-size: 0.95rem;
    padding: 8px 12px; border-radius: 8px; transition: 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--card); }

.nav-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card);
    color: var(--text); font-size: 1.1rem; cursor: pointer;
}
.menu-btn { display: none; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-block; padding: 13px 26px; border-radius: 10px;
    font-weight: 600; transition: 0.25s; cursor: pointer; border: none;
    font-size: 1rem; font-family: inherit;
}
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0, 120, 212, 0.4); }
.btn-outline { border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #0b1120; }
.full { width: 100%; }

/* ========== HERO ========== */
.hero {
    min-height: 100vh; padding: 130px 0 60px;
    display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(0, 120, 212, 0.18), transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(56, 189, 248, 0.12), transparent 40%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.eyebrow { color: var(--accent); font-family: "JetBrains Mono", monospace; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.15; font-weight: 800; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.typing-line { font-size: clamp(1.2rem, 2.5vw, 1.6rem); color: var(--muted); margin: 14px 0 18px; min-height: 2.4rem; }
.cursor { color: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-description { color: var(--muted); max-width: 560px; margin-bottom: 30px; font-size: 1.05rem; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-links { display: flex; gap: 22px; margin-top: 28px; flex-wrap: wrap; font-weight: 500; }
.location { color: var(--muted); }

/* ========== TERMINAL ========== */
.terminal {
    background: #0a0f1c; border: 1px solid #1e2b47; border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    font-family: "JetBrains Mono", monospace; font-size: 0.88rem; color: #cbd5e1;
}
.terminal-header { display: flex; align-items: center; gap: 7px; padding: 12px 15px; background: #111827; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ef4444; } .yellow { background: #f59e0b; } .green { background: #22c55e; }
.terminal-title { margin-left: 10px; color: #64748b; font-size: 0.8rem; }
.terminal-body { padding: 16px; height: 260px; overflow-y: auto; }
.terminal-body p { margin-bottom: 6px; white-space: pre-wrap; }
.term-muted { color: #64748b; }
.term-cmd { color: #38bdf8; }
.term-out { color: #a5f3fc; }
.term-err { color: #f87171; }
.terminal-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #1e2b47; }
.prompt { color: #22c55e; }
.terminal-input input {
    flex: 1; background: transparent; border: none; outline: none;
    color: #e2e8f0; font-family: inherit; font-size: inherit;
}

/* ========== STATS ========== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 70px; }
.stat {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
}
.counter { font-size: 2.2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat p { color: var(--muted); font-size: 0.9rem; }

/* ========== SECTIONS ========== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-heading { text-align: center; margin-bottom: 50px; }
.section-label {
    color: var(--accent); font-family: "JetBrains Mono", monospace;
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem;
}
.section-heading h2, .contact-info h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 6px 0; }
.section-heading p { color: var(--muted); }

/* ========== ABOUT ========== */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; }
.about-text strong { color: var(--text); }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mini-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; transition: 0.3s;
}
.mini-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.mini-card span { font-size: 1.6rem; }
.mini-card h3 { margin: 6px 0 4px; }
.mini-card p { color: var(--muted); font-size: 0.9rem; }

/* ========== SKILLS ========== */
.filter-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter-btn {
    padding: 9px 18px; border-radius: 30px; border: 1px solid var(--border);
    background: var(--card); color: var(--muted); cursor: pointer;
    font-family: inherit; font-weight: 500; transition: 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--gradient); color: #fff; border-color: transparent; }

.skills-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 60px; }
.skill-chip {
    padding: 10px 18px; border-radius: 10px; background: var(--card);
    border: 1px solid var(--border); font-weight: 500; transition: 0.3s;
}
.skill-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.skill-chip.hidden { opacity: 0.12; transform: scale(0.95); }

.skill-bars { max-width: 750px; margin: 0 auto; display: grid; gap: 20px; }
.bar-label { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 6px; }
.bar { height: 10px; background: var(--border); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--gradient); border-radius: 10px; transition: width 1.4s ease; }

/* ========== EXPERIENCE TABS ========== */
.tabs { display: grid; grid-template-columns: 260px 1fr; gap: 30px; max-width: 950px; margin: 0 auto; }
.tab-list { display: flex; flex-direction: column; border-left: 2px solid var(--border); }
.tab-btn {
    text-align: left; padding: 14px 20px; background: none; border: none;
    color: var(--muted); font-family: inherit; font-size: 0.95rem; cursor: pointer;
    border-left: 2px solid transparent; margin-left: -2px; transition: 0.2s;
}
.tab-btn:hover { background: var(--card); color: var(--text); }
.tab-btn.active { color: var(--accent); border-left-color: var(--accent); background: var(--card); }
.tab-panel { display: none; animation: fadeIn 0.4s ease; }
.tab-panel.active { display: block; }
.tab-panel h3 { font-size: 1.3rem; }
.tab-panel h3 span { color: var(--accent); }
.date { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 0.85rem; margin: 4px 0 16px; }
.tab-panel ul { list-style: none; }
.tab-panel li { position: relative; padding-left: 24px; margin-bottom: 12px; color: var(--muted); }
.tab-panel li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ========== PROJECTS ========== */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px; cursor: pointer; transition: 0.3s; position: relative; overflow: hidden;
}
.project-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: 0.4s;
}
.project-card:hover, .project-card:focus { transform: translateY(-8px); box-shadow: var(--shadow); outline: none; }
.project-card:hover::before, .project-card:focus::before { transform: scaleX(1); }
.project-icon { font-size: 2rem; margin-bottom: 10px; }
.project-card h3 { margin-bottom: 10px; }
.project-card p { color: var(--muted); margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
    font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--accent);
    background: rgba(56, 189, 248, 0.1); padding: 4px 10px; border-radius: 6px;
}
.card-link { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* ========== MODAL ========== */
.modal {
    position: fixed; inset: 0; background: rgba(2, 6, 23, 0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s; z-index: 2000; padding: 20px;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 36px; max-width: 600px; width: 100%; position: relative;
    transform: translateY(20px); transition: 0.3s;
}
.modal.open .modal-content { transform: none; }
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: none; color: var(--muted); font-size: 1.8rem; cursor: pointer; }
.modal-content h3 { font-size: 1.5rem; margin-bottom: 10px; }
.modal-content p { color: var(--muted); margin-bottom: 14px; }
.modal-content ul { margin: 0 0 18px 20px; color: var(--muted); }

/* ========== EDUCATION ========== */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.timeline { border-left: 2px solid var(--border); padding-left: 28px; }
.timeline-item { position: relative; margin-bottom: 36px; }
.timeline-item::before {
    content: ""; position: absolute; left: -36px; top: 6px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}
.timeline-date { font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 0.85rem; }
.timeline-item p { color: var(--muted); }
.cert-list { display: grid; gap: 12px; }
.cert {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 18px; display: flex; gap: 12px; align-items: center; transition: 0.3s;
}
.cert:hover { border-color: var(--accent); transform: translateX(6px); }
.cert span { color: #22c55e; font-weight: 700; }

/* ========== CONTACT ========== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-info > p { color: var(--muted); margin-bottom: 26px; }
.contact-item { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.contact-item > span {
    width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
    background: var(--card); border: 1px solid var(--border); color: var(--accent); font-weight: 700; font-size: 0.85rem;
}
.copy-btn {
    padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--card); color: var(--muted); cursor: pointer; font-family: inherit;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.contact-form {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-family: inherit; font-size: 1rem; transition: 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group.invalid input, .form-group.invalid textarea { border-color: #ef4444; }
.error { color: #ef4444; font-size: 0.8rem; }

/* ========== TOAST / BACK TO TOP / FOOTER ========== */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 100px);
    background: var(--gradient); color: #fff; padding: 12px 24px; border-radius: 10px;
    font-weight: 600; transition: 0.4s; z-index: 3000;
}
.toast.show { transform: translate(-50%, 0); }

.back-to-top {
    position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%;
    border: none; background: var(--gradient); color: #fff; font-size: 1.2rem; cursor: pointer;
    opacity: 0; pointer-events: none; transition: 0.3s; z-index: 999;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }

.footer { padding: 30px 0; text-align: center; color: var(--muted); border-top: 1px solid var(--border); font-size: 0.9rem; }

/* ========== REVEAL ANIMATION ========== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
    .hero-grid, .about-grid, .edu-grid, .contact-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .tabs { grid-template-columns: 1fr; }
    .tab-list { flex-direction: row; overflow-x: auto; border-left: none; border-bottom: 2px solid var(--border); }
    .tab-btn { border-left: none; border-bottom: 2px solid transparent; margin: 0 0 -2px; white-space: nowrap; }
    .tab-btn.active { border-bottom-color: var(--accent); }
}

@media (max-width: 820px) {
    .menu-btn { display: block; }
    .nav-links {
        position: fixed; top: 70px; right: 5%; flex-direction: column;
        background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 14px; width: 220px; box-shadow: var(--shadow);
        opacity: 0; pointer-events: none; transform: translateY(-10px); transition: 0.25s;
    }
    .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
    .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats, .about-cards { grid-template-columns: 1fr; }
    .section { padding: 70px 0; }
    .contact-form, .modal-content { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}
