:root {
    --bg: #070a16;
    --bg-accent: radial-gradient(circle at 20% 20%, rgba(124, 240, 255, 0.08), transparent 35%), radial-gradient(circle at 80% 0%, rgba(255, 122, 255, 0.08), transparent 30%), radial-gradient(circle at 50% 70%, rgba(120, 92, 255, 0.12), transparent 40%);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --text: #e8ecf6;
    --muted: #9aa3b5;
    --accent: #7cf0ff;
    --accent-2: #a2a5ff;
    --card-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
    --bg-overlay-opacity: 0;
}

[data-theme="cosmic"] {
    --bg: #040511;
    --bg-accent: radial-gradient(circle at 15% 25%, rgba(124, 240, 255, 0.12), transparent 35%), radial-gradient(circle at 85% 10%, rgba(255, 122, 255, 0.18), transparent 34%), radial-gradient(circle at 55% 70%, rgba(73, 50, 255, 0.25), transparent 38%);
    --surface: rgba(255, 255, 255, 0.07);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --text: #f5f7ff;
    --muted: #b7c0d8;
    --accent: #7cf0ff;
    --accent-2: #ff9cf5;
    --card-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 35px 90px rgba(0, 0, 0, 0.6);
    --bg-overlay-opacity: 1;
    --comet-opacity: 1;
}

:root {
    --comet-opacity: 0;
}

/* Base Styles */
body {
    font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    background-image: var(--bg-accent);
    margin: 0;
    padding: 0;
    color: var(--text);
    transition: background 0.4s ease, color 0.3s ease;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.75), transparent 45%),
        radial-gradient(2px 2px at 80% 20%, rgba(124, 240, 255, 0.9), transparent 45%),
        radial-gradient(1.5px 1.5px at 60% 70%, rgba(255, 156, 245, 0.75), transparent 45%),
        radial-gradient(1.5px 1.5px at 30% 80%, rgba(124, 240, 255, 0.75), transparent 45%),
        radial-gradient(2px 2px at 50% 50%, rgba(255, 255, 255, 0.8), transparent 45%),
        radial-gradient(3px 3px at 10% 60%, rgba(255, 255, 255, 0.6), transparent 45%),
        radial-gradient(3px 3px at 90% 40%, rgba(255, 255, 255, 0.6), transparent 45%);
    opacity: var(--bg-overlay-opacity);
    pointer-events: none;
    mix-blend-mode: screen;
    animation: starsFloat 14s ease-in-out infinite alternate, twinkle 5s ease-in-out infinite alternate;
    transition: opacity 0.4s ease;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(124, 240, 255, 0.12), transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(255, 156, 245, 0.12), transparent 42%);
    opacity: calc(var(--bg-overlay-opacity) * 0.9);
    pointer-events: none;
    filter: blur(20px);
    animation: auroraShift 10s ease-in-out infinite alternate;
    transition: opacity 0.4s ease;
}

.comet {
    position: fixed;
    top: -20vh;
    left: -10vw;
    width: 2px;
    height: 220px;
    background: linear-gradient(180deg, rgba(124, 240, 255, 0.85), rgba(255, 156, 245, 0));
    filter: blur(1px);
    opacity: var(--comet-opacity);
    transform: rotate(-30deg);
    animation: cometFall 6s linear infinite;
    pointer-events: none;
    mix-blend-mode: screen;
}

.comet.comet-2 {
    left: 60vw;
    animation-delay: 1.5s;
    animation-duration: 7s;
}

.comet.comet-3 {
    left: 85vw;
    animation-delay: 3s;
    animation-duration: 8s;
}

body:not(.comets-on) .comet {
    display: none;
}

.orbital-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.orbital {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 240, 255, 0.55), rgba(162, 165, 255, 0.08));
    filter: blur(2px);
    opacity: 0;
    animation: floatOrbit 16s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.orbital.orb-1 {
    top: 18%;
    left: 12%;
    animation-duration: 17s;
}

.orbital.orb-2 {
    top: 45%;
    left: 68%;
    width: 160px;
    height: 160px;
    animation-duration: 20s;
}

.orbital.orb-3 {
    top: 72%;
    left: 28%;
    width: 90px;
    height: 90px;
    animation-duration: 14s;
}

body.comets-on .orbital-field {
    opacity: 0.9;
}

body.comets-on .orbital {
    opacity: 0.65;
    animation-play-state: running;
}

