:root {
    --bg: #07111f;
    --bg-elevated: rgba(11, 22, 38, 0.78);
    --surface: rgba(14, 28, 48, 0.88);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --text: #edf3ff;
    --muted: #a8b4c9;
    --accent: #58d6c1;
    --accent-strong: #f5a524;
    --bg-start: #06101c;
    --bg-mid: #08131f;
    --bg-end: #0d1726;
    --bg-bloom-left: rgba(88, 214, 193, 0.18);
    --bg-bloom-right: rgba(245, 165, 36, 0.16);
    --grid-line: rgba(255, 255, 255, 0.03);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] {
    --bg: #f4f7fb;
    --bg-elevated: rgba(255, 255, 255, 0.84);
    --surface: rgba(255, 255, 255, 0.95);
    --surface-soft: rgba(0, 0, 0, 0.03);
    --line: rgba(22, 30, 44, 0.12);
    --text: #112033;
    --muted: #506074;
    --accent: #0ea88f;
    --accent-strong: #c27813;
    --bg-start: #e8f1ff;
    --bg-mid: #eff6ff;
    --bg-end: #f9fbff;
    --bg-bloom-left: rgba(14, 168, 143, 0.12);
    --bg-bloom-right: rgba(194, 120, 19, 0.12);
    --grid-line: rgba(10, 20, 40, 0.04);
    --shadow: 0 22px 70px rgba(12, 28, 53, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            circle at top left,
            var(--bg-bloom-left),
            transparent 26%
        ),
        radial-gradient(
            circle at top right,
            var(--bg-bloom-right),
            transparent 24%
        ),
        linear-gradient(
            160deg,
            var(--bg-start) 0%,
            var(--bg-mid) 45%,
            var(--bg-end) 100%
        );
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
    pointer-events: none;
    opacity: 0.2;
}

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

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 8px 0 28px;
}

.topbar__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.control-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.control-field select {
    min-width: 132px;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-transform: none;
    padding: 0 12px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.control-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 214, 193, 0.2);
}

.brand {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        rgba(88, 214, 193, 0.26),
        rgba(245, 165, 36, 0.22)
    );
    border: 1px solid var(--line);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    box-shadow: var(--shadow);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

.nav a {
    padding: 12px 16px;
    color: var(--muted);
    border-radius: 999px;
    border: 1px solid transparent;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    transform: translateY(-1px);
}

.hero,
.section,
.contact-card,
.hero__card,
.about-card,
.skill-card,
.repo-card {
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    gap: 24px;
    padding: 32px;
    border-radius: 32px;
}

.hero__content h1,
.section__heading h2,
.hero__card h2,
.contact-card h2 {
    font-family: "Space Grotesk", sans-serif;
    margin: 0;
}

.hero__content h1 {
    font-size: clamp(2.6rem, 5vw, 5rem);
    line-height: 0.96;
    max-width: 11ch;
    margin-top: 16px;
}

.eyebrow,
.section__heading span,
.profile-badge,
.contact-card span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero__lead,
.section__heading p,
.about-card p,
.skill-card p,
.repo-card p,
.hero__card p,
.contact-card p,
.footer p,
.repos-section [data-repositories-status] {
    color: var(--muted);
    line-height: 1.7;
}

.hero__lead {
    max-width: 62ch;
    font-size: 1.08rem;
    margin: 18px 0 0;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-weight: 700;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

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

.button--primary {
    color: #041017;
    background: linear-gradient(135deg, var(--accent) 0%, #d8fff7 100%);
    box-shadow: 0 16px 30px rgba(88, 214, 193, 0.18);
}

.button--secondary {
    background: rgba(255, 255, 255, 0.04);
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.hero__stats article {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.hero__stats strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 2rem;
    color: var(--text);
}

.hero__card {
    border-radius: 28px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

.profile-photo {
    width: 112px;
    height: 112px;
    border-radius: 30px;
    display: grid;
    place-items: center;
    background: linear-gradient(
        145deg,
        rgba(88, 214, 193, 0.22),
        rgba(245, 165, 36, 0.18)
    );
    border: 1px solid var(--line);
    font-family: "Space Grotesk", sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

.profile-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.section {
    margin-top: 24px;
    padding: 28px;
    border-radius: 28px;
}

.section__heading {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.section__heading h2 {
    font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.section--grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 24px;
}

.about-card,
.skill-card,
.repo-card,
.contact-card {
    border-radius: 24px;
}

.about-card,
.skill-card {
    padding: 22px;
}

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

.repos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.skill-card h3,
.repo-card h3 {
    margin: 0 0 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
}

.skill-card {
    min-height: 200px;
}

.skill-card:hover,
.repo-card:hover,
.contact-card:hover,
.hero__card:hover {
    transform: translateY(-3px);
    transition: transform 0.2s ease;
}

.repos-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.section__heading--inline {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.section__heading--inline p {
    text-align: right;
    margin: 0;
}

.repo-card {
    padding: 22px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06),
        rgba(255, 255, 255, 0.03)
    );
}

.repo-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        135deg,
        rgba(88, 214, 193, 0.12),
        rgba(245, 165, 36, 0.08)
    );
    display: grid;
    place-items: center;
}

.repo-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.repo-card__media-placeholder {
    color: rgba(237, 243, 255, 0.72);
    font-size: 0.92rem;
    text-align: center;
    padding: 12px;
}

.repo-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.repo-pill,
.repo-stars {
    font-size: 0.85rem;
    color: var(--muted);
}

.repo-card a {
    margin-top: auto;
    color: var(--accent);
    font-weight: 700;
}

.repo-card--placeholder {
    border-style: dashed;
}

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

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 4px 0;
}

@media (max-width: 960px) {
    .hero,
    .section--grid,
    .skills-grid,
    .contact-card,
    .section__heading--inline,
    .footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .repos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .section__heading--inline p {
        text-align: left;
    }

    .contact-card {
        justify-content: stretch;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 16px;
    }

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

    .topbar__controls {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .control-field {
        width: 100%;
        max-width: 220px;
    }

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

    .hero,
    .section,
    .contact-card {
        padding: 20px;
        border-radius: 24px;
    }

    .hero__content h1 {
        max-width: 100%;
    }

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