:root {
    --bg: #060911;
    --panel: rgba(12, 18, 31, 0.78);
    --panel-strong: rgba(18, 28, 46, 0.94);
    --line: rgba(255, 255, 255, 0.15);
    --text: #f6f8fc;
    --muted: #aab6c8;
    --cyan: #38d5ff;
    --green: #6ee7b7;
    --rose: #fb7185;
    --amber: #fbbf24;
    --ink: #041018;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

body.light-theme {
    --bg: #f4f7fb;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --line: rgba(13, 24, 42, 0.14);
    --text: #0d182a;
    --muted: #506176;
    --cyan: #0077b6;
    --green: #0f9f7a;
    --rose: #d94b66;
    --amber: #b7791f;
    --ink: #ffffff;
    --shadow: 0 24px 80px rgba(31, 54, 83, 0.16);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    overflow-x: hidden;
    transition: background 0.25s ease, color 0.25s ease;
}

body.menu-open {
    overflow: hidden;
}

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

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
}

#space-scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: radial-gradient(circle at 72% 22%, #102848, #060911 58%);
}

body.light-theme #space-scene {
    background: radial-gradient(circle at 72% 22%, #dff6ff, #f4f7fb 58%);
}

.page-glow {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(56, 213, 255, 0.12), transparent 38%),
        linear-gradient(245deg, rgba(110, 231, 183, 0.09), transparent 34%),
        radial-gradient(circle at 15% 80%, rgba(251, 113, 133, 0.11), transparent 25%);
}

body.light-theme .page-glow {
    background:
        linear-gradient(115deg, rgba(0, 119, 182, 0.12), transparent 38%),
        linear-gradient(245deg, rgba(15, 159, 122, 0.12), transparent 34%),
        radial-gradient(circle at 15% 80%, rgba(217, 75, 102, 0.12), transparent 25%);
}

.navbar {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 20;
    display: flex;
    width: min(1120px, calc(100% - 32px));
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(6, 9, 17, 0.72);
    padding: 12px 16px 12px 20px;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.26);
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 40px rgba(31, 54, 83, 0.14);
}

.navbar.scrolled {
    background: rgba(6, 9, 17, 0.9);
}

body.light-theme .navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
}

.brand {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
}

.brand span {
    color: var(--cyan);
}

.menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 10px;
}

.menu a {
    display: block;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
    padding: 10px 12px;
    transition: color 0.2s ease, background 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.menu-toggle,
.scroll-up-btn,
.theme-toggle,
.language-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
}

.theme-toggle,
.language-toggle {
    display: inline-flex;
    min-height: 40px;
    gap: 8px;
    color: var(--text);
    font-weight: 800;
    padding: 9px 11px;
}

.theme-toggle:hover,
.language-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

body.light-theme .theme-toggle,
body.light-theme .language-toggle,
body.light-theme .menu-toggle,
body.light-theme .scroll-up-btn {
    background: rgba(13, 24, 42, 0.05);
}

body.light-theme .theme-toggle:hover,
body.light-theme .language-toggle:hover {
    background: rgba(13, 24, 42, 0.08);
}

.scroll-up-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30;
    width: 46px;
    height: 46px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-up-btn.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.scroll-up-btn:hover {
    transform: translateY(-3px);
}

.section {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 112px 0;
}

.hero {
    display: grid;
    min-height: 100vh;
    align-items: center;
    gap: 64px;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    padding-top: 140px;
}

.eyebrow {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

h1 {
    max-width: 760px;
    margin-top: 14px;
    font-size: clamp(3.4rem, 8vw, 7.4rem);
    font-weight: 800;
    line-height: 0.92;
}

.hero-text {
    max-width: 700px;
    margin-top: 24px;
    color: #d7dfec;
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.78;
}

body.light-theme .hero-text {
    color: #334155;
}

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

.primary-action,
.secondary-action,
.ghost-action {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    font-weight: 800;
    padding: 13px 18px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-action {
    background: linear-gradient(135deg, var(--cyan), var(--green));
    color: var(--ink);
}

.secondary-action {
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.12);
    color: #fff5d6;
}

.ghost-action {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover {
    transform: translateY(-2px);
}

.stats {
    display: grid;
    max-width: 700px;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 34px;
}

.stats div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 18px;
    backdrop-filter: blur(16px);
}

body.light-theme .stats div,
body.light-theme .skill-orbit {
    background: rgba(255, 255, 255, 0.66);
}

.stats strong {
    display: block;
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.15;
}

.stats span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.88rem;
}

