:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --accent-dark: #1d4ed8;
    --border: #e2e8f0;
    --card: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --skill-card-bg: #eff6ff;
    --skill-card-border: #dbeafe;
    --skill-tag-bg: #dbeafe;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #60a5fa;
    --accent-light: rgba(96,165,250,0.1);
    --accent-dark: #93bbfc;
    --border: #334155;
    --card: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --skill-card-bg: rgba(96,165,250,0.08);
    --skill-card-border: #334155;
    --skill-tag-bg: rgba(96,165,250,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.container { width: min(1080px, 90%); margin: 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}
.logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.15s;
}
.nav a:hover { color: var(--text); background: var(--bg-alt); }
.nav .btn-hire {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.nav .btn-hire:hover { background: var(--accent-dark); color: #fff; }

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
    padding: 72px 0 64px;
}
.hero-text h1 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 16px;
}
.hero-text h1 .accent {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lead {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.7;
}
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}
.hero-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
}
.hero-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.hero-cta {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn:hover { border-color: var(--text-muted); color: var(--text); }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

/* Sections */
.section {
    padding: 64px 0;
}
.section-alt { background: var(--bg-alt); }
.section-header {
    margin-bottom: 40px;
}
.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 560px;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.section-alt .skill-card { background: var(--skill-card-bg); border-color: var(--skill-card-border); }
.skill-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.skill-tag {
    padding: 4px 10px;
    background: var(--bg-alt);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.section-alt .skill-tag { background: var(--bg-alt); }

/* Experience */
.exp-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }
.exp-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 2px;
}
.exp-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.exp-company {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}
.exp-content ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.exp-content li { margin-bottom: 4px; }

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
}
.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.project-card-body {
    padding: 20px;
}
.project-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.project-card-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.card-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}
.card-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}
.card-link:hover { text-decoration: underline; }
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.project-tech span {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--bg-alt);
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Featured project */
.featured-project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}
.featured-project img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.featured-project h3 { font-size: 1.25rem; margin-bottom: 8px; }
.featured-project p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }

/* Project subsection */
.project-section {
    margin-top: 40px;
}
.project-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    text-align: center;
}
.contact-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.contact-item.primary {
    border-color: var(--accent);
    background: var(--accent-light);
}
.ci-title { font-weight: 600; font-size: 0.95rem; }
.ci-sub { color: var(--text-muted); font-size: 0.8rem; }

/* Footer */
.site-footer {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.open { display: flex; }
.modal img, .modal iframe {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.modal iframe { width: 80vw; height: 85vh; background: #fff; }
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

/* Dark mode toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

[data-theme="dark"] .hero-photo { border-color: var(--border); }
[data-theme="dark"] .card-img { border-color: var(--border); }
[data-theme="dark"] .project-card { background: var(--card); }
[data-theme="dark"] .featured-project { background: var(--card); }
[data-theme="dark"] .featured-project img { border-color: var(--border); }

/* Responsive */
@media (max-width: 768px) {
    .container { width: 94%; }
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 32px 0 28px;
        gap: 20px;
    }
    .hero-photo { width: 120px; height: 120px; margin: 0 auto; order: -1; }
    .lead { margin: 0 auto; font-size: 0.9rem; }
    .hero-tags { justify-content: center; }
    .hero-tag { font-size: 0.7rem; padding: 4px 10px; }
    .hero-cta { justify-content: center; }
    .hero-cta .btn { padding: 10px 20px; font-size: 0.85rem; }
    .section { padding: 40px 0; }
    .section-header h2 { font-size: 1.2rem; }
    .section-header p { font-size: 0.9rem; }
    .skills-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .skill-card { padding: 14px; }
    .skill-card h3 { font-size: 0.7rem; }
    .skill-tag { font-size: 0.7rem; padding: 3px 8px; }
    .exp-item { grid-template-columns: 1fr; gap: 4px; }
    .exp-date { font-size: 0.8rem; }
    .exp-content h3 { font-size: 0.95rem; }
    .exp-content ul { font-size: 0.85rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .featured-project { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
    .featured-project h3 { font-size: 1.05rem; }
    .featured-project p { font-size: 0.85rem; }
    .project-card-body h3 { font-size: 0.95rem; }
    .project-card-body p { font-size: 0.82rem; }
    .card-img { height: 160px; }
    .contact-grid { grid-template-columns: 1fr; }
    .site-header { padding: 12px 0; }
    .nav a { padding: 5px 8px; font-size: 0.75rem; }
    .nav .btn-hire { padding: 5px 10px; font-size: 0.75rem; white-space: nowrap; }
    .nav { gap: 4px; }
    .brand span { font-size: 0.9rem; }
    .logo { width: 28px; height: 28px; }
    .theme-toggle { width: 30px; height: 30px; font-size: 0.9rem; }
}

@media (max-width: 380px) {
    .skills-grid { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 1.3rem; }
    .nav a:not(.btn-hire) { display: none; }
}
