/* ================================================================
   COSMIC EXPLORER — Global Design System
   Portfolio: Rohan Yadav
   Palette: Mars Orange / Ice Blue / Star Yellow on Deep Void
   ================================================================ */

/* ============ VARIABLES ============ */
:root {
    /* Channel tokens (for rgba composition) */
    --void-rgb: 10, 10, 20;
    --mars-rgb: 232, 83, 30;
    --ice-rgb: 91, 206, 250;
    --star-rgb: 255, 209, 102;
    --text-rgb: 229, 229, 240;

    --void: #0A0A14;
    --void-light: #111120;
    --void-card: #13131F;
    --mars: #E8531E;
    --mars-dim: rgba(var(--mars-rgb), 0.12);
    --mars-glow: rgba(var(--mars-rgb), 0.25);
    --ice: #5BCEFA;
    --ice-dim: rgba(var(--ice-rgb), 0.1);
    --star: #FFD166;
    --star-dim: rgba(var(--star-rgb), 0.1);
    --text: #E5E5F0;
    --text-dim: rgba(var(--text-rgb), 0.4);
    --text-mid: rgba(var(--text-rgb), 0.6);
    --line: rgba(var(--text-rgb), 0.06);
    --line-mid: rgba(var(--text-rgb), 0.1);

    --green: #4ade80;

    --font-body: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--void);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

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

/* ============ STARFIELD ============ */
.starfield {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.starfield .star {
    position: absolute;
    background: rgba(var(--text-rgb),0.6);
    border-radius: 50%;
    animation: twinkle ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.1; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* ============ SCROLL REVEAL ANIMATIONS ============ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger children */
.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.48s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.56s; }
.stagger.visible > *:nth-child(9) { transition-delay: 0.64s; }
.stagger.visible > *:nth-child(10) { transition-delay: 0.72s; }

.stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ NAV ============ */
.main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 14px 5%;
    background: transparent;
    transition: background 0.4s, backdrop-filter 0.4s, -webkit-backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}

.main-header.scrolled {
    background: rgba(var(--void-rgb),0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--line);
}

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

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-right: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.3s, background 0.3s;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(var(--text-rgb),0.04);
}

.social-icons a {
    color: var(--text-dim);
    margin-left: 14px;
    font-size: 1rem;
    transition: color 0.3s;
    text-decoration: none;
}

.social-icons a:hover { color: var(--star); }

.social-icons a img {
    display: inline;
    vertical-align: middle;
    filter: brightness(0.6);
    transition: filter 0.3s;
}

.social-icons a:hover img { filter: brightness(1); }

.menu-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    display: none;
    padding: 0;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        background: rgba(var(--void-rgb),0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 0 0 12px 12px;
        top: 100%;
        left: 0;
        width: 100%;
        box-shadow: 0 8px 30px rgba(0,0,0,0.4);
        border: 1px solid var(--line);
        border-top: none;
    }

    .nav-links a {
        display: block;
        padding: 12px 20px;
        margin: 0;
        border-radius: 0;
    }

    .menu-toggle { display: block; }
    .main-nav.active { display: block; }
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.35s var(--ease-out);
    cursor: pointer;
    border-radius: 6px;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--mars);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 4px 30px var(--mars-glow);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--line-mid);
}

.btn-ghost:hover {
    border-color: rgba(var(--text-rgb),0.25);
    color: var(--text);
    transform: translateY(-2px);
}

/* ============ SECTION HEADERS ============ */
.section-header {
    text-align: center;
    padding: 100px 20px 50px;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--mars);
}

.section-header .line {
    width: 40px;
    height: 2px;
    background: var(--mars);
    margin: 12px auto 0;
}

/* ============ TAGS / BADGES ============ */
.tag {
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-block;
}

.tag-area { color: var(--star); border: 1px solid rgba(var(--star-rgb),0.2); background: var(--star-dim); }
.tag-cat { color: var(--ice); border: 1px solid rgba(var(--ice-rgb),0.2); background: var(--ice-dim); }
.tag-tech { color: var(--text-mid); border: 1px solid var(--line-mid); }

/* ============ HERO (Home Page) ============ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    position: relative;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 8%; right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--mars), var(--ice), var(--star), transparent);
    opacity: 0.25;
}

.hero-content { max-width: 700px; }

.hero-eyebrow {
    font-size: 0.7rem;
    color: var(--mars);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 15px;
    opacity: 0;
    animation: fadeUp 0.8s 0.3s forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 25px;
    opacity: 0;
    animation: fadeUp 0.8s 0.5s forwards;
}

.hero-title .dim { color: var(--text-dim); font-weight: 300; }

.hero-bio {
    max-width: 520px;
    color: var(--text-mid);
    line-height: 1.8;
    font-weight: 300;
    font-size: 1rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.7s forwards;
}

.hero-socials {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    opacity: 0;
    animation: fadeUp 0.8s 0.9s forwards;
}

.hero-socials a {
    color: var(--text-dim);
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.hero-socials a:hover { color: var(--text); transform: translateY(-3px); }

.hero-socials a::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 50%;
    transform: translateX(-50%);
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--mars);
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-socials a:hover::after { opacity: 1; }

.hero-btns {
    display: flex;
    gap: 15px;
    opacity: 0;
    animation: fadeUp 0.8s 1.1s forwards;
}

/* ============ FILTER BUTTONS ============ */
.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 0 0 40px;
}

