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

:root {
    --bg-deep: #05070d;
    --bg-mid: #0a1020;
    --aqua: #59f3ff;
    --violet: #8a72ff;
    --lime: #9dff62;
    --text: #e9f1ff;
}

body {
    background:
        radial-gradient(48rem 48rem at 8% 12%, rgba(89, 243, 255, 0.18), transparent 65%),
        radial-gradient(44rem 44rem at 92% 86%, rgba(138, 114, 255, 0.16), transparent 65%),
        linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

body.projects-page {
    background:
        radial-gradient(42rem 42rem at 75% 14%, rgba(157, 255, 98, 0.14), transparent 65%),
        radial-gradient(44rem 44rem at 10% 90%, rgba(89, 243, 255, 0.16), transparent 65%),
        linear-gradient(180deg, #06080f 0%, #020307 100%);
}

body.projects-page .background-image {
    opacity: 0.24;
    filter: grayscale(18%) brightness(0.22) contrast(1.2) saturate(0.8);
}

.space-hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 5rem 1rem 7rem;
}

.space-hero.scroll-gateway {
    cursor: n-resize;
}

.space-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%, rgba(207, 233, 255, 0.16), rgba(2, 5, 10, 0.92) 62%);
    transition: opacity 0.55s ease;
}

.space-hero.is-opening::after {
    opacity: 1;
}

.space-hero.is-closing::after {
    opacity: 1;
}

.space-shell {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(65rem 35rem at 50% 110%, rgba(7, 17, 31, 0.9), transparent 72%),
        radial-gradient(28rem 22rem at 8% 20%, rgba(255, 167, 94, 0.15), transparent 75%),
        radial-gradient(32rem 24rem at 91% 12%, rgba(98, 138, 255, 0.18), transparent 73%),
        linear-gradient(180deg, rgba(1, 4, 12, 0.7), rgba(1, 3, 8, 0.9));
    z-index: 1;
}

.space-shell::before,
.space-shell::after {
    content: "";
    position: absolute;
    border-radius: 42px;
    border: 1px solid rgba(187, 223, 255, 0.13);
    box-shadow: inset 0 0 24px rgba(156, 196, 255, 0.12), 0 0 32px rgba(0, 0, 0, 0.4);
}

.space-shell::before {
    inset: 2.8rem 2rem;
}

.space-shell::after {
    inset: 4.6rem 3.5rem;
    border-radius: 36px;
    opacity: 0.55;
}

.space-stars {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 8% 26%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 21% 67%, rgba(153, 209, 255, 0.7), transparent),
        radial-gradient(1px 1px at 37% 18%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.2px 1.2px at 63% 55%, rgba(170, 224, 255, 0.7), transparent),
        radial-gradient(1px 1px at 77% 34%, rgba(255, 255, 255, 0.76), transparent),
        radial-gradient(1.4px 1.4px at 91% 73%, rgba(191, 233, 255, 0.8), transparent);
    animation: starsDrift 14s linear infinite;
    opacity: 0.55;
}

@keyframes starsDrift {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-12px);
    }
}

.space-contact {
    position: absolute;
    top: 1.4rem;
    right: 1.8rem;
    z-index: 4;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #f6fbff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
}

.porthole-wrap {
    position: relative;
    z-index: 3;
    width: min(74vw, 700px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1), filter 0.6s ease;
}

.space-hero.is-opening .porthole-wrap {
    transform: translate3d(0, 0, 0) scale(1.28) !important;
    filter: brightness(1.12) saturate(1.2);
}

@keyframes portalZoomOut {
    0% {
        transform: translate3d(0, 0, 0) scale(1.28);
        filter: brightness(1.12) saturate(1.2);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        filter: brightness(1);
    }
}

.space-hero.is-closing .porthole-wrap {
    animation: portalZoomOut 0.72s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.porthole-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 24%, rgba(190, 220, 255, 0.22), transparent 30%),
        radial-gradient(circle at 69% 72%, rgba(73, 112, 178, 0.2), transparent 42%),
        conic-gradient(from 180deg, rgba(77, 99, 135, 0.45), rgba(12, 20, 35, 0.8), rgba(77, 99, 135, 0.42));
    box-shadow:
        inset 0 0 0 3px rgba(194, 222, 255, 0.24),
        inset 0 0 35px rgba(12, 22, 42, 0.9),
        0 0 65px rgba(0, 0, 0, 0.75);
}

.porthole-glass {
    position: absolute;
    inset: 5.2%;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(130% 100% at 50% 10%, rgba(24, 34, 56, 0.7), rgba(5, 10, 22, 0.95) 60%),
        linear-gradient(180deg, #060d1d 0%, #02040b 100%);
    box-shadow: inset 0 0 28px rgba(56, 96, 160, 0.32), inset 0 -20px 52px rgba(0, 0, 0, 0.72);
    transition: filter 0.6s ease, box-shadow 0.6s ease;
}

.space-hero.is-opening .porthole-glass {
    filter: blur(0.5px) brightness(1.18);
    box-shadow: inset 0 0 38px rgba(138, 189, 255, 0.48), inset 0 -20px 52px rgba(0, 0, 0, 0.72);
}

.porthole-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(1px 1px at 20% 20%, rgba(255, 255, 255, 0.72), transparent), radial-gradient(1px 1px at 62% 31%, rgba(191, 229, 255, 0.62), transparent), radial-gradient(1px 1px at 71% 68%, rgba(255, 255, 255, 0.62), transparent), radial-gradient(1px 1px at 35% 58%, rgba(198, 228, 255, 0.6), transparent);
    opacity: 0.7;
}

