/* ---------- Base Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    color: #e5e7eb;
    background:
        /* Large bright stars */
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, #67e8f9, transparent),
        radial-gradient(2px 2px at 15% 85%, white, transparent),
        radial-gradient(2px 2px at 75% 15%, #a5b4fc, transparent),
        radial-gradient(2px 2px at 35% 45%, white, transparent),
        radial-gradient(2px 2px at 88% 25%, white, transparent),
        /* Medium stars */
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, #a5b4fc, transparent),
        radial-gradient(1px 1px at 15% 60%, white, transparent),
        radial-gradient(1px 1px at 70% 20%, white, transparent),
        radial-gradient(1px 1px at 25% 10%, white, transparent),
        radial-gradient(1px 1px at 85% 80%, white, transparent),
        radial-gradient(1px 1px at 45% 35%, #67e8f9, transparent),
        radial-gradient(1px 1px at 12% 42%, white, transparent),
        radial-gradient(1px 1px at 68% 55%, white, transparent),
        radial-gradient(1px 1px at 92% 48%, white, transparent),
        radial-gradient(1px 1px at 38% 18%, white, transparent),
        radial-gradient(1px 1px at 58% 88%, #67e8f9, transparent),
        radial-gradient(1px 1px at 5% 25%, white, transparent),
        radial-gradient(1px 1px at 48% 72%, white, transparent),
        radial-gradient(1px 1px at 82% 38%, white, transparent),
        /* Small stars - creating the dense starfield */
        radial-gradient(0.5px 0.5px at 10% 20%, white, transparent),
        radial-gradient(0.5px 0.5px at 30% 40%, white, transparent),
        radial-gradient(0.5px 0.5px at 55% 15%, white, transparent),
        radial-gradient(0.5px 0.5px at 75% 45%, white, transparent),
        radial-gradient(0.5px 0.5px at 40% 65%, white, transparent),
        radial-gradient(0.5px 0.5px at 65% 85%, white, transparent),
        radial-gradient(0.5px 0.5px at 95% 35%, white, transparent),
        radial-gradient(0.5px 0.5px at 22% 90%, white, transparent),
        radial-gradient(0.5px 0.5px at 8% 8%, white, transparent),
        radial-gradient(0.5px 0.5px at 18% 52%, white, transparent),
        radial-gradient(0.5px 0.5px at 42% 28%, white, transparent),
        radial-gradient(0.5px 0.5px at 62% 62%, white, transparent),
        radial-gradient(0.5px 0.5px at 78% 78%, white, transparent),
        radial-gradient(0.5px 0.5px at 28% 68%, white, transparent),
        radial-gradient(0.5px 0.5px at 52% 8%, white, transparent),
        radial-gradient(0.5px 0.5px at 88% 52%, white, transparent),
        radial-gradient(0.5px 0.5px at 14% 35%, white, transparent),
        radial-gradient(0.5px 0.5px at 35% 58%, white, transparent),
        radial-gradient(0.5px 0.5px at 72% 32%, white, transparent),
        radial-gradient(0.5px 0.5px at 98% 68%, white, transparent),
        radial-gradient(0.5px 0.5px at 26% 12%, white, transparent),
        radial-gradient(0.5px 0.5px at 46% 82%, white, transparent),
        radial-gradient(0.5px 0.5px at 66% 42%, white, transparent),
        radial-gradient(0.5px 0.5px at 86% 92%, white, transparent),
        radial-gradient(0.5px 0.5px at 4% 48%, white, transparent),
        radial-gradient(0.5px 0.5px at 32% 22%, white, transparent),
        radial-gradient(0.5px 0.5px at 54% 95%, white, transparent),
        radial-gradient(0.5px 0.5px at 74% 5%, white, transparent),
        radial-gradient(0.5px 0.5px at 94% 75%, white, transparent),
        radial-gradient(0.5px 0.5px at 16% 78%, white, transparent),
        radial-gradient(0.5px 0.5px at 38% 38%, white, transparent),
        radial-gradient(0.5px 0.5px at 58% 58%, white, transparent),
        radial-gradient(0.5px 0.5px at 84% 18%, white, transparent),
        radial-gradient(0.5px 0.5px at 44% 92%, white, transparent),
        radial-gradient(0.5px 0.5px at 64% 12%, white, transparent),
        radial-gradient(0.5px 0.5px at 2% 62%, white, transparent),
        radial-gradient(0.5px 0.5px at 24% 2%, white, transparent),
        radial-gradient(0.5px 0.5px at 50% 75%, white, transparent),
        radial-gradient(0.5px 0.5px at 70% 98%, white, transparent),
        radial-gradient(0.5px 0.5px at 90% 28%, white, transparent),
        /* Deep space gradient */
        radial-gradient(circle at 20% 20%, #1e293b 0%, #0f172a 40%, #020617 70%);
    background-size:
        200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
        200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
        200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
        100% 100%;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    animation: twinkle 8s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

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

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

/* ---------- Layout ---------- */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.shell {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* ---------- Top Navigation ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 1rem;
}

.logo-wordmark {
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    font-size: 0.9rem;
}

.nav a {
    position: relative;
    color: #d1d5db;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 0;
    height: 1px;
    background: linear-gradient(to right, #67e8f9, #38bdf8);
    transition: width 0.25s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after {
    width: 100%;
}

.nav a.active {
    color: #e5e7eb;
    font-weight: 500;
}

.nav a.active::after {
    width: 100%;
}

/* ---------- Main Hero Section ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
    gap: 3rem;
    align-items: center;
}

/* ---------- Stellar Navigation System ---------- */

/* Container for the entire stellar system */
.portrait-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 450px;
}

.stellar-system {
    position: relative;
    width: 380px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -------------------------- Central Star (Portrait) -------------------------- */

.portrait-frame {
    position: relative;
    padding: 0.75rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #0ea5e9 0, #020617 55%);
    box-shadow:
        0 0 60px rgba(56, 189, 248, 0.4),
        0 18px 40px rgba(15, 23, 42, 0.9);
    z-index: 10;
    animation: starPulse 4s ease-in-out infinite;
}

@keyframes starPulse {

    0%,
    100% {
        box-shadow: 0 0 60px rgba(56, 189, 248, 0.4), 0 18px 40px rgba(15, 23, 42, 0.9);
    }

    50% {
        box-shadow: 0 0 80px rgba(56, 189, 248, 0.6), 0 18px 40px rgba(15, 23, 42, 0.9);
    }
}

.portrait-inner {
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #020617;
}

.portrait {
    width: 160px;
    height: 160px;
    object-fit: cover;
    object-position: center;
    filter: blur(2px) brightness(0.9);
    transition: filter 0.4s ease;
}

.portrait-frame:hover .portrait {
    filter: blur(0) brightness(1);
}

/* -------------------------- Orbital Paths -------------------------- */

.orbit {
    position: absolute;
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.orbit-1 {
    width: 260px;
    height: 260px;
}

.orbit-2 {
    width: 320px;
    height: 320px;
}

.orbit-3 {
    width: 380px;
    height: 380px;
}

/* -------------------------- Planet Navigation Links -------------------------- */

/* Container for all planet links */
.planet-links {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual planet wrapper */
.planet {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: all;
}

/* Planet link styling */
.planet a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

/* Planet label text (always visible, horizontal) */
.planet a::after {
    content: attr(data-label);
    font-size: 0.85rem;
    color: #d1d5db;
    white-space: nowrap;
    transition: color 0.25s ease;
    position: relative;
    display: inline-block;
    padding-bottom: 0.35rem;
}

/* Position each planet on different orbits with counter-rotation for horizontal text */
.planet:nth-child(1) {
    transform: translate(-50%, -50%) rotate(0deg) translateX(130px) rotate(0deg);
}

.planet:nth-child(2) {
    transform: translate(-50%, -50%) rotate(51deg) translateX(160px) rotate(-51deg);
}

.planet:nth-child(3) {
    transform: translate(-50%, -50%) rotate(102deg) translateX(190px) rotate(-102deg);
}

.planet:nth-child(4) {
    transform: translate(-50%, -50%) rotate(153deg) translateX(130px) rotate(-153deg);
}

.planet:nth-child(5) {
    transform: translate(-50%, -50%) rotate(204deg) translateX(160px) rotate(-204deg);
}

.planet:nth-child(6) {
    transform: translate(-50%, -50%) rotate(255deg) translateX(190px) rotate(-255deg);
}

.planet:nth-child(7) {
    transform: translate(-50%, -50%) rotate(306deg) translateX(130px) rotate(-306deg);
}

/* -------------------------- Social Planet Styles (Active) -------------------------- */

/* Social planet dot appearance */
.planet.social a::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a5b4fc;
    box-shadow: 0 0 12px rgba(165, 180, 252, 0.6);
    transition: all 0.3s ease;
}

/* Social planet dot hover effect */
.planet.social a:hover::before {
    background: #818cf8;
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.8);
    transform: scale(1.5);
}

/* Social planet label hover effect */
.planet.social a:hover::after {
    color: #a5b4fc;
}

/* Right: Text intro */
.intro {
    max-width: 620px;
}

.intro-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #9ca3af;
    margin-bottom: 0.6rem;
}

.intro-name {
    font-size: clamp(2.3rem, 3vw, 2.9rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}

.intro-subtitle {
    font-size: 0.98rem;
    color: #a5b4fc;
    margin-bottom: 1.7rem;
}

.intro-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #d1d5db;
    margin-bottom: 2.2rem;
}

.intro-body span.accent {
    color: #a5b4fc;
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 1.75rem;
}

.button-primary,
.button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background-color 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        transform 0.18s ease;
}

.button-primary {
    background: linear-gradient(to right, #a5b4fc, #818cf8);
    color: #020617;
    font-weight: 500;
    box-shadow:
        0 14px 30px rgba(8, 47, 73, 0.8),
        0 0 26px rgba(165, 180, 252, 0.4);
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 40px rgba(8, 47, 73, 0.9),
        0 0 40px rgba(165, 180, 252, 0.45);
}

.button-ghost {
    border-color: rgba(148, 163, 184, 0.5);
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.6);
}

.button-ghost:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
}

.intro-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.intro-meta span {
    position: relative;
    padding-left: 1.1rem;
}

.intro-meta span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    padding: 0 1.5rem 1.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

.site-footer a {
    color: #9ca3af;
}

.site-footer a:hover {
    color: #e5e7eb;
}

/* ---------- Projects Page ---------- */

/* Projects page header */
.projects-header {
    padding-top: 2rem;
    padding-bottom: 0rem;
    margin-bottom: 0rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
    transition: color 0.25s ease;
}

.back-link:hover {
    color: #a5b4fc;
}

.projects-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem;
    color: #e5e7eb;
}

.projects-subtitle {
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.projects-subtitle p {
    margin-bottom: 1rem;
}

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

.paper-link {
    color: #a5b4fc;
    text-decoration: none;
    transition: color 0.25s ease;
    font-weight: 500;
}

.paper-link:hover {
    color: #818cf8;
}


/* Projects grid layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Individual project card */
.project-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(103, 232, 249, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.project-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: #e5e7eb;
    margin-bottom: 0.8rem;
    letter-spacing: 0.02em;
}

.project-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d1d5db;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #a5b4fc;
    font-weight: 500;
    transition: all 0.25s ease;
    align-self: flex-start;
}

.project-link:hover {
    color: #a5b4fc;
    gap: 0.6rem;
}

/* ---------- Blog Page ---------- */
.blog-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(165, 180, 252, 0.4);
    color: #e5e7eb;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    /* Let clicks pass through to nodes */
    transition: opacity 0.2s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* ---------- Contact Modal ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(165, 180, 252, 0.3);
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(165, 180, 252, 0.15);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-title {
    font-size: 1.8rem;
    color: #e5e7eb;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.modal-text {
    font-size: 1rem;
    color: #d1d5db;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.email-container {
    background: rgba(2, 6, 23, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

.email-link {
    font-size: 1.1rem;
    color: #67e8f9;
    font-weight: 500;
    transition: color 0.25s ease;
}

.email-link:hover {
    color: #22d3ee;
}

/* ---------- Responsiveness ---------- */
@media (max-width: 900px) {
    .shell {
        padding-top: 1.8rem;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        margin-bottom: 2.4rem;
    }

    .nav {
        gap: 1.3rem;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .portrait-wrap {
        order: 1;
        min-height: 350px;
    }

    .intro {
        order: 2;
    }

    .stellar-system {
        width: 300px;
        height: 300px;
    }

    .orbit-1 {
        width: 200px;
        height: 200px;
    }

    .orbit-2 {
        width: 250px;
        height: 250px;
    }

    .orbit-3 {
        width: 300px;
        height: 300px;
    }

    .planet:nth-child(1) {
        transform: translate(-50%, -50%) rotate(0deg) translateX(100px) rotate(0deg);
    }

    .planet:nth-child(2) {
        transform: translate(-50%, -50%) rotate(51deg) translateX(125px) rotate(-51deg);
    }

    .planet:nth-child(3) {
        transform: translate(-50%, -50%) rotate(102deg) translateX(150px) rotate(-102deg);
    }

    .planet:nth-child(4) {
        transform: translate(-50%, -50%) rotate(153deg) translateX(100px) rotate(-153deg);
    }

    .planet:nth-child(5) {
        transform: translate(-50%, -50%) rotate(204deg) translateX(125px) rotate(-204deg);
    }

    .planet:nth-child(6) {
        transform: translate(-50%, -50%) rotate(255deg) translateX(150px) rotate(-255deg);
    }

    .planet:nth-child(7) {
        transform: translate(-50%, -50%) rotate(306deg) translateX(100px) rotate(-306deg);
    }

    .portrait {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 600px) {
    .shell {
        padding-inline: 1.2rem;
    }

    .site-header {
        margin-bottom: 2rem;
    }

    .nav {
        flex-wrap: wrap;
    }

    .intro-name {
        font-size: 2.1rem;
    }

    .intro-body {
        font-size: 0.92rem;
    }

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