.filter-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-row::after { display: none; }

.filter-btn {
    background: transparent;
    border: 1px solid var(--line-mid);
    color: var(--text-dim);
    padding: 8px 22px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--mars);
    border-color: var(--mars);
    color: #fff;
}

/* ============ PROJECT CARDS ============ */
.projects-section {
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.project-card {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    cursor: pointer;
    background: var(--void-card);
    position: relative;
}

.project-card:hover {
    border-color: rgba(var(--mars-rgb),0.25);
    box-shadow: 0 8px 50px rgba(0,0,0,0.4), 0 0 40px rgba(var(--mars-rgb),0.06);
    transform: translateY(-4px);
}

.project-card img {
    width: 340px;
    min-height: 220px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    transition: transform 0.6s var(--ease-out);
}

.project-card:hover img {
    transform: scale(1.03);
}

.project-info {
    flex: 1;
    padding: 25px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.project-info h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    transition: color 0.3s;
}

.project-card:hover .project-info h3 { color: var(--mars); }

.project-info p {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.6;
    font-weight: 300;
}

.project-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
    align-items: center;
}

.study-area-meta {
    display: flex;
    gap: 8px;
    width: 100%;
}

.project-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.category,
.study-area {
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    background: transparent;
    box-shadow: none;
}

.category {
    color: var(--ice);
    border: 1px solid rgba(var(--ice-rgb),0.2);
    background: var(--ice-dim);
    margin-right: auto;
}

.study-area {
    color: var(--star);
    border: 1px solid rgba(var(--star-rgb),0.2);
    background: var(--star-dim);
}

.tech-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.tech-icons i {
    font-size: 1.3rem;
    color: var(--text-dim);
    transition: color 0.3s, transform 0.3s;
    cursor: pointer;
}

.tech-icons i:hover {
    color: var(--mars);
    transform: translateY(-2px);
}

.github-link {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px; height: 36px;
    background: rgba(var(--void-rgb),0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--text-rgb),0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
    padding: 0;
    text-decoration: none;
}

.github-link i {
    font-size: 1.1rem;
    color: rgba(var(--text-rgb),0.5);
}

.github-link:hover {
    background: var(--mars);
    border-color: var(--mars);
}

.github-link:hover i { color: #fff; }

/* Project card sizing overrides — make all equal in new layout */
.project-card:nth-child(n) { flex-basis: auto; }

@media (max-width: 900px) {
    .project-card {
        flex-direction: column;
    }

    .project-card img {
        width: 100%;
        min-height: 200px;
    }
}

/* ============ PROJECT MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-overlay.hidden { display: none; }

#projectModal {
    position: fixed;
    top: 0; left: 0;
    max-width: 60vw;
    height: 100vh;
    background: var(--void-light);
    padding: 10px;
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
    overflow-y: auto;
    transition: left 0.3s var(--ease-out);
    z-index: 1002;
}

#projectModal.active { left: 0; }

.modal-content {
    background: var(--void-light);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    display: flex;
    justify-content: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--mars);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
    font-family: var(--font-body);
}

.close-modal-btn:hover { color: var(--text); }

.close-modal-btn:hover i {
    transform: translateX(-5px);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--mars);
    text-align: center;
}

.modal-project-meta {
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-duration {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--mars-dim);
    border: 1px solid rgba(var(--mars-rgb),0.2);
    border-radius: 20px;
    display: inline-block;
    padding: 4px 14px;
    cursor: default;
}

.modal-extra-text {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.65;
    padding: 0 20px;
}

.modal-extra-text strong, .modal-extra-text b {
    color: var(--text);
    font-weight: 500;
}

.modal-section-header {
    font-family: var(--font-display);
    color: var(--mars);
    padding: 8px 20px;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    margin: auto;
}

.modal-section-header.hidden { display: none; }

.modal-info {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Tech tags in modal */
.tech-tags {
    margin: 15px 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.tech-tag {
    background: linear-gradient(135deg, var(--mars-dim), var(--ice-dim));
    border: 1px solid rgba(var(--mars-rgb),0.2);
    color: var(--text);
    font-size: 0.8rem;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 500;
}

/* Modal carousel */
.modal-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin: 15px 0;
}

.carousel {
    display: flex;
    transition: transform 0.4s ease-in-out;
    will-change: transform;
}

.carousel-inner {
    display: flex;
    width: 100%;
    transition: transform 0.4s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    height: auto;
    transition: opacity 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-item.active { opacity: 1; }

.carousel-item img {
    max-width: 100%;
    max-height: 40vh;
    object-fit: contain;
    border-radius: 8px 8px 0 0;
    width: auto;
}

.carousel-caption {
    background: rgba(var(--void-rgb),0.8);
    color: var(--text-mid);
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(var(--void-rgb),0.6);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
}

.carousel-control.prev { left: 10px; }
.carousel-control.next { right: 10px; }
.carousel-control:hover { background: var(--mars); }

/* Modal video */
.modal-video-container {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

.modal-video {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    outline: none;
}

/* Modal footer */
.footer-bar {
    display: flex;
    flex-flow: column;
    gap: 10px;
    justify-content: space-evenly;
    border-top: 1px solid var(--line);
    padding: 15px 20px;
}

.footer-bar a {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.3s;
    flex-grow: 1;
    text-align: center;
}

.project-link {
    background: var(--mars);
    box-shadow: 0 4px 15px var(--mars-glow);
}

.download-link {
    background: var(--void-card);
    border: 1px solid var(--line-mid);
    color: var(--text-mid) !important;
}

.project-link:hover,
.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    #projectModal { max-width: 100vw; }
    .filter-btn { padding: 6px 16px; font-size: 0.75rem; }
}

/* ============ RESUME TIMELINE (rv2 style) ============ */
.rv2-container {
    max-width: 1100px;
    margin: auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 1;
}

.rv2-section { margin-bottom: 80px; }

.rv2-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--mars);
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}