.earth-horizon {
    position: absolute;
    left: -18%;
    right: -18%;
    bottom: -34%;
    height: 58%;
    border-radius: 50%;
    background:
        radial-gradient(130% 95% at 50% 24%, rgba(83, 156, 113, 0.74), rgba(31, 72, 54, 0.7) 34%, rgba(8, 26, 36, 0.8) 62%, rgba(4, 13, 28, 1) 100%);
    box-shadow: 0 -12px 32px rgba(84, 149, 255, 0.38), 0 -1px 0 rgba(205, 230, 255, 0.48);
}

.space-brand {
    position: absolute;
    left: 14%;
    top: 40%;
    transform: translateY(-50%);
    z-index: 5;
    font-size: clamp(2.1rem, 5.2vw, 4.8rem);
    font-weight: 800;
    color: #f9fcff;
    letter-spacing: -0.02em;
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.18);
}

.space-copy {
    position: absolute;
    left: 14%;
    top: 56%;
    z-index: 5;
    font-size: clamp(0.9rem, 1.7vw, 1.2rem);
    color: rgba(228, 240, 255, 0.9);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.space-cta {
    position: absolute;
    left: 50%;
    bottom: 1.7rem;
    transform: translateX(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.45rem 0.45rem 1.05rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #13161f;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.space-cta:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(140, 208, 255, 0.25);
}

.space-hero.is-opening .space-cta,
.space-hero.is-opening .space-brand,
.space-hero.is-opening .space-copy,
.space-hero.is-opening .space-contact {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.space-hero.is-closing .space-cta,
.space-hero.is-closing .space-brand,
.space-hero.is-closing .space-copy,
.space-hero.is-closing .space-contact {
    opacity: 1;
    transform: translateY(0);
}

body.portal-transition {
    overflow: hidden;
}

.space-cta-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: #f5f7fb;
    box-shadow: inset 0 0 0 1px rgba(19, 22, 31, 0.15);
}

#photos-gallery {
    margin-top: clamp(1.2rem, 2vw, 2.2rem);
}

body::before {
    content: "";
    position: fixed;
    inset: -25% -10%;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(28rem 28rem at 22% 24%, rgba(89, 243, 255, 0.2), transparent 70%),
        radial-gradient(32rem 32rem at 68% 68%, rgba(138, 114, 255, 0.16), transparent 72%);
    filter: blur(26px);
    animation: driftAura 18s ease-in-out infinite alternate;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.22;
    background-image: radial-gradient(rgba(255, 255, 255, 0.45) 0.7px, transparent 0.7px);
    background-size: 3px 3px;
    -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 95%);
    mask-image: radial-gradient(circle at center, black 35%, transparent 95%);
}

@keyframes driftAura {
    0% {
        transform: translate3d(-1%, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(2%, -2%, 0) scale(1.06);
    }
}

.navbar {
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    color: #fff6f6;
    justify-content: space-between;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(120deg, rgba(5, 10, 24, 0.62), rgba(8, 24, 40, 0.48));
    border-bottom: 1px solid rgba(153, 242, 255, 0.26);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    min-height: 64px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.navbar nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.navbar-links {
    list-style: none;
    display: flex;
    gap: 1px;
    padding: 0  30px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
}

.navbar-links li {
    display: flex;
    align-items: center;
}

.navbar-links a {
    display: inline-block;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    color: #eef7ff;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.navbar-links a i {
    margin-right: 8px;
}

.navbar-links a:hover {
    background: rgba(89, 243, 255, 0.12);
    color: #9dff62;
    box-shadow: 0 0 18px rgba(89, 243, 255, 0.24), inset 0 0 0 1px rgba(89, 243, 255, 0.35);
    transform: translateY(-1px);
}

.navbar-links a.active {
    color: #59f3ff;
    border-bottom: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(89, 243, 255, 0.42), 0 0 20px rgba(89, 243, 255, 0.2);
}

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-right: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(89, 243, 255, 0.3));
}

.icon:hover {
    transform: scale(1.1);
}



#tubes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.tube {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(circle, #000 98%, transparent 100%);
    mask-image: radial-gradient(circle, #000 98%, transparent 100%);
    background-image: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 18%, rgba(255, 255, 255, 0) 44%);
    pointer-events: none;
    transition: background 0.35s ease, box-shadow 0.35s ease, opacity 0.3s ease, filter 0.3s ease;
    opacity: 1;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    filter: saturate(2.4) brightness(1.55) contrast(1.1);
}

.tube.hidden {
    opacity: 0;
}

/* Photo Gallery Styles */
#photos-gallery {
    text-align: center;
    position: relative;
}