.profile-stage {
    display: grid;
    min-height: 520px;
    place-items: center;
    perspective: 1200px;
}

.profile-card {
    position: relative;
    width: min(390px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    box-shadow: var(--shadow);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.16s ease-out;
}

body.light-theme .profile-card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(236, 245, 255, 0.72));
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    pointer-events: none;
    transform: translateZ(34px);
}

.profile-card__media {
    height: 490px;
    overflow: hidden;
}

.profile-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 20px var(--green);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-row span {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #dce6f7;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 7px 10px;
}

body.light-theme .chip-row span {
    background: rgba(13, 24, 42, 0.05);
    color: #1f2d40;
}

.section-heading {
    margin-bottom: 30px;
}

.skills > .section-heading,
.skills > .skill-orbit,
.skills > .skill-columns {
    display: none;
}

.skills {
    width: min(1240px, calc(100% - 32px));
}

.skills-showcase {
    position: relative;
    overflow: hidden;
}

.skills-showcase::before {
    content: "";
    position: absolute;
    inset: 56px 18% 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
    transform: rotate(18deg);
}

body.light-theme .skills-showcase::before {
    border-color: rgba(13, 24, 42, 0.1);
}

.skills-showcase-heading {
    position: relative;
    z-index: 1;
    margin-bottom: 62px;
    text-align: center;
}

.skills-showcase-heading h2 {
    margin-top: 10px;
    font-size: clamp(2.3rem, 5vw, 4.1rem);
    line-height: 1;
}

.section-subtitle {
    max-width: 720px;
    margin: 18px auto 0;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.6;
}

