:root {
    --bg: #090d13;
    --bg-secondary: #101721;
    --bg-tertiary: #0f1520;
    --card: rgba(20, 28, 39, 0.88);
    --card-strong: rgba(16, 22, 31, 0.98);
    --text-primary: #edf3fb;
    --text-secondary: #91a1b5;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #4db2ff;
    --accent-strong: #2d9fff;
    --accent-soft: rgba(77, 178, 255, 0.14);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
    --header-bg: rgba(8, 12, 18, 0.72);
    --header-shadow: none;
    --badge-bg: rgba(77, 178, 255, 0.14);
    --badge-border: rgba(77, 178, 255, 0.12);
    --badge-text: #4db2ff;
    --surface-soft: rgba(255, 255, 255, 0.02);
}

body.light-mode {
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --card: #ffffff;
    --card-strong: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e5e7eb;
    --accent: #0f8fff;
    --accent-strong: #0077e6;
    --accent-soft: rgba(15, 143, 255, 0.1);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --header-bg: rgba(255, 255, 255, 0.82);
    --header-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    --badge-bg: rgba(15, 143, 255, 0.08);
    --badge-border: rgba(15, 143, 255, 0.16);
    --badge-text: #0b74d1;
    --surface-soft: rgba(15, 23, 42, 0.025);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top right, rgba(77, 178, 255, 0.12), transparent 28%),
        radial-gradient(circle at left center, rgba(77, 178, 255, 0.06), transparent 26%),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-tertiary) 54%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: Inter, Arial, Helvetica, sans-serif;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

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

button {
    font: inherit;
}

.container {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--header-shadow);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 260px;
    height: 78px;
}

.brand-logo {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.brand-logo--light {
    display: none;
}

body.light-mode .brand-logo--dark {
    display: none;
}

body.light-mode .brand-logo--light {
    display: block;
}

.site-nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 0.96rem;
    transition: color 0.2s ease;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
}

.lang-btn {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-weight: 700;
    transition: color 0.2s ease;
}

.lang-btn.is-active {
    color: var(--text-primary);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle__sun,
.theme-toggle__moon {
    position: absolute;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

body.dark-mode .theme-toggle__sun,
body.light-mode .theme-toggle__moon {
    opacity: 0;
    transform: scale(0.85);
}

body.dark-mode .theme-toggle__moon,
body.light-mode .theme-toggle__sun {
    opacity: 1;
    transform: scale(1);
}

.hero {
    padding: 96px 0 44px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
    gap: 32px;
    align-items: center;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero h1,
.section h2 {
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    max-width: 9ch;
    margin-bottom: 18px;
}

.section h2 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.hero-text,
.section-text {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 720px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.social-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.social-link {
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(45, 159, 255, 0.22);
}

.button-primary:hover {
    box-shadow: 0 14px 30px rgba(45, 159, 255, 0.28);
}

.button-secondary {
    background: var(--accent-soft);
    border-color: var(--border);
}

.hero-card,
.highlight-card,
.project-card,
.info-card,
.contact-card {
    background: linear-gradient(180deg, var(--card) 0%, var(--card-strong) 100%);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode .hero-card,
body.light-mode .highlight-card,
body.light-mode .project-card,
body.light-mode .info-card,
body.light-mode .contact-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-color: #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.hero-card:hover,
.highlight-card:hover,
.project-card:hover,
.info-card:hover {
    transform: translateY(-3px);
}

.hero-card {
    padding: 24px;
}

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

.hero-card__label {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.hero-card__meta {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.stack-group + .stack-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.stack-group h3 {
    font-size: 0.98rem;
    margin-bottom: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags span {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid var(--badge-border);
}

.highlights {
    padding: 10px 0 0;
}

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

.highlight-card {
    padding: 22px;
}

.highlight-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 8px;
}

.highlight-card span {
    color: var(--text-secondary);
}

.section {
    padding: 84px 0;
}

.section-alt {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.card-grid,
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 28px;
}

.about-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
}

.about-side {
    display: grid;
    gap: 22px;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    min-height: 280px;
    padding: 24px;
}

.project-card__top h3 {
    font-size: 1.18rem;
    margin-bottom: 10px;
}

.project-card__top p {
    color: var(--text-secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: fit-content;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-primary);
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.project-link:hover {
    background: var(--accent-soft);
    border-color: rgba(77, 178, 255, 0.26);
    transform: translateY(-1px);
}

body.light-mode .button-secondary,
body.light-mode .project-link,
body.light-mode .language-switcher,
body.light-mode .theme-toggle {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.info-card {
    padding: 24px;
}

.info-card h3 {
    margin-bottom: 16px;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    padding: 12px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.detail-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.languages-card {
    display: grid;
    gap: 16px;
}

.language-item {
    display: grid;
    gap: 10px;
}

.language-item__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.language-item__top strong {
    color: var(--accent);
}

.language-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

body.light-mode .language-bar {
    background: rgba(15, 23, 42, 0.04);
}

.language-bar__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.contact-card {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-footer {
    padding: 28px 0 36px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

@media (max-width: 980px) {
    .hero-grid,
    .about-grid,
    .card-grid,
    .highlight-grid,
    .contact-card {
        grid-template-columns: 1fr;
    }

    .contact-card {
        display: grid;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 24px, 1140px);
    }

    .header-inner {
        padding: 14px 0;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .site-nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .header-actions {
        margin-left: auto;
    }

    .hero {
        padding-top: 60px;
    }

    .hero h1 {
        max-width: none;
    }

    .social-links {
        gap: 14px;
    }

    .footer-inner {
        flex-direction: column;
    }
}