.rv2-section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--mars);
    margin: 10px auto 0;
}

.rv2-timeline { position: relative; }

.rv2-timeline-line {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(var(--mars-rgb),0.1) 3%,
        rgba(var(--mars-rgb),0.35) 10%,
        rgba(var(--mars-rgb),0.35) 90%,
        rgba(var(--mars-rgb),0.1) 97%,
        transparent 100%);
    z-index: 0;
}

.rv2-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    position: relative;
    margin-bottom: 90px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.rv2-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.rv2-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rv2-meta-left { text-align: right; padding-right: 40px; }
.rv2-meta-right { text-align: left; padding-left: 40px; order: 2; }

.rv2-logo {
    width: auto;
    max-width: 140px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 6px;
    opacity: 0.3;
    filter: grayscale(50%) brightness(1.8);
    transition: opacity 0.4s, filter 0.4s;
}

.rv2-meta-left .rv2-logo { margin-left: auto; }
.rv2-block:hover .rv2-logo { opacity: 0.65; filter: grayscale(15%) brightness(1.5); }

.rv2-ghost {
    display: block;
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 800;
    color: rgba(var(--mars-rgb),0.05);
    line-height: 1;
    margin-bottom: 4px;
    transition: color 0.4s;
    user-select: none;
}

.rv2-block:hover .rv2-ghost { color: rgba(var(--mars-rgb),0.14); }

.rv2-company {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mars);
    margin-bottom: 8px;
}

.rv2-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
    line-height: 1.2;
}

.rv2-date-loc {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.rv2-meta-left .rv2-date-loc { justify-content: flex-end; }
.rv2-meta-right .rv2-date-loc { justify-content: flex-start; }

.rv2-dot-sep {
    width: 4px; height: 4px;
    background: var(--text-dim);
    border-radius: 50%;
    flex-shrink: 0;
}

.rv2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rv2-meta-left .rv2-tags { justify-content: flex-end; }
.rv2-meta-right .rv2-tags { justify-content: flex-start; }

.rv2-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 9999px;
    background: var(--mars-dim);
    border: 1px solid rgba(var(--mars-rgb),0.2);
    color: var(--mars);
}

/* Center marker */
.rv2-marker {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.rv2-marker-outer {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(var(--mars-rgb),0.2);
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-smooth);
    position: sticky;
    top: 50vh;
}

.rv2-block:hover .rv2-marker-outer {
    transform: scale(1.3);
    background: var(--mars-dim);
    border-color: rgba(var(--mars-rgb),0.4);
}

.rv2-marker-inner {
    width: 8px; height: 8px;
    background: var(--mars);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(var(--mars-rgb),0.5);
}

/* Content card */
.rv2-content { display: flex; align-items: center; }
.rv2-content-right { padding-left: 40px; }
.rv2-content-left { padding-right: 40px; order: 1; }

.rv2-card {
    background: var(--void-card);
    border-radius: 12px;
    padding: 28px 30px;
    border: 1px solid var(--line);
    transition: all 0.4s var(--ease-out);
    width: 100%;
}

.rv2-block:hover .rv2-card {
    transform: translateY(-4px);
    border-color: rgba(var(--mars-rgb),0.15);
    box-shadow: 0 16px 50px rgba(0,0,0,0.3);
}

.rv2-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rv2-bullets li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rv2-slash {
    color: var(--mars);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.55;
    flex-shrink: 0;
}

.rv2-bullets p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.65;
    font-weight: 300;
}

.rv2-bullets p strong {
    color: var(--text);
    font-weight: 500;
}

.rv2-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    text-decoration: none;
    color: var(--text-dim);
    border: 1px solid var(--line-mid);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
}

.rv2-card-link:hover {
    background: var(--mars-dim);
    border-color: var(--mars);
    color: var(--mars);
}

.rv2-edu-text {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.65;
    margin: 0;
    font-weight: 300;
}

@media (max-width: 768px) {
    .rv2-timeline-line { left: 20px; transform: none; }

    .rv2-block {
        display: flex;
        flex-direction: column;
        padding-left: 55px;
        margin-bottom: 60px;
    }

    .rv2-meta-left, .rv2-meta-right {
        text-align: left;
        padding: 0;
        order: 1;
    }

    .rv2-meta-left .rv2-date-loc,
    .rv2-meta-right .rv2-date-loc,
    .rv2-meta-left .rv2-tags,
    .rv2-meta-right .rv2-tags {
        justify-content: flex-start;
    }

    .rv2-meta-left .rv2-logo { margin-left: 0; }
    .rv2-ghost { font-size: 2.5rem; }
    .rv2-title { font-size: 1.2rem; }

    .rv2-marker {
        left: 20px;
        top: 15px;
        height: auto;
        position: absolute;
    }

    .rv2-marker-outer { width: 28px; height: 28px; position: static; }

    .rv2-content-right, .rv2-content-left {
        padding: 0;
        order: 2;
    }
}