.technical-skills {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.skill-group {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    padding: 28px 24px 24px;
    backdrop-filter: blur(18px);
}

body.light-theme .skill-group {
    border-color: rgba(13, 24, 42, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.skill-group__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.skill-group__header h3 {
    font-size: 1.08rem;
}

.skill-marker {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.skill-marker.purple {
    background: #7c4dff;
}

.skill-marker.cyan {
    background: #10a8b5;
}

.skill-marker.rose {
    background: #e02d75;
}

.skill-marker.amber {
    background: #e58100;
}

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

.skill-item {
    min-height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    padding: 14px 14px 12px;
}

body.light-theme .skill-item {
    border-color: rgba(13, 24, 42, 0.08);
    background: rgba(13, 24, 42, 0.035);
}

.skill-item strong,
.skill-item span {
    display: block;
}

.skill-item strong {
    color: var(--text);
    font-size: 0.94rem;
}

.skill-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
}

.section-heading h2,
.download-panel h2 {
    margin-top: 8px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
}

.split-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
}

.glass-panel,
.personal-panel,
.info-grid article,
.skill-columns article,
.project-card,
.contact-panel,
.download-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
}

.glass-panel {
    padding: 32px;
}

.glass-panel h3,
.personal-panel h3,
.contact-panel h3 {
    font-size: 1.45rem;
    line-height: 1.35;
}

.glass-panel p,
.personal-panel p,
.skill-columns p,
.project-card p,
.contact-panel p,
.download-panel p {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.72;
}

.personal-panel {
    align-self: stretch;
    padding: 32px;
}

.personal-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.personal-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.personal-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.personal-list dt {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.personal-list dd {
    margin-top: 6px;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.4;
}

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

.info-grid article {
    min-height: 156px;
    padding: 22px;
}

.info-grid i,
.project-icon {
    color: var(--cyan);
    font-size: 1.45rem;
}

.info-grid span {
    display: block;
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.83rem;
}

.info-grid strong {
    display: block;
    margin-top: 6px;
    line-height: 1.35;
}

.skill-orbit {
    position: relative;
    display: grid;
    min-height: 430px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.orbit-core {
    position: relative;
    z-index: 3;
    display: grid;
    width: 170px;
    height: 170px;
    place-items: center;
    border: 1px solid rgba(56, 213, 255, 0.34);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 213, 255, 0.22), rgba(6, 9, 17, 0.92));
    color: var(--text);
    text-align: center;
    box-shadow: 0 0 70px rgba(56, 213, 255, 0.22);
}

body.light-theme .orbit-core {
    background: radial-gradient(circle, rgba(0, 119, 182, 0.14), rgba(255, 255, 255, 0.92));
}

.orbit-core i {
    font-size: 2.2rem;
}

.orbit-core span {
    font-weight: 800;
    line-height: 1.15;
}

.skill-cloud {
    position: absolute;
    inset: 0;
    animation: spin 36s linear infinite;
}

.skill-cloud span {
    position: absolute;
    left: 50%;
    top: 50%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: #e9f0fb;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 10px 14px;
    transform:
        rotate(calc(var(--i) * 30deg))
        translateX(clamp(120px, 30vw, 350px))
        rotate(calc(var(--i) * -30deg));
}

body.light-theme .skill-cloud span {
    color: #152033;
}

.skill-columns,
.project-grid {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.skill-columns {
    grid-template-columns: repeat(3, 1fr);
}

.skill-columns article,
.project-card {
    padding: 24px;
}

.skill-columns h3,
.project-card h3 {
    font-size: 1.14rem;
    line-height: 1.35;
}

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

.project-card {
    min-height: 360px;
    transform-style: preserve-3d;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-card.featured {
    grid-column: span 2;
    min-height: 310px;
}

.project-card:hover {
    border-color: rgba(56, 213, 255, 0.48);
    background: rgba(20, 31, 48, 0.88);
    transform: translateY(-8px) rotateX(3deg);
}

body.light-theme .project-card:hover {
    background: rgba(255, 255, 255, 0.96);
}

.project-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 8px;
    background: rgba(56, 213, 255, 0.12);
    margin-bottom: 18px;
}

.project-type {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.project-card .chip-row {
    margin-top: 20px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.project-links a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #e7eefb;
    font-weight: 800;
    padding: 9px 12px;
}

body.light-theme .project-links a,
body.light-theme .contact-links a {
    background: rgba(13, 24, 42, 0.04);
    color: #152033;
}

.download-panel,
.contact-panel {
    display: grid;
    align-items: center;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
    padding: 32px;
}

.download-actions {
    align-content: center;
    margin-top: 0;
}

.download-actions a {
    width: 100%;
}

.contact-links {
    display: grid;
    gap: 10px;
}

.contact-links a {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #e7eefb;
    font-weight: 700;
    padding: 13px 14px;
    overflow-wrap: anywhere;
}

.contact-links a:hover {
    border-color: rgba(56, 213, 255, 0.5);
}

footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 28px 16px;
    text-align: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 980px) {
    .hero,
    .split-layout,
    .contact-panel,
    .download-panel {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 24px;
    }

    .profile-stage {
        min-height: 450px;
    }

    .skill-columns,
    .project-grid,
    .technical-skills {
        grid-template-columns: 1fr;
    }

    .project-card.featured {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .navbar {
        top: 10px;
        width: calc(100% - 20px);
    }

    .menu-toggle {
        display: flex;
        width: 42px;
        height: 42px;
    }

    .nav-controls {
        margin-left: 0;
        margin-right: 0;
    }

    .theme-toggle,
    .language-toggle {
        width: 42px;
        min-height: 42px;
        padding: 0;
    }

    .theme-toggle span,
    .language-toggle span {
        display: none;
    }

    .menu {
        position: fixed;
        inset: 72px 0 auto 0;
        display: none;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(6, 9, 17, 0.96);
        padding: 10px;
        backdrop-filter: blur(18px);
    }

    body.light-theme .menu {
        background: rgba(255, 255, 255, 0.96);
    }

    .menu.active {
        display: grid;
    }

    .menu a {
        padding: 14px;
    }

    .section {
        width: min(100% - 22px, 1120px);
        padding: 82px 0;
    }

    .hero {
        padding-top: 126px;
    }

    .stats,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .profile-card__media {
        height: 430px;
    }

    .skill-orbit {
        min-height: 360px;
    }

    .orbit-core {
        width: 138px;
        height: 138px;
    }

    .skill-cloud span {
        font-size: 0.78rem;
        padding: 8px 10px;
        transform:
            rotate(calc(var(--i) * 30deg))
            translateX(clamp(90px, 34vw, 170px))
            rotate(calc(var(--i) * -30deg));
    }

    .contact-panel,
    .download-panel,
    .glass-panel,
    .personal-panel {
        padding: 22px;
    }

    .skills-showcase-heading {
        margin-bottom: 34px;
    }

    .skill-group {
        padding: 22px;
    }

    .skill-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .hero-actions {
        display: grid;
    }

    .primary-action,
    .secondary-action,
    .ghost-action {
        width: 100%;
    }

    .profile-stage {
        min-height: 400px;
    }

    .profile-card__media {
        height: 390px;
    }
}
