:root {
    /* Colors */
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --accent-blue: #00d2ff;
    --accent-purple: #9d50bb;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: -10000 !important;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

main,
footer {
    position: relative;
    z-index: 9999;
    background: transparent;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
}

.about-section {
    padding: 3rem 0;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-blue);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center horizontally */
    text-align: center;
    /* Center text */
    position: relative;
    overflow: hidden;
    perspective: 2000px;
    transform-style: preserve-3d;
}

.hero-content {
    position: relative;
    z-index: 100;
    transform: translateZ(200px);
    pointer-events: none;
    max-width: 900px;
    margin: 0 auto;
}

.subtitle {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent-blue);
    /* Changed to brand color */
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(var(--accent-blue-rgb), 0.5);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10, 10, 20, 0.4) 0%, rgba(10, 10, 20, 0.8) 100%);
    backdrop-filter: blur(2px);
    /* Subtle blur to separate planes */
    z-index: 50;
    pointer-events: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.hero-content h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

/* Project Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Atomic 3D Orbit Animation */
.hero {
    perspective: 2000px;
    transform-style: preserve-3d;
}

.hero-content {
    position: relative;
    z-index: 100;
    transform: translateZ(200px);
    pointer-events: none;
}

.hero-content * {
    pointer-events: auto;
}

.hero-visuals {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bubble-orbit-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    pointer-events: none;
}

.project-bubble {
    position: relative;
    width: 120px;
    height: 120px;
    margin-top: -60px;
    margin-left: -60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.6),
        inset -15px -15px 30px rgba(0, 0, 0, 0.7),
        inset 10px 10px 30px rgba(255, 255, 255, 0.4);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
}

.project-bubble::before {
    content: '';
    position: absolute;
    top: var(--reflect-y, 15%);
    left: var(--reflect-x, 15%);
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, transparent 80%);
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    transition: top 0.1s ease-out, left 0.1s ease-out;
}

