/* ── Design tokens ── */
:root {
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-subtle: rgba(79, 70, 229, 0.12);
    --accent-link: var(--accent);
    --bg: #FFFFFF;
    --bg-alt: #F8FAFC;
    --text: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
    --card-shadow-hover: 0 4px 8px rgba(0,0,0,.10), 0 12px 24px rgba(0,0,0,.10);
    --radius: 10px;
    --font: 'Poppins', sans-serif;
}

[data-theme="dark"] {
    --accent-link: #818CF8;
    --bg: #0F172A;
    --bg-alt: #1E293B;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
    --card-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
    --card-shadow-hover: 0 4px 8px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.3);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    transition: background 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

img { max-width: 100%; display: block; }

/* ── Layout ── */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section { padding: 120px 0; }

.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 7px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* ── Header / Nav ── */
header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s, border-color 0.2s;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

#main-nav ul {
    display: flex;
    gap: 32px;
}

#main-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

#main-nav a:hover,
#main-nav a.active { color: var(--accent); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle,
.mobile-menu-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.mobile-menu-btn { display: none; }

/* ── Hero ── */
#hero {
    padding-top: 160px;
    padding-bottom: 96px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container { max-width: 700px; }

.hero-eyebrow {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

#hero h2 {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.hero-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.hero-socials {
    display: flex;
    gap: 18px;
}

.hero-socials a {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.hero-socials a:hover { color: var(--accent); }

/* ── About / Skills ── */
.about-bio {
    max-width: 680px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 1.02rem;
    line-height: 1.8;
}

.about-languages {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.lang-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.skill-group {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

[data-theme="light"] .skill-group { background: var(--bg-alt); }
[data-theme="dark"] .skill-group { background: #1a2744; }

.skill-group h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent);
    margin-bottom: 16px;
}

.skill-group li {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.skill-group li:last-child { border-bottom: none; }

/* ── Experience / Timeline ── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.timeline-item {
    border-left: 2px solid var(--accent);
    padding-left: 28px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 7px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.timeline-item h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.timeline-item h4 {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.timeline-location {
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 400;
    color: var(--text-muted);
}

.timeline-date {
    font-size: 0.83rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 4px;
    flex-shrink: 0;
}

.timeline-bullets {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-bullets li {
    font-size: 0.91rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.6;
}

.timeline-bullets li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-bullets a {
    color: var(--accent-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.timeline-bullets a:hover { color: var(--accent-hover); }

.stat-line {
    color: var(--text) !important;
    font-size: 0.88rem !important;
}

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* ── Projects ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.project-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
}

.project-img-wrap {
    width: calc(100% + 56px);
    margin: -28px -28px 0;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 0;
    background: var(--bg-alt);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img {
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: contain;
    display: block;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.project-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.project-link {
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.project-link:hover { color: var(--accent); }

.project-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.tech-tags span {
    font-size: 0.76rem;
    font-weight: 500;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 4px;
}

/* Live-demo link on a project card. Uses --accent-link rather than --accent
   because that is the one the dark theme lightens; --accent stays indigo and
   goes muddy on the dark background. */
.project-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--accent-subtle);
    color: var(--accent-link);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.project-cta:hover {
    background: transparent;
    border-color: var(--accent-link);
    transform: translateY(-1px);
}

.project-cta i { font-size: 0.76rem; }

/* ── Education ── */
.education-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--card-shadow);
    max-width: 600px;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.education-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.education-card h4 {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.education-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.education-gpa { text-align: right; }

.gpa-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.gpa-number span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.gpa-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.honor-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.awards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
}

.award-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.award-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent-link);
}

.award-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Contact ── */
.contact-container { text-align: center; }

.contact-sub {
    color: var(--text-muted);
    margin-top: -32px;
    margin-bottom: 40px;
    font-size: 1rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    color: var(--text-muted);
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.contact-item:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.contact-item i { font-size: 1.05rem; }

/* ── Footer ── */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
}

footer p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.mobile-nav-overlay.open { display: flex; }

.mobile-nav-overlay ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.mobile-nav-overlay a {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.2s;
}

.mobile-nav-overlay a:hover { color: var(--accent); }

.close-overlay {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s, border-color 0.2s;
}

.close-overlay:hover { color: var(--accent); border-color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
    section { padding: 72px 0; }

    #main-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .skills-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }

    .timeline-header { flex-direction: column; gap: 2px; }

    .contact-links { flex-direction: column; align-items: center; }
    .contact-item { width: 100%; max-width: 360px; justify-content: center; }

    .education-header { flex-direction: column; gap: 12px; }
    .education-gpa { text-align: left; }

    .hero-actions { flex-direction: column; align-items: flex-start; }
}
