:root {
    --bg: #07090f;
    --bg-soft: #0c1020;
    --surface: rgba(17, 25, 44, 0.58);
    --surface-strong: rgba(22, 33, 58, 0.9);
    --text: #ecf2ff;
    --muted: #91a0c1;
    --line: rgba(145, 160, 193, 0.25);
    --brand: #18f7d3;
    --brand-alt: #38a0ff;
    --accent: #ff5cb8;
    --shadow: 0 24px 60px rgba(6, 10, 24, 0.5);
    --radius: 18px;
}

:root[data-theme="light"] {
    --bg: #e6ecff;
    --bg-soft: #f4f7ff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --text: #0b1021;
    --muted: #3c4562;
    --line: rgba(18, 29, 58, 0.2);
    --brand: #0078ff;
    --brand-alt: #00ae8a;
    --accent: #ff3c8d;
    --shadow: 0 24px 60px rgba(106, 124, 170, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    background: radial-gradient(circle at 15% -10%, rgba(56, 160, 255, 0.2), transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(255, 92, 184, 0.18), transparent 42%),
        linear-gradient(180deg, var(--bg-soft), var(--bg));
    color: var(--text);
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 60;
    pointer-events: none;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--brand), var(--brand-alt), var(--accent));
    box-shadow: 0 0 24px color-mix(in srgb, var(--brand-alt) 42%, transparent);
}

main,
.section,
.footer {
    position: relative;
    z-index: 3;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.15;
    background-image: radial-gradient(rgba(255, 255, 255, 0.45) 0.45px, transparent 0.45px);
    background-size: 3px 3px;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

#preloader {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 1rem;
    background: #05070f;
    z-index: 999;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-ring {
    width: 56px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--brand);
    animation: spin 1s linear infinite;
    margin-inline: auto;
}

#preloader p {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.74rem;
    color: #c5d0ef;
}

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

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-family: "Syne", sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    transition: color 0.25s ease, background 0.25s ease;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text);
    background: rgba(56, 160, 255, 0.14);
}

.menu-toggle,
.theme-toggle {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle {
    padding: 0 0.9rem;
    font-size: 0.8rem;
}

.menu-toggle {
    display: none;
    width: 40px;
    position: relative;
}

.menu-toggle span {
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.3s ease;
}

.menu-toggle span:first-child {
    transform: translateY(-4px);
}

.menu-toggle span:last-child {
    transform: translateY(4px);
}

.menu-toggle[aria-expanded="true"] span:first-child {
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
    transform: rotate(-45deg);
}

.hero {
    min-height: min(100vh, 980px);
    display: grid;
    align-items: center;
    overflow: clip;
    padding: 7rem 0 4rem;
}

.hero-canvas,
.hero-gradient {
    position: absolute;
    inset: 0;
}

.hero-gradient {
    background: radial-gradient(circle at center, transparent 30%, color-mix(in srgb, var(--bg) 84%, transparent));
    z-index: 1;
}

.hero-canvas {
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 4;
}

.eyebrow,
.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--brand);
    font-size: 0.73rem;
    margin: 0 0 1rem;
}

.hero-title,
.section-title {
    font-family: "Syne", sans-serif;
    letter-spacing: 0.02em;
}

.hero-title {
    margin: 0;
    font-size: clamp(2.05rem, 5.8vw, 5.15rem);
    line-height: 1;
    max-width: 10ch;
}

.hero-title span {
    display: block;
    margin-top: 0.9rem;
    font-size: clamp(1rem, 2.2vw, 1.45rem);
    color: var(--muted);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    max-width: 33ch;
}

.hero-description {
    margin: 1.5rem 0;
    max-width: 58ch;
    color: var(--muted);
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.btn {
    position: relative;
    border: 0;
    text-decoration: none;
    color: var(--text);
    padding: 0.9rem 1.3rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
    cursor: pointer;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(110deg, var(--brand-alt), var(--brand));
    color: #031120;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand-alt) 40%, transparent);
}

.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--line);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 1.7rem;
}

.stat-pill {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    background: var(--surface);
    backdrop-filter: blur(10px);
}

.stat-pill strong {
    display: block;
    font-size: 1.2rem;
    color: var(--brand);
}