/* Typography */
h1 {
    font-size: clamp(48px, 6vw, 78px);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Hero Section */
.minh-100 {
    width: 100%;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
    text-align: left;
}

.hero-content .top-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-lede {
    font-size: clamp(18px, 2vw, 22px);
    color: var(--muted);
    max-width: 720px;
    margin: 0.5rem 0 0;
}

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

.pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0.5rem;
}

.btn-ghost,
.btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
}

.btn-solid {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060d;
    border: none;
}

.btn-ghost:hover,
.btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.55);
}

.hero-nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

.hero-nav .link-light {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text);
    letter-spacing: 0.04em;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hero-nav .link-light:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}


/* Layout */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 15px;
}

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

.link-light:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

section {
    margin: 60px 0;
    padding: 60px 0;
}

/* Bio Section */
.bio {
    padding: 0;
    margin: 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
}

.bio-content {
    background: var(--surface);
    border-radius: 18px;
    padding: 2.5rem;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}



.bio h2 {
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.bio p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--muted);
}

.bio p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .hero-content {
        padding: 1.5rem 1rem;
        min-height: auto;
        align-items: center;
        text-align: center;
    }

    .hero-content .top-content {
        align-items: center;
        gap: 0.25rem;
    }

    .hero-content h1 {
        margin-bottom: 0 !important;
    }

    .hero-lede {
        margin-top: 0;
    }

    .cta-row {
        margin-top: 0.5rem !important;
    }

    .hero-eyebrow {
        align-self: center;
    }

    .cta-row {
        justify-content: center;
    }

    .btn-ghost,
    .btn-solid {
        flex: 0 1 auto;
        width: 100%;
        justify-content: center;
    }

    .cta-row .link-light {
        width: 100%;
        justify-content: center;
        margin: 5px 0 0 0 !important;
    }

    .hero-tags {
        display: none;
    }

    .pill {
        font-size: 12px;
    }

    .bio h2,
    .portfolio h2 {
        font-size: 26px;
    }

    .bio-content {
        padding: 1.75rem;
        margin: 1rem 0.25rem;
    }
}

@media (max-width: 480px) {
    .hero-lede {
        font-size: 17px;
    }

    .hero-tags {
        display: none;
    }
}

/* Dark Mode Toggle */
.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 999;
    transform: scale(0.7);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.theme-switch {
    display: inline-block;
    height: 40px;
    position: relative;
    width: 80px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: rgba(255, 255, 255, 0.3);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.slider:before {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    bottom: 4px;
    content: "";
    height: 32px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 32px;
}

input:checked + .slider {
    background-color: rgba(0, 0, 0, 0.3);
}

input:checked + .slider:before {
    transform: translateX(40px);
    box-shadow: 0 0 25px rgba(124, 240, 255, 0.5), 0 0 35px rgba(255, 156, 245, 0.35);
}

.slider.round {
    border-radius: 40px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}



/* Footer Styles */
.footer {
    padding: 30px 0;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--card-border);
    width: 100%;
    left: 0;
    right: 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    color: var(--text);
    font-size: 24px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.copyright {
    margin: 0;
    opacity: 0.7;
    color: var(--muted);
}


/* Animations */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes starsFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(-10px, -10px, 0) scale(1.02);
    }
}

@keyframes twinkle {
    0% {
        opacity: 0.65;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.75;
    }
}

@keyframes floatOrbit {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(18px, -12px, 0) scale(1.05);
    }
    100% {
        transform: translate3d(-12px, 20px, 0) scale(0.98);
    }
}

@keyframes auroraShift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: calc(var(--bg-overlay-opacity) * 0.6);
    }
    100% {
        transform: translate3d(10px, -10px, 0) scale(1.05);
        opacity: calc(var(--bg-overlay-opacity) * 0.9);
    }
}

@keyframes cometFall {
    0% {
        transform: translate3d(0, -20vh, 0) rotate(-30deg);
        opacity: 0;
    }
    10% {
        opacity: var(--comet-opacity);
    }
    100% {
        transform: translate3d(-30vw, 120vh, 0) rotate(-30deg);
        opacity: 0;
    }
}

/* Back to Top Rocket */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060d;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(124, 240, 255, 0.4);
}

.back-to-top i {
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: rotate(-45deg) translateY(-3px) translateX(3px);
}