/* ============ SKILLS SECTION ============ */
.skills-section {
    max-width: 900px;
    margin: auto;
    padding: 0 20px 100px;
    position: relative;
    z-index: 1;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.skill-category {
    background: var(--void-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    transition: all 0.35s;
}

.skill-category:hover { border-color: rgba(var(--mars-rgb),0.15); }

.skill-category h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ice);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-item {
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--text-mid);
    background: transparent;
    font-weight: 300;
    transition: all 0.3s;
    cursor: default;
    box-shadow: none;
}

.skill-item:hover {
    border-color: rgba(var(--mars-rgb),0.3);
    color: var(--mars);
    background: var(--mars-dim);
    transform: translateY(-2px);
}

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

/* ============ PROGRESS BAR ============ */
.progress-bar {
    position: relative;
    height: 4px;
    width: 100%;
    background: var(--line);
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--ice);
    border-radius: 10px;
    transition: width 0.8s var(--ease-out);
}

/* ============ FOOTER ============ */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--line);
    position: relative;
    z-index: 1;
}

.site-footer p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 300;
}

/* ============ UTILITY ============ */
.z-content { position: relative; z-index: 1; }

/* ================================================================
   PROJECTS — Gravity Domain Explorer
   ================================================================ */

/* Page-level overrides (only when .pg-gravity is on body) */
body.pg-gravity {
    overflow: hidden;
    height: 100vh;
    cursor: none;
    -webkit-font-smoothing: antialiased;
}

/* Custom cursor */
#cursor {
    position: fixed;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(var(--text-rgb),0.9);
    box-shadow: 0 0 20px rgba(var(--text-rgb),0.3), 0 0 60px rgba(var(--text-rgb),0.1);
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background 0.3s;
}
#cursor.hovering {
    width: 12px; height: 12px;
    background: rgba(var(--text-rgb),0.6);
}
#cursorField {
    position: fixed;
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 1px solid rgba(var(--text-rgb),0.04);
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out), border-color 0.3s;
}

/* Main simulation canvas */
#gravityCanvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    transform-origin: 50% 50%;
    will-change: transform, opacity;
}
#gravityCanvas.warping {
    transition: transform 1.4s var(--ease-out), opacity 0.8s 0.4s ease-out;
    transform: scale(6);
    opacity: 0;
}
#gravityCanvas.unwarping {
    transition: transform 1s var(--ease-out), opacity 0.4s ease-out;
    transform: scale(1);
    opacity: 1;
}

/* Invisible hit areas for hover/click — visuals are on canvas */
.domain-label {
    position: fixed;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: auto;
    cursor: none;
}

/* Center title */
.center-title {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}
.ct-main {
    font-family: var(--font-display);
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    font-weight: 300;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: rgba(var(--text-rgb),0.06);
}
.ct-sub {
    font-family: var(--font-mono);
    font-size: 0.4rem;
    letter-spacing: 4px;
    color: rgba(var(--text-rgb),0.035);
    margin-top: 4px;
}

/* Bottom hint — holographic style */
.bottom-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.45rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
    background: linear-gradient(
        90deg,
        rgba(255,100,100,0.25),
        rgba(255,200,100,0.25),
        rgba(100,255,200,0.25),
        rgba(100,180,255,0.25),
        rgba(200,100,255,0.25)
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holoText 6s linear infinite;
}
@keyframes holoText {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ============================================================
   DOMAIN UNIVERSE VIEW (when a domain is clicked)
   ============================================================ */
#universeView {
    position: fixed; inset: 0;
    z-index: 20;
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
    pointer-events: none;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: auto;
}
#universeView.active {
    opacity: 1; transform: scale(1);
    pointer-events: auto;
}

.uv-bg {
    position: absolute; inset: 0; z-index: 0;
}

.uv-back {
    position: absolute; top: 24px; left: 24px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    cursor: pointer; z-index: 10;
    border: 1px solid rgba(var(--text-rgb),0.08);
    padding: 8px 18px;
    border-radius: 4px;
    background: rgba(var(--void-rgb),0.5);
    transition: all 0.3s;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}
.uv-back:hover {
    color: var(--text);
    border-color: rgba(var(--text-rgb),0.25);
}

.uv-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    z-index: 2;
    margin-bottom: 6px;
}
.uv-count {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--text-dim);
    letter-spacing: 2.5px;
    z-index: 2;
    margin-bottom: 60px;
}

