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

/* ── Theme Variables ── */
[data-theme="dark"] {
    --bg: #0a0a0a;
    --surface: #141414;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #4fc3f7;
    --border: #222;
    --toggle-bg: #333;
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666;
    --accent: #0288d1;
    --border: #ddd;
    --toggle-bg: #e0e0e0;
}

/* ── Base ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* ── Nav ── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* ── Theme Toggle ── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--toggle-bg);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

/* ── Hamburger ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--toggle-bg);
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Main ── */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
}

/* ── Hero ── */
#hero {
    padding: 6rem 0 4rem;
}

#hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--accent);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ── Sections ── */
h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ── Project Grid ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: background 0.3s, border-color 0.3s;
}

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

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-card a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.project-card a:hover {
    text-decoration: underline;
}

/* ── Contact ── */
#contact a {
    color: var(--accent);
    text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    max-width: 960px;
    margin: 2rem auto 0;
}

/* ══════════════════════════════════════
   Responsive — Tablet (≤ 768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        gap: 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        font-size: 1rem;
    }

    #hero {
        padding: 4rem 0 3rem;
    }

    #hero h1 {
        font-size: 2rem;
    }

    section {
        padding: 3rem 0;
    }
}

/* ══════════════════════════════════════
   Responsive — Mobile (≤ 480px)
   ══════════════════════════════════════ */
@media (max-width: 480px) {
    nav {
        padding: 0.8rem 1rem;
    }

    main {
        padding: 0 1rem;
    }

    #hero {
        padding: 3rem 0 2rem;
    }

    #hero h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 1.2rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}
