:root {
    --bg: #0a0f1f;
    --bg-alt: #09142b;
    --card: rgba(255, 255, 255, 0.05);
    --text: #e9eef7;
    --muted: #9fb1d5;
    --accent: #66f6c1;
    --accent-strong: #fb8bff;
    --accent-2: #7ea1ff;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --radius: 16px;
    --radius-sm: 12px;
    --max-width: 1180px;
    --transition: 220ms ease;
    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.15'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(102, 246, 193, 0.12), transparent 30%), radial-gradient(circle at 80% 10%, rgba(126, 161, 255, 0.16), transparent 35%), var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    background: conic-gradient(from 120deg, rgba(251, 139, 255, 0.15), rgba(102, 246, 193, 0.18), rgba(126, 161, 255, 0.12), rgba(251, 139, 255, 0.18));
    filter: blur(140px);
    opacity: 0.55;
    mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 75%);
    animation: hueShift 12s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

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

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: var(--noise);
    opacity: 0.35;
    mix-blend-mode: soft-light;
    z-index: 1;
}

.container {
    width: min(100%, var(--max-width));
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3 {
    color: #f6f9ff;
    margin: 0 0 0.4em;
    letter-spacing: -0.02em;
}

p {
    color: var(--muted);
    margin: 0 0 1em;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(12, 18, 36, 0.75);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    color: #f6f9ff;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color var(--transition), text-shadow var(--transition), transform var(--transition);
}

.logo:hover {
    color: var(--accent-strong);
    text-shadow: 0 0 18px rgba(251, 139, 255, 0.55);
    transform: translateY(-1px);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #0b1224;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.logo-text {
    display: inline-block;
}

.nav {
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: #0b1224;
    background: linear-gradient(120deg, var(--accent-strong), var(--accent));
}

.nav-toggle {
    display: none;
    background: transparent;
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    font-size: 1rem;
}

.hero {
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero.hero-compact {
    padding: 96px 0 56px;
}

.hero.hero-compact .cta-row {
    margin: 1.1rem 0 0.65rem;
}

.section.section-tight {
    padding: 64px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: clamp(2.6rem, 4vw, 3.4rem);
}

.subtitle {
    font-size: 1.05rem;
}

.lead {
    max-width: 36rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(120deg, rgba(102, 246, 193, 0.2), rgba(251, 139, 255, 0.28));
    color: #f6f9ff;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 600;
}

.pill.small {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.cta-row {
    display: flex;
    gap: 0.75rem;
    margin: 1.3rem 0 0.8rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 1.3rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    color: #0b1224;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    position: relative;
    overflow: hidden;
}

.btn.primary {
    background: linear-gradient(120deg, var(--accent-strong), var(--accent));
    box-shadow: 0 15px 40px rgba(251, 139, 255, 0.25);
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: #f6f9ff;
}

.btn.small {
    padding: 0.65rem 0.95rem;
}

.btn.full {
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-card {
    position: relative;
}

.hero-card-inner {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.stack-list {
    padding-left: 1.2rem;
    margin: 0 0 1.2rem;
    color: #d7e9ff;
}

.mini-title {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0 0 0.3rem;
}

.mini-copy {
    margin: 0;
}

.floating-badge {
    position: absolute;
    top: -14px;
    right: 12px;
    background: #101b35;
    border: 1px solid var(--border);
    color: var(--accent-strong);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.blob {
    position: absolute;
    filter: blur(90px);
    opacity: 0.45;
}

.blob-1 {
    width: 320px;
    height: 320px;
    background: #66f6c1;
    top: 10%;
    left: -8%;
}

.blob-2 {
    width: 380px;
    height: 380px;
    background: #7ea1ff;
    bottom: -10%;
    right: -12%;
}

.section {
    padding: 80px 0;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: var(--accent-strong);
    margin-bottom: 0.35rem;
}

.eyebrow.small {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.section-lead {
    max-width: 680px;
    margin: 0.5rem auto 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.points {
    padding-left: 1.15rem;
    color: #d7e9ff;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(251, 139, 255, 0.18);
    border: 1px solid var(--border);
    color: #d7e9ff;
}

.skills-grid,
.projects-grid,
.lab-grid,
.contact-grid {
    display: grid;
    gap: 1.25rem;
}

.skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skill-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.skill-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(251, 139, 255, 0.12), rgba(102, 246, 193, 0.12));
    opacity: 0;
    transition: opacity var(--transition);
}

.skill-card:hover::after {
    opacity: 1;
}

.skill-card h3 {
    position: relative;
    z-index: 1;
}

.skill-line,
.bullets {
    position: relative;
    z-index: 1;
}

.bullets {
    color: #d7e9ff;
    padding-left: 1.1rem;
}

.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: transform var(--transition), border-color var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 139, 255, 0.6);
}

.project-card .btn {
    color: #0b1224;
    background: linear-gradient(120deg, var(--accent-strong), var(--accent));
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(251, 139, 255, 0.25);
}

.project-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(251, 139, 255, 0.28);
}

.project-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.project-desc {
    margin: 0;
}

.lab-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.lab-card {
    padding: 1.2rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color var(--transition), transform var(--transition);
}

.lab-card:hover {
    transform: translateY(-3px);
    border-color: rgba(126, 161, 255, 0.5);
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.inline-link:hover {
    text-decoration: underline;
}

.cursor {
    display: inline-block;
    width: 10px;
    margin-right: 4px;
    color: #f6f9ff;
    animation: blink 1s steps(2, start) infinite;
}

.typed {
    color: inherit;
}

.bubble {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(251, 139, 255, 0.9), rgba(102, 246, 193, 0.5));
    pointer-events: none;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.6);
    animation: pop 800ms ease forwards;
    mix-blend-mode: screen;
    z-index: 5;
}

.btn.rippling::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(255,255,255,0.35), rgba(255,255,255,0));
    opacity: 0;
    animation: ripple 600ms ease;
}

@keyframes pop {
    to {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

@keyframes ripple {
    0% { opacity: 0.35; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.2); }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.site-footer {
    padding: 32px 0 40px;
    border-top: 1px solid var(--border);
    background: rgba(10, 15, 30, 0.8);
    position: relative;
    z-index: 2;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 0.85rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-strong);
}

.cursor-blob {
    position: fixed;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(251, 139, 255, 0.6), rgba(102, 246, 193, 0.35));
    filter: blur(35px);
    opacity: 0.9;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
}

.floaty {
    position: fixed;
    width: 110px;
    height: 110px;
    border-radius: 30% 70% 60% 40%;
    background: linear-gradient(150deg, rgba(251, 139, 255, 0.38), rgba(102, 246, 193, 0.32));
    filter: blur(32px);
    opacity: 0.25;
    mix-blend-mode: screen;
    pointer-events: none;
    animation: floaty 16s ease-in-out infinite;
    mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 85%);
}

.magnetic {
    transition: transform 200ms ease, box-shadow 220ms ease;
}

.btn.magnetic:hover {
    box-shadow: 0 22px 46px rgba(251, 139, 255, 0.28);
}

@keyframes hueShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(30deg); }
}

@keyframes floaty {
    0% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-20px) translateX(10px) rotate(6deg); }
    100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        right: 0;
        background: rgba(11, 18, 36, 0.95);
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        flex-direction: column;
        width: 200px;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        padding-top: 100px;
    }

    .hero.hero-compact {
        padding-top: 84px;
    }
}

@media (max-width: 540px) {
    .header-inner {
        height: 64px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .cta-row {
        flex-direction: column;
    }
}