.uv-constellation {
    position: relative; z-index: 2;
    width: 88vw; max-width: 1100px;
    height: 60vh; max-height: 580px;
}
.uv-const-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* Constellation lines */
.uv-const-svg .c-line {
    stroke-width: 1.2;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    opacity: 0.15;
    transition: opacity 0.4s;
    filter: none;
}
.uv-const-svg .c-line.glow {
    opacity: 0.5;
    stroke-width: 1.8;
    filter: drop-shadow(0 0 4px var(--lc));
}
#universeView.active .c-line {
    animation: uvDrawLine 2s ease-out forwards;
}
@keyframes uvDrawLine { to { stroke-dashoffset: 0; } }

/* Branch lines */
.uv-const-svg .b-line {
    stroke-width: 0.6;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    opacity: 0.08;
    transition: opacity 0.4s;
}
.uv-const-svg .b-line.glow {
    opacity: 0.3;
    stroke-width: 1;
}
#universeView.active .b-line {
    animation: uvDrawLine 1.2s 0.6s ease-out forwards;
}

/* Flow dots */
.uv-const-svg .flow-dot { opacity: 0; }
#universeView.active .flow-dot {
    animation: uvFlow 4s ease-in-out infinite;
}
@keyframes uvFlow {
    0% { opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; }
}

/* Star nodes */
.uv-star {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out);
    z-index: 5;
    opacity: 0;
}
#universeView.active .uv-star {
    animation: uvStarIn 0.7s var(--ease-out) forwards;
}
@keyframes uvStarIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(0.5); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.uv-star:hover { transform: translate(-50%, -50%) scale(1.12) !important; }

/* Star core with orbit ring */
.uv-star-core {
    width: var(--ssz); height: var(--ssz);
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--sc) 30%, transparent 70%);
    box-shadow: 0 0 calc(var(--ssz) * 1.5) var(--sc),
                0 0 calc(var(--ssz) * 3) var(--sc);
    animation: uvPulse 4s ease-in-out infinite alternate;
    position: relative;
}
.uv-star-core::after {
    content: '';
    position: absolute;
    inset: calc(var(--ssz) * -0.6);
    border-radius: 50%;
    border: 1px solid var(--sc);
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s var(--ease-out);
    animation: uvOrbitSpin 12s linear infinite;
    border-top-color: transparent;
    border-left-color: transparent;
}
.uv-star:hover .uv-star-core::after {
    opacity: 0.3;
}
@keyframes uvPulse {
    0% { opacity: 0.8; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1.04); }
}
@keyframes uvOrbitSpin { to { transform: rotate(360deg); } }

/* Star label */
.uv-star-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 18px;
    white-space: nowrap;
    text-transform: uppercase;
    color: rgba(var(--text-rgb),0.55);
    padding: 5px 14px;
    border-radius: 4px;
    background: rgba(var(--void-rgb),0.6);
    border: 1px solid rgba(var(--text-rgb),0.04);
    backdrop-filter: blur(8px);
    transition: all 0.35s var(--ease-out);
}
.uv-star:hover .uv-star-label {
    color: var(--text);
    border-color: color-mix(in srgb, var(--sc) 40%, transparent);
    background: rgba(var(--void-rgb),0.8);
    box-shadow: 0 0 20px color-mix(in srgb, var(--sc) 10%, transparent);
}

/* Category tag */
.uv-star-cat {
    font-family: var(--font-mono);
    font-size: 0.4rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: uppercase;
    opacity: 0.6;
}

/* Tech tags — hidden by default, appear on hover */
.uv-star-tech {
    display: flex; gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s 0.05s, transform 0.3s var(--ease-out);
}
.uv-star:hover .uv-star-tech {
    opacity: 1;
    transform: translateY(0);
}
.uv-star-tech span {
    font-family: var(--font-mono);
    font-size: 0.38rem;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--sc) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--sc) 15%, transparent);
    color: color-mix(in srgb, var(--sc) 70%, #fff);
    white-space: nowrap;
}

/* Secondary stars */
.uv-star.secondary .uv-star-core {
    opacity: 0.45;
    background: radial-gradient(circle, var(--sc) 0%, transparent 70%);
    box-shadow: 0 0 calc(var(--ssz) * 1.5) var(--sc);
}
.uv-star.secondary .uv-star-core::after { display: none; }
.uv-star.secondary .uv-star-label {
    font-size: 0.52rem;
    font-weight: 500;
    color: rgba(var(--text-rgb),0.3);
    padding: 3px 8px;
    letter-spacing: 1px;
    margin-top: 12px;
}

/* Bottom hint */
.uv-hint {
    position: absolute; bottom: 24px;
    left: 50%; transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.45rem;
    letter-spacing: 2.5px;
    color: rgba(var(--text-rgb),0.1);
    text-transform: uppercase;
    z-index: 5;
}

/* Ambient constellation particles */
.uv-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: uvParticleFloat linear infinite;
}
@keyframes uvParticleFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: var(--pa); }
    90% { opacity: var(--pa); }
    100% { transform: translateY(calc(var(--pdy))) translateX(calc(var(--pdx))); opacity: 0; }
}

/* ---- Holographic hover card ---- */
#hoverCard {
    position: fixed;
    width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.25s, transform 0.35s var(--ease-out);
    z-index: 9999;
    background: linear-gradient(165deg, rgba(var(--void-rgb),0.92) 0%, rgba(var(--void-rgb),0.95) 100%);
    border: 1px solid rgba(var(--text-rgb),0.08);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(var(--ice-rgb),0.05),
        0 20px 60px rgba(0,0,0,0.8),
        0 0 40px rgba(var(--ice-rgb),0.04),
        inset 0 1px 0 rgba(var(--text-rgb),0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
#hoverCard.visible {
    opacity: 1;
    transform: scale(1);
}
#hoverCard.small { width: 260px; }
#hoverCard.small .hc-name { font-size: 0.9rem; }