.project-bubble:hover {
    box-shadow: 0 0 50px var(--accent-blue), inset 0 0 30px var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Centered Atomic Orbits with Billboard Effect */
.hero-visuals {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 10;
    /* Between background and text */
}

.bubble-orbit-container {
    position: absolute;
    transform-style: preserve-3d;
    pointer-events: none;
}

.bubble-orbit-path {
    transform-style: preserve-3d;
    /* This handles the path rotation */
    animation: rotateOrbit linear infinite;
}

@keyframes rotateOrbit {
    from {
        transform: rotate(0deg) translateX(340px);
    }

    to {
        transform: rotate(360deg) translateX(340px);
    }
}

@keyframes rotateOrbitNear {
    from {
        transform: rotate(0deg) translateX(240px);
    }

    to {
        transform: rotate(360deg) translateX(240px);
    }
}

@keyframes rotateOrbitFar {
    from {
        transform: rotate(0deg) translateX(440px);
    }

    to {
        transform: rotate(360deg) translateX(440px);
    }
}

/* Individual Orbits - Tilt angles (Nucleus centered) */
.bubble-1 {
    transform: rotateX(65deg) rotateZ(0deg);
}

.bubble-2 {
    transform: rotateX(-65deg) rotateZ(30deg);
}

.bubble-3 {
    transform: rotateY(75deg) rotateX(20deg);
}

.bubble-4 {
    transform: rotateY(-75deg) rotateX(-20deg);
}

.bubble-5 {
    transform: rotateZ(45deg) rotateX(55deg);
}

.bubble-6 {
    transform: rotateZ(-45deg) rotateX(55deg);
}

.bubble-7 {
    transform: rotateX(30deg) rotateY(45deg);
}

.bubble-8 {
    transform: rotateX(-30deg) rotateY(-45deg);
}

.bubble-9 {
    transform: rotateY(45deg) rotateZ(30deg);
}

.bubble-10 {
    transform: rotateY(-45deg) rotateZ(-30deg);
}

.bubble-11 {
    transform: rotateX(15deg) rotateZ(75deg);
}

.bubble-12 {
    transform: rotateX(-15deg) rotateZ(-75deg);
}

.bubble-13 {
    transform: rotateY(20deg) rotateX(80deg);
}

.bubble-14 {
    transform: rotateY(-20deg) rotateX(-80deg);
}

.bubble-15 {
    transform: rotateZ(10deg) rotateX(40deg);
}

.bubble-16 {
    transform: rotateZ(-10deg) rotateX(40deg);
}

.bubble-17 {
    transform: rotateX(45deg) rotateY(15deg) rotateZ(30deg);
}

.bubble-18 {
    transform: rotateX(-45deg) rotateY(-15deg) rotateZ(-30deg);
}

/* Apply durations */
.bubble-1 .bubble-orbit-path {
    animation-duration: 20s;
}

.bubble-2 .bubble-orbit-path {
    animation-duration: 25s;
    animation-direction: reverse;
}

.bubble-3 .bubble-orbit-path {
    animation-duration: 18s;
    animation: rotateOrbitNear linear infinite 18s;
}

.bubble-4 .bubble-orbit-path {
    animation-duration: 22s;
    animation: rotateOrbitNear linear infinite 22s reverse;
}

.bubble-5 .bubble-orbit-path {
    animation-duration: 28s;
    animation: rotateOrbitFar linear infinite 28s;
}

.bubble-6 .bubble-orbit-path {
    animation-duration: 32s;
    animation: rotateOrbitFar linear infinite 32s;
}

.bubble-7 .bubble-orbit-path {
    animation-duration: 24s;
}

.bubble-8 .bubble-orbit-path {
    animation-duration: 26s;
    animation-direction: reverse;
}

.bubble-9 .bubble-orbit-path {
    animation-duration: 15s;
    animation: rotateOrbitNear linear infinite 15s;
}

.bubble-10 .bubble-orbit-path {
    animation-duration: 19s;
    animation: rotateOrbitNear linear infinite 19s reverse;
}

.bubble-11 .bubble-orbit-path {
    animation-duration: 35s;
    animation: rotateOrbitFar linear infinite 35s;
}

.bubble-12 .bubble-orbit-path {
    animation-duration: 38s;
    animation: rotateOrbitFar linear infinite 38s reverse;
}

.bubble-13 .bubble-orbit-path {
    animation-duration: 21s;
}

.bubble-14 .bubble-orbit-path {
    animation-duration: 23s;
    animation-direction: reverse;
}

.bubble-15 .bubble-orbit-path {
    animation-duration: 30s;
    animation: rotateOrbitFar linear infinite 30s;
}

.bubble-16 .bubble-orbit-path {
    animation-duration: 33s;
    animation: rotateOrbitFar linear infinite 33s reverse;
}

.bubble-17 .bubble-orbit-path {
    animation-duration: 27s;
    animation: rotateOrbit linear infinite 27s;
}

.bubble-18 .bubble-orbit-path {
    animation-duration: 29s;
    animation: rotateOrbit linear infinite 29s reverse;
}

.project-bubble {
    position: relative;
    width: 140px;
    height: 140px;
    margin: -70px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.6),
        inset -15px -15px 35px rgba(0, 0, 0, 0.7),
        inset 10px 10px 35px rgba(255, 255, 255, 0.4);
    pointer-events: none;
    /* Disabled interaction */
    cursor: default;
    overflow: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    display: block;

    /* BILLBOARD EFFECT: Counteract orbit rotation */
    animation: billboard linear infinite;
    animation-duration: inherit;
    animation-direction: inherit;
}

@keyframes billboard {

    /* We rotate opposite to orbit and ADD the interactive tilt from JS variables */
    from {
        transform: rotate(0deg) rotateX(calc(var(--revX, 0deg) + var(--tilt-x, 0deg))) rotateY(calc(var(--revY, 0deg) + var(--tilt-y, 0deg)));
    }

    to {
        transform: rotate(-360deg) rotateX(calc(var(--revX, 0deg) + var(--tilt-x, 0deg))) rotateY(calc(var(--revY, 0deg) + var(--tilt-y, 0deg)));
    }
}