#photos-gallery article {
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(136, 178, 255, 0.06));
    border: 1px solid rgba(116, 198, 255, 0.2);
    position: relative;
    overflow: hidden;
}

#photos-gallery article:hover {
    box-shadow: 0 22px 72px rgba(89, 243, 255, 0.24), 0 0 24px rgba(157, 255, 98, 0.16);
    background-color: rgba(255, 255, 255, 0.14);
}

#photos-gallery article::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(89, 243, 255, 0.25), rgba(157, 255, 98, 0.16), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

#photos-gallery article:hover::before {
    opacity: 1;
}

#photos-gallery article::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.25s ease;
    background:
        radial-gradient(260px 260px at var(--spot-x, 50%) var(--spot-y, 50%), rgba(137, 252, 255, 0.22), transparent 62%),
        linear-gradient(120deg, transparent 12%, rgba(255, 255, 255, 0.1) 48%, transparent 84%);
}

#photos-gallery article.is-hovering::after {
    opacity: 1;
}

@keyframes cardFloat {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(0, -5px, 0);
    }
}

.reveal-card {
    --reveal-y: 34px;
    --reveal-scale: 0.97;
    --hover-lift: 0px;
    --rx: 0deg;
    --ry: 0deg;
    opacity: 0;
    filter: blur(2px);
}

.reveal-card.is-visible {
    --reveal-y: 0px;
    --reveal-scale: 1;
    opacity: 1;
    filter: blur(0);
}

.interactive-card {
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transform: translate3d(0, calc(var(--reveal-y) + var(--hover-lift)), 0) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--reveal-scale));
    transition:
        transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1),
        opacity 0.5s ease,
        filter 0.45s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    transition-delay: var(--delay, 0ms);
}

.interactive-card.is-hovering {
    --hover-lift: -10px;
    animation: cardFloat 1.1s ease-in-out infinite alternate;
}

#photos-gallery h2 {
    color: #9dff62;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: 1px;
    font-style: italic;
    text-shadow: 0 0 16px rgba(157, 255, 98, 0.38);
}

.photos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.photo-div {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #1a1a1a;
    aspect-ratio: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.photo-div:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(146, 23, 167, 0.3);
}

.photo-div img {
    width: 100%;
    height: 100%;
    display: block;
    display: flex;
    margin: 0 auto;
    position: absolute;
    top: 0;
    left: 0px;
}

.Visit {
    position: relative;
    z-index: 10;
    padding: 12px 32px;
    background: linear-gradient(110deg, #2e7dff, #39e8ff);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-bottom: 20px;
    display: inline-block;
}

.Visit:hover {
    background: linear-gradient(110deg, #4f8eff, #6df1ff);
    transform: translateY(-2px);
}


.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1; 
    filter: grayscale(18%) brightness(0.34) contrast(1.05) saturate(0.9);
    opacity: 0.55;
}

section .rounded-3xl {
    border: 1px solid rgba(126, 197, 255, 0.2);
    box-shadow: 0 14px 44px rgba(3, 8, 20, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

section .rounded-3xl:hover {
    border-color: rgba(89, 243, 255, 0.45);
    box-shadow: 0 24px 65px rgba(89, 243, 255, 0.2), inset 0 0 0 1px rgba(89, 243, 255, 0.2);
    transform: translateY(-4px);
}

footer {
    background: linear-gradient(180deg, rgba(3, 6, 12, 0.2) 0%, rgba(3, 6, 12, 0.84) 46%);
    border-top: 1px solid rgba(126, 197, 255, 0.2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

footer a:hover {
    color: #59f3ff;
    text-shadow: 0 0 10px rgba(89, 243, 255, 0.35);
}

@media (max-width: 768px) {
    .navbar {
        padding: 8px 12px;
        min-height: 58px;
        background: rgba(8, 11, 18, 0.86);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px); /* Safari/iOS support */
        border-bottom: 1px solid rgba(89, 243, 255, 0.22);
    }

    .navbar nav {
        justify-content: center;
    }

    .navbar-links {
        width: auto;
        padding: 0;
        gap: 6px;
        justify-content: center;
    }

    .navbar-links a {
        font-size: 14px;
        padding: 8px 10px;
    }

    body::before {
        opacity: 0.75;
        filter: blur(18px);
    }

    .icon {
        display: none;
    }

    .space-hero {
        min-height: 90vh;
        padding-top: 4.6rem;
    }

    .space-contact {
        top: 0.75rem;
        right: 0.8rem;
        font-size: 0.7rem;
    }

    .space-shell::before {
        inset: 2rem 0.7rem;
    }

    .space-shell::after {
        inset: 3.2rem 1.3rem;
    }

    .porthole-wrap {
        width: min(92vw, 560px);
    }

    .space-brand {
        left: 10%;
        top: 42%;
    }

    .space-copy {
        left: 10%;
        top: 57%;
        letter-spacing: 0.04em;
    }

    .space-cta {
        bottom: 1.2rem;
    }

    .interactive-card {
        transform: translate3d(0, var(--reveal-y), 0) scale(var(--reveal-scale));
    }

    .interactive-card.is-hovering {
        --hover-lift: 0px;
        animation: none;
    }
}