/* Holographic top-edge shimmer */
#hoverCard::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--hc-color, rgba(var(--ice-rgb),0.4)), transparent);
    background-size: 200% 100%;
    animation: hcEdge 3s linear infinite;
    z-index: 5;
}
@keyframes hcEdge { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Holographic rainbow sweep */
#hoverCard::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%, transparent 35%,
        rgba(var(--ice-rgb),0.04) 40%,
        rgba(180,160,255,0.03) 45%,
        rgba(var(--mars-rgb),0.03) 50%,
        transparent 55%, transparent 100%
    );
    background-size: 300% 100%;
    animation: hcShimmer 4s ease-in-out infinite;
    pointer-events: none; z-index: 4;
    border-radius: 10px;
}
@keyframes hcShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.hc-img-wrap {
    position: relative;
    width: 100%; aspect-ratio: 16/9;
    overflow: hidden;
}
.hc-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.hc-scanlines {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
    pointer-events: none; z-index: 2;
}
.hc-shine {
    position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(var(--ice-rgb),0.08) 45%, rgba(var(--star-rgb),0.06) 55%, transparent 70%);
    background-size: 250% 100%;
    animation: hcShimmer 5s ease-in-out infinite;
    pointer-events: none; z-index: 3;
    mix-blend-mode: screen;
}
.hc-corner {
    position: absolute; width: 14px; height: 14px;
    border-color: var(--hc-color, rgba(var(--ice-rgb),0.35));
    border-style: solid; border-width: 0; z-index: 4;
}
.hc-tl { top: 6px; left: 6px; border-top-width: 1px; border-left-width: 1px; }
.hc-tr { top: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; }
.hc-bl { bottom: 6px; left: 6px; border-bottom-width: 1px; border-left-width: 1px; }
.hc-br { bottom: 6px; right: 6px; border-bottom-width: 1px; border-right-width: 1px; }

.hc-body {
    padding: 14px 16px 16px;
    position: relative; z-index: 2;
}
.hc-cat {
    font-size: 0.52rem; font-weight: 600; letter-spacing: 2.5px;
    text-transform: uppercase; color: var(--hc-color, var(--ice));
    margin-bottom: 5px; font-family: var(--font-mono);
    display: flex; align-items: center; gap: 6px;
}
.hc-cat::before {
    content: ''; display: inline-block;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--hc-color, var(--ice));
    box-shadow: 0 0 6px var(--hc-color, var(--ice));
    animation: hcPulse 2s ease-in-out infinite alternate;
}
@keyframes hcPulse { 0% { opacity: 0.6; } 100% { opacity: 1; } }
.hc-name {
    font-family: var(--font-display); font-size: 1.1rem;
    font-weight: 700; margin-bottom: 6px;
    color: var(--text);
    text-shadow: 0 0 20px rgba(var(--text-rgb),0.08);
}
.hc-desc {
    font-size: 0.72rem; color: var(--text-mid);
    line-height: 1.55; font-weight: 300;
}
.hc-tags {
    display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px;
}
.hc-tag {
    font-size: 0.5rem; padding: 3px 8px; border-radius: 3px;
    font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; font-family: var(--font-mono);
}
.hc-tag-t {
    color: var(--star); border: 1px solid rgba(var(--star-rgb),0.15);
    background: rgba(var(--star-rgb),0.06);
}
.hc-cta {
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid rgba(var(--text-rgb),0.06);
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--hc-color, var(--mars));
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex; align-items: center; gap: 6px;
}
.hc-cta-icon {
    font-size: 0.45rem;
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--hc-color, var(--mars)) 30%, transparent);
    background: color-mix(in srgb, var(--hc-color, var(--mars)) 8%, transparent);
}
.hc-cta .arrow { display: inline-block; animation: hcBounce 1.2s ease-in-out infinite; }
@keyframes hcBounce { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* Warp transition */
.warp-flash {
    position: fixed; inset: 0;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at var(--wx) var(--wy), var(--wc, rgba(255,255,255,0.3)) 0%, transparent 60%);
}
.warp-flash.fire {
    animation: warpPulse 1.4s ease-out forwards;
}
@keyframes warpPulse {
    0% { opacity: 0; }
    20% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* Dark overlay that builds during warp */
.warp-dark {
    position: fixed; inset: 0;
    z-index: 14;
    pointer-events: none;
    background: var(--void);
    opacity: 0;
    transition: opacity 0.8s 0.3s ease-out;
}
.warp-dark.active {
    opacity: 1;
}

/* ====================================================================
   COMMAND DECK (project detail modal)
   ==================================================================== */
#deck {
    position: fixed; inset: 0; z-index: 200;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    visibility: hidden;
    background: var(--void);
    overflow-y: auto;
    overflow-x: hidden;
}
#deck::-webkit-scrollbar { width: 4px; }
#deck::-webkit-scrollbar-track { background: transparent; }
#deck::-webkit-scrollbar-thumb { background: rgba(var(--mars-rgb),0.3); border-radius: 2px; }