.stat-pill span {
    color: var(--muted);
    font-size: 0.82rem;
}

.section {
    padding: 4.3rem 0;
}

.section-title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.45rem, 4.4vw, 2.65rem);
    max-width: 17ch;
}

.split-layout {
    display: grid;
    gap: 1.2rem;
}

.glass-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.about-panel {
    padding: 1.4rem;
}

.about-paragraphs {
    display: grid;
    gap: 1rem;
}

.about-paragraphs p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.about-badges {
    margin-top: 1.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.about-badges span {
    background: rgba(24, 247, 211, 0.09);
    border: 1px solid rgba(24, 247, 211, 0.35);
    color: var(--brand);
    border-radius: 999px;
    padding: 0.4rem 0.68rem;
    font-size: 0.78rem;
}

.skills-grid,
.projects-grid {
    display: grid;
    gap: 0.95rem;
}

.skill-card,
.project-card,
.timeline-item,
.contact-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.skill-card {
    padding: 1rem;
}

.skill-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.skill-row {
    margin-bottom: 0.7rem;
}

.skill-row:last-child {
    margin-bottom: 0;
}

.skill-row-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.38rem;
    font-size: 0.86rem;
    color: var(--muted);
}

.skill-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(145, 160, 193, 0.2);
    overflow: hidden;
}

.skill-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-alt));
}

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

.project-card {
    padding: 1.1rem;
    transform-style: preserve-3d;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
    border-color: rgba(24, 247, 211, 0.5);
}

.project-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.project-meta {
    display: inline-block;
    margin: 0.75rem 0 0.65rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(56, 160, 255, 0.14);
    color: #8fc4ff;
    font-size: 0.75rem;
}

.project-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

.project-link {
    margin-top: 0.85rem;
    display: inline-block;
    font-size: 0.82rem;
    color: var(--brand);
    text-decoration: none;
}

.timeline {
    display: grid;
    gap: 0.95rem;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.timeline-item {
    padding: 1rem 1rem 1rem 2.1rem;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    width: 10px;
    aspect-ratio: 1;
    border-radius: 50%;
    left: 7px;
    top: 1.35rem;
    background: linear-gradient(130deg, var(--brand), var(--accent));
    box-shadow: 0 0 20px rgba(24, 247, 211, 0.55);
}

.timeline-item h3 {
    margin: 0;
    font-size: 1rem;
}

.timeline-role {
    margin: 0.2rem 0;
    color: var(--brand);
    font-size: 0.82rem;
}

.timeline-date {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.timeline-item p {
    margin: 0.8rem 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.contact-wrap {
    display: grid;
    gap: 1rem;
}

.contact-copy {
    color: var(--muted);
    max-width: 45ch;
}

.contact-cards {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.contact-item {
    padding: 0.75rem;
}

.contact-item span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
}

.contact-item a,
.contact-item p {
    margin: 0.26rem 0 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-form {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.contact-form label {
    display: grid;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0.75rem;
    font-family: inherit;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 1px solid var(--brand-alt);
    border-color: var(--brand-alt);
}

.form-feedback {
    min-height: 1.2em;
    margin: 0;
    color: var(--brand);
    font-size: 0.8rem;
}

.footer {
    border-top: 1px solid var(--line);
    padding: 1.1rem 0 2.1rem;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.cursor-dot,
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--brand);
}

.cursor-glow {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(24, 247, 211, 0.55);
    box-shadow: 0 0 26px rgba(24, 247, 211, 0.35);
}

[data-reveal],
.skill-card,
.project-card,
.timeline-item,
.contact-item,
.contact-form {
    opacity: 0;
    transform: translateY(20px);
}

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        right: 1rem;
        top: calc(100% + 0.5rem);
        width: min(260px, calc(100vw - 2rem));
        display: grid;
        gap: 0.25rem;
        padding: 0.6rem;
        border-radius: 14px;
        background: var(--surface-strong);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    }

    .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .theme-toggle {
        margin-left: auto;
    }
}

@media (min-width: 740px) {
    .split-layout {
        grid-template-columns: 0.9fr 1.1fr;
    }

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

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

    .contact-wrap {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}

@media (min-width: 1040px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (hover: none), (pointer: coarse) {
    .cursor-dot,
    .cursor-glow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
