:root {
    --background: #f2f5fb;
    --surface: #ffffff;
    --text: #1c2533;
    --muted: #59627b;
    --accent: #2f80ed;
    --accent-strong: #1557d6;
    --border: rgba(28, 37, 51, 0.12);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #e9efff 0%, #f2f5fb 35%, #ffffff 100%);
}

body.dark-theme {
    --background: #12161f;
    --surface: #1d2431;
    --text: #e8ecf7;
    --muted: #9aa5c1;
    --accent: #6da8ff;
    --accent-strong: #8bb7ff;
    --border: rgba(255, 255, 255, 0.12);
    background: radial-gradient(circle at top, #212833 0%, #12161f 40%, #0b0f18 100%);
}

.page-shell {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head-intro {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-head-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-head-text h2,
.page-head-text p {
    margin: 0;
}

.page-head-text p {
    margin-top: 8px;
}

.profile-avatar {
    width: 84px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

#themeButton {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
}

header {
    margin-bottom: 18px;
}

header h1 {
    margin: 0 0 12px;
    font-size: clamp(2.2rem, 3vw, 3.2rem);
}

header p {
    margin: 0;
    color: var(--muted);
    max-width: 720px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.tab-button {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tab-button.active {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(47, 128, 237, 0.12);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    padding: 28px;
    margin-bottom: 24px;
}

.card h2 {
    margin-top: 0;
}

.social-icons {
    display: flex;
    gap: 14px;
    margin-top: 18px;
    align-items: center;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.social-link:hover,
.social-link:focus {
    color: var(--accent);
    background: rgba(47, 128, 237, 0.08);
    transform: translateY(-3px);
}

.social-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
}

.card article {
    padding: 16px 0;
    border-bottom: 1px solid rgba(89, 98, 123, 0.12);
}

.card article:last-child {
    border-bottom: none;
}

.card article h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.project-link {
    color: inherit;
    text-decoration: none;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}

.project-link:hover,
.project-link:focus {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: currentColor;
}

.card article p,
.card ul {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.project-card-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 18px;
    align-items: start;
}

.project-text ul {
    margin: 0;
    padding-left: 22px;
    margin-top: 14px;
}

.project-media {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.project-gif {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(28, 37, 51, 0.08);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    background: var(--background);
}

@media (max-width: 720px) {
    .project-card-grid {
        grid-template-columns: 1fr;
    }
}

.scholar-link {
    color: #8ab4f8;
    text-decoration: none;
    font-weight: 700;
}

.scholar-link:hover,
.scholar-link:focus {
    text-decoration: underline;
}

.card ul {
    padding-left: 20px;
    margin-top: 16px;
}

.small-button {
    border: none;
    border-radius: 14px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
.small-button:hover,
.tab-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

button:active,
.small-button:active,
.tab-button:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .page-shell {
        padding: 28px 16px;
    }

    .card {
        padding: 22px;
    }

    .page-head {
        align-items: flex-start;
    }

    .tabs {
        justify-content: flex-start;
    }
}