/* Top bar — fixed */
.dk-top {
    position: sticky; top: 0; z-index: 10;
    background: rgba(var(--void-rgb),0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(var(--mars-rgb),0.08);
    display: flex; align-items: center;
    padding: 0 clamp(16px, 4vw, 48px);
    height: 48px; gap: 16px;
}
.dk-back {
    background: none; border: 1px solid rgba(var(--mars-rgb),0.15);
    color: var(--mars); font-family: var(--font-mono);
    font-size: 0.6rem; padding: 5px 14px;
    border-radius: 4px; cursor: pointer;
    letter-spacing: 1px; text-transform: uppercase;
    transition: all 0.3s;
    display: flex; align-items: center; gap: 6px;
}
.dk-back:hover { background: rgba(var(--mars-rgb),0.12); border-color: var(--mars); }
.dk-back:hover i { transform: translateX(-3px); }
.dk-back i { transition: transform 0.3s; }
.dk-top-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 12px;
}
.dk-minimap { display: flex; gap: 5px; align-items: center; }
.dk-mm-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(var(--text-rgb),0.1);
    transition: all 0.3s; cursor: pointer;
}
.dk-mm-dot.active { background: var(--mars); box-shadow: 0 0 8px rgba(var(--mars-rgb),0.35); transform: scale(1.5); }
.dk-mm-dot:hover:not(.active) { background: var(--text-dim); }
.dk-nav-btn {
    background: none; border: 1px solid rgba(var(--text-rgb),0.06);
    color: var(--text-dim); font-family: var(--font-mono);
    font-size: 0.55rem; padding: 4px 10px;
    border-radius: 4px; cursor: pointer;
    letter-spacing: 1px; text-transform: uppercase;
    transition: all 0.3s;
    display: flex; align-items: center; gap: 6px;
}
.dk-nav-btn:hover { border-color: var(--mars); color: var(--mars); }
.dk-nav-btn:disabled { opacity: 0.2; cursor: default; }
.dk-nav-btn:disabled:hover { border-color: rgba(var(--text-rgb),0.06); color: var(--text-dim); }

/* Hero section */
.dk-hero {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 400px;
    overflow: hidden;
}
.dk-hero-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.5s;
}
.dk-hero::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(0deg, var(--void) 0%, rgba(var(--void-rgb),0.4) 40%, rgba(var(--void-rgb),0.1) 100%);
    pointer-events: none;
}
.dk-hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 2;
    padding: 0 clamp(24px, 6vw, 80px) 40px;
}
.dk-hero-title {
    font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700; line-height: 1.1; margin-bottom: 10px;
}
.dk-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.dk-hero-cat {
    display: inline-block;
    font-family: var(--font-mono); font-size: 0.5rem;
    padding: 3px 12px; border-radius: 3px;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--ice); border: 1px solid rgba(var(--ice-rgb),0.2);
    background: rgba(var(--ice-rgb),0.08);
}
.dk-hero-desc {
    font-size: 1rem; color: var(--text-mid);
    line-height: 1.7; font-weight: 300;
    max-width: 650px;
}
.dk-hero-tech {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.dk-hero-tech span {
    font-family: var(--font-mono); font-size: 0.65rem;
    padding: 4px 12px; border-radius: 20px;
    background: rgba(var(--text-rgb),0.06);
    color: var(--text-mid); border: 1px solid rgba(var(--text-rgb),0.08);
    letter-spacing: 0.5px;
}

/* Content body */
.dk-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px clamp(24px, 6vw, 80px) 80px;
}

/* Section blocks */
.dk-section {
    margin-bottom: 48px;
}
.dk-section-label {
    font-family: var(--font-mono); font-size: 0.55rem;
    color: var(--mars); letter-spacing: 3px;
    text-transform: uppercase; margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
}
.dk-section-label::before { content: ''; width: 12px; height: 1px; background: var(--mars); }
.dk-section-text {
    font-size: 0.95rem; color: var(--text-mid);
    line-height: 1.8; font-weight: 300;
}

/* Media gallery */
.dk-media {
    display: flex; flex-direction: column; gap: 16px;
}
.dk-media-item {
    border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(var(--text-rgb),0.06);
    position: relative;
}
.dk-media-item img {
    width: 100%; display: block;
}
.dk-media-item video {
    width: 100%; display: block;
}
.dk-media-caption {
    font-family: var(--font-mono); font-size: 0.6rem;
    color: var(--text-dim); letter-spacing: 1px;
    padding: 10px 14px;
    background: rgba(var(--text-rgb),0.03);
    border-top: 1px solid rgba(var(--text-rgb),0.06);
}

/* Links section */
.dk-links {
    display: flex; flex-wrap: wrap; gap: 12px;
}
.dk-links a {
    padding: 12px 24px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
    text-decoration: none; transition: all 0.3s;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); letter-spacing: 0.5px;
}
.dk-link-primary { background: var(--mars); color: #fff; }
.dk-link-primary:hover { box-shadow: 0 4px 25px rgba(var(--mars-rgb),0.35); transform: translateY(-2px); }
.dk-link-secondary { border: 1px solid rgba(var(--text-rgb),0.1); color: var(--text-dim); background: transparent; }
.dk-link-secondary:hover { border-color: rgba(var(--text-rgb),0.25); color: var(--text); transform: translateY(-2px); }

/* Divider */
.dk-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--mars-rgb),0.15), transparent);
    margin: 48px 0;
}