/* Set reverse tilts for each bubble to keep them perfectly upright */
.bubble-1 .project-bubble {
    --revX: -65deg;
    animation-duration: 20s;
}

.bubble-2 .project-bubble {
    --revX: 65deg;
    animation-duration: 25s;
    animation-direction: reverse;
}

.bubble-3 .project-bubble {
    --revY: -75deg;
    --revX: -20deg;
    animation-duration: 18s;
}

.bubble-4 .project-bubble {
    --revY: 75deg;
    --revX: 20deg;
    animation-duration: 22s;
    animation-direction: reverse;
}

.bubble-5 .project-bubble {
    --revX: -55deg;
    animation-duration: 28s;
}

.bubble-6 .project-bubble {
    --revX: -55deg;
    animation-duration: 32s;
}

.bubble-7 .project-bubble {
    --revX: -30deg;
    --revY: -45deg;
    animation-duration: 24s;
}

.bubble-8 .project-bubble {
    --revX: 30deg;
    --revY: 45deg;
    animation-duration: 26s;
    animation-direction: reverse;
}

.bubble-9 .project-bubble {
    --revY: -45deg;
    animation-duration: 15s;
}

.bubble-10 .project-bubble {
    --revY: 45deg;
    animation-duration: 19s;
    animation-direction: reverse;
}

.bubble-11 .project-bubble {
    --revX: -15deg;
    animation-duration: 35s;
}

.bubble-12 .project-bubble {
    --revX: 15deg;
    animation-duration: 38s;
    animation-direction: reverse;
}

.bubble-13 .project-bubble {
    --revY: -20deg;
    --revX: -80deg;
    animation-duration: 21s;
}

.bubble-14 .project-bubble {
    --revY: 20deg;
    --revX: 80deg;
    animation-duration: 23s;
    animation-direction: reverse;
}

.bubble-15 .project-bubble {
    --revX: -40deg;
    animation-duration: 30s;
}

.bubble-16 .project-bubble {
    --revX: -40deg;
    animation-duration: 33s;
    animation-direction: reverse;
}

.bubble-17 .project-bubble {
    --revX: -45deg;
    --revY: -15deg;
    animation-duration: 27s;
}

.bubble-18 .project-bubble {
    --revX: 45deg;
    --revY: 15deg;
    animation-duration: 29s;
    animation-direction: reverse;
}

.project-bubble:hover {
    box-shadow: 0 0 60px var(--accent-blue), inset 0 0 40px var(--accent-blue);
    border-color: var(--accent-blue);
}

@media (max-width: 1200px) {
    .hero-visuals {
        display: none;
    }
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: var(--transition);
}

.card:hover .card-img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: var(--glass);
    border-radius: 4px;
    color: var(--accent-blue);
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Skills */
.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.skill-item {
    padding: 1rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.skill-item:hover {
    border-color: var(--accent-purple);
    background: rgba(157, 80, 187, 0.05);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.96);
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1), transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s ease;
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content .subtitle {
        font-size: 1.2rem;
    }

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

    section {
        padding: 5rem 0;
    }

    .project-hero {
        height: 50vh;
    }

    .project-hero h1 {
        font-size: 3rem !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Project Detail Pages */
.project-hero {
    height: 60vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 5rem;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 2;
}

.project-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
}

.project-hero .container {
    position: relative;
    z-index: 10;
}

.project-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-top: -3rem;
}

.project-sidebar {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h4 {
    color: var(--accent-blue);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.content-section {
    padding: 0;
    margin-bottom: 3rem;
    position: relative;
    z-index: 5;
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.content-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 6;
}

@media (max-width: 992px) {
    .project-layout {
        grid-template-columns: 1fr;
    }

    .project-sidebar {
        position: static;
        order: -1;
    }
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--glass-border);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.image-grid img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.image-grid img:hover {
    transform: scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* Sakura Animation */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -9999 !important;
    overflow: hidden;
}

.sakura {
    position: absolute;
    background-color: #ffb7c5;
    border-radius: 100% 0 100% 0;
    opacity: 0.7;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10%) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 20001;
}