:root {
    color-scheme: light;
    --bg: #f3fbff;
    --surface: #ffffff;
    --card: rgba(255, 255, 255, 0.95);
    --text: #1a2633;
    --muted: #4f6d7a;
    --primary: #1a73e8;
    --border: #d7e3ef;
    --shadow: 0 18px 40px rgba(31, 76, 124, 0.08);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

.dark-theme {
    color-scheme: dark;
    --bg: #0f1724;
    --surface: #14213d;
    --card: #1f2e4e;
    --text: #f8fafc;
    --muted: #a8b4c4;
    --primary: #4dabf7;
    --border: #243651;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header,
.site-footer,
.site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.theme-toggle:hover {
    background: rgba(26, 115, 232, 0.1);
}

.site-nav {
    padding: 10px 0;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
    margin-right: 12px;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(26, 115, 232, 0.1);
}

.menu-toggle .menu-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: background 0.25s ease;
}

.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, top 0.25s ease;
}

.menu-toggle .menu-icon::before {
    top: -8px;
}

.menu-toggle .menu-icon::after {
    top: 8px;
}

.menu-toggle.open .menu-icon {
    background: transparent;
}

.menu-toggle.open .menu-icon::before {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open .menu-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.site-nav a:hover {
    color: var(--primary);
}

.hero {
    text-align: center;
    padding: 48px 0 28px;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(26, 115, 232, 0.15);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

h1,
h2,
h3 {
    margin: 0;
}

h1 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    margin-bottom: 16px;
}

h2 {
    color: var(--text);
    margin-bottom: 12px;
}

p {
    font-size: 1rem;
    color: var(--muted);
    max-width: 760px;
    margin: 0 auto;
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    margin: 24px 0;
    box-shadow: var(--shadow);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(26, 115, 232, 0.12);
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    margin: 0 0 14px;
    color: var(--muted);
}

.project-button {
    display: inline-block;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.project-button:hover {
    background: #155fb6;
}

.project-button {
    border: none;
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.modal iframe {
    border-radius: 12px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    justify-content: center;
}

.skills-list li {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(26, 115, 232, 0.1);
    color: var(--text);
    font-weight: 600;
}

.small {
    color: var(--muted);
    margin-top: 10px;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary);
}

.site-footer {
    padding: 18px 0 32px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 720px) {
    .header-inner,
    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .menu-toggle,
    .theme-toggle {
        flex: 1 1 160px;
        max-width: 260px;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    .site-nav {
        display: none;
        width: min(95%, 360px);
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        top: 72px;
        background: var(--surface);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
        border: 1px solid var(--border);
        border-radius: 18px;
    }

    .site-nav.open {
        display: block !important;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 14px;
        padding: 12px 0;
    }

    .nav-links a {
        display: block;
        padding: 10px 0;
        width: 100%;
        text-align: center;
    }

    .hero {
        padding-top: 32px;
    }

    .section-card {
        padding: 22px;
    }
}