/* Sections start hidden — GSAP ScrollTrigger reveals them */
.dk-body .dk-section {
    opacity: 0;
    transform: translateY(24px);
}

/* Mission log — instrument-panel readout */
.dk-mission-log {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 2px 6px 14px;
    border-left: 2px solid var(--mars);
    background: rgba(var(--text-rgb), 0.03);
    border-radius: 0 4px 4px 0;
}
.ml-pair {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 14px;
}
.ml-label {
    font-family: var(--font-mono);
    font-size: 0.32rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    line-height: 1;
}
.ml-val {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.6px;
    color: var(--text-mid);
    line-height: 1.3;
    white-space: nowrap;
}
.ml-div {
    width: 1px;
    align-self: stretch;
    background: rgba(var(--text-rgb), 0.06);
    flex-shrink: 0;
}
.ml-status {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--mars);
    padding: 0 14px;
    white-space: nowrap;
}

/* ================================================================
   PROJECTS — Touch Device Overrides
   ================================================================ */

/* Restore native cursor, hide custom cursor elements */
body.pg-gravity.is-touch {
    cursor: auto;
}
body.pg-gravity.is-touch #cursor,
body.pg-gravity.is-touch #cursorField {
    display: none;
}
body.pg-gravity.is-touch .domain-label {
    cursor: pointer;
}

/* CSS-only fallback for touch detection */
@media (pointer: coarse) {
    body.pg-gravity { cursor: auto; }
    #cursor, #cursorField { display: none !important; }
    .domain-label { cursor: pointer; }
    .domain-label { min-width: 80px; min-height: 44px; }
}

/* Touch-active state mirrors hover styles */
.uv-star.touch-active { transform: translate(-50%, -50%) scale(1.12) !important; }
.uv-star.touch-active .uv-star-core::after { opacity: 0.3; }
.uv-star.touch-active .uv-star-label {
    color: var(--text);
    border-color: color-mix(in srgb, var(--sc) 40%, transparent);
    background: rgba(var(--void-rgb),0.8);
    box-shadow: 0 0 20px color-mix(in srgb, var(--sc) 10%, transparent);
}
.uv-star.touch-active .uv-star-tech {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================================
   PROJECTS — Responsive: Hover Card Bottom Sheet (phones)
   ================================================================ */
@media (max-width: 640px) {
    #hoverCard {
        position: fixed;
        bottom: 0; left: 0 !important; right: 0;
        top: auto !important;
        width: 100% !important;
        max-height: 60vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s var(--ease-out), opacity 0.25s;
    }
    #hoverCard.visible {
        transform: translateY(0);
        opacity: 1;
    }
    #hoverCard.small { width: 100% !important; }
}

/* ================================================================
   PROJECTS — Responsive: Universe View
   ================================================================ */
@media (max-width: 768px) {
    .uv-title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        letter-spacing: 3px;
    }
    .uv-count {
        margin-bottom: 30px;
    }
    .uv-constellation {
        width: 95vw;
        height: 55vh;
    }
    .uv-back {
        top: 16px; left: 16px;
        padding: 6px 14px;
        font-size: 0.55rem;
    }
    .uv-star-label {
        font-size: 0.6rem;
        letter-spacing: 1px;
        padding: 4px 10px;
    }
    .uv-star.secondary .uv-star-label {
        font-size: 0.45rem;
    }
    .uv-star-tech span {
        font-size: 0.32rem;
    }
}

@media (max-width: 480px) {
    .uv-constellation {
        width: 100vw;
        height: 50vh;
    }
    .uv-title {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    .uv-count {
        font-size: 0.42rem;
        margin-bottom: 20px;
    }
}

/* ================================================================
   PROJECTS — Responsive: Command Deck
   ================================================================ */
@media (max-width: 768px) {
    .dk-hero {
        height: 45vh;
        min-height: 280px;
    }
    .dk-hero-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }
    .dk-hero-overlay {
        padding: 0 20px 24px;
    }
    .dk-hero-desc {
        font-size: 0.88rem;
        line-height: 1.6;
    }
    .dk-hero-tech span {
        font-size: 0.55rem;
        padding: 3px 8px;
    }
    .dk-body {
        padding: 32px 20px 60px;
    }
    .dk-section-text {
        font-size: 0.88rem;
    }
    .dk-top {
        padding: 0 12px;
        height: 44px;
    }
    .dk-back {
        font-size: 0.5rem;
        padding: 4px 10px;
    }
    .dk-nav-btn {
        padding: 4px 8px;
        font-size: 0.5rem;
    }
    .dk-links {
        flex-direction: column;
    }
    .dk-links a {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dk-hero {
        height: 35vh;
        min-height: 220px;
    }
    .dk-hero-cat {
        font-size: 0.42rem;
    }
    .dk-mission-log {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 2px 6px 10px;
    }
    .ml-pair { padding: 0 10px; }
    .ml-div { display: none; }
    .ml-status { padding: 0 10px; }
}
