
/* =========================================================
   THE NEXUS UNIVERSE
   Homepage Cosmic Design System
   ========================================================= */

:root {
    --home-bg: #05010a;
    --home-purple: #a020f0;
    --home-cyan: #00aaff;
    --home-pink: #ff66ff;

    --home-text: #ffffff;
    --home-muted: #b8b4c7;

    --home-glass: rgba(14, 8, 27, 0.72);
    --home-glass-hover: rgba(25, 14, 43, 0.88);

    --home-border: rgba(180, 130, 255, 0.16);
    --home-border-hover: rgba(0, 170, 255, 0.48);

    --home-gradient:
        linear-gradient(
            100deg,
            var(--home-purple),
            var(--home-cyan) 55%,
            var(--home-pink)
        );

    --home-glow-purple:
        0 0 35px rgba(160, 32, 240, 0.18);

    --home-glow-cyan:
        0 0 35px rgba(0, 170, 255, 0.12);

    --home-radius: 18px;
    --home-content-width: 1240px;
}


/* =========================================================
   BASE
   ========================================================= */

.home-page {
    min-height: 100vh;
    background: var(--home-bg);
    color: var(--home-text);
    overflow-x: clip;
}

.home-page main {
    position: relative;
    z-index: 1;
}

.home-page ::selection {
    background: rgba(160, 32, 240, 0.5);
    color: white;
}

.home-page a:focus-visible,
.home-page button:focus-visible {
    outline: 2px solid var(--home-cyan);
    outline-offset: 5px;
}


/* =========================================================
   COSMIC BACKGROUND
   ========================================================= */

#universe {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(
            ellipse at 50% 12%,
            rgba(75, 20, 125, 0.17),
            transparent 48%
        ),
        radial-gradient(
            ellipse at 85% 55%,
            rgba(0, 100, 180, 0.09),
            transparent 45%
        ),
        var(--home-bg);
}

#stars-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

#nebula-layer {
    position: absolute;
    inset: -20%;
    opacity: 0.65;
    background:
        radial-gradient(
            ellipse at 24% 25%,
            rgba(160, 32, 240, 0.18),
            transparent 35%
        ),
        radial-gradient(
            ellipse at 76% 32%,
            rgba(0, 170, 255, 0.13),
            transparent 33%
        ),
        radial-gradient(
            ellipse at 50% 75%,
            rgba(255, 102, 255, 0.07),
            transparent 35%
        );
    filter: blur(25px);
    animation: homeNebulaDrift 24s ease-in-out infinite alternate;
}

@keyframes homeNebulaDrift {
    0% {
        transform: translate3d(-1%, -1%, 0) scale(1);
    }

    100% {
        transform: translate3d(1.5%, 1%, 0) scale(1.06);
    }
}


/* =========================================================
   NAVBAR
   ========================================================= */

.home-navbar {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);

    width: calc(100% - 48px);
    max-width: 1440px;
    min-height: 68px;

    padding: 12px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    background: rgba(8, 4, 18, 0.76);
    border: 1px solid rgba(180, 130, 255, 0.17);
    border-radius: 16px;

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);

    z-index: 100;
}

#navbar-logo-wrapper {
    min-width: 140px;
    flex-shrink: 0;
    text-decoration: none;
}

#navbar-logo {
    width: 140px;
    height: 32px;
    filter: drop-shadow(0 0 9px rgba(160, 32, 240, 0.3));
}

.home-navbar nav {
    display: flex;
    align-items: center;
}

.home-navbar .nav-links {
    gap: 30px;
}

.home-navbar .nav-links a {
    display: inline-flex;
    align-items: center;

    color: #c7c2d5;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.3px;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.home-navbar .nav-links a::after {
    bottom: -8px;
    height: 2px;
    border-radius: 4px;
    background: var(--home-gradient);
    box-shadow: 0 0 12px rgba(160, 32, 240, 0.4);
}

.home-navbar .nav-links a:hover {
    color: white;
}

.home-navbar .nav-icon-button {
    width: 40px;
    height: 40px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;

    color: #ded8ed;
    background: rgba(255, 255, 255, 0.035);
}

.home-navbar .nav-icon-button:hover {
    border-color: rgba(0, 170, 255, 0.35);
    background: rgba(0, 170, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.08);
}


/* =========================================================
   HERO
   ========================================================= */

.home-hero {
    position: relative;
    isolation: isolate;

    min-height: min(920px, 100svh);
    padding: 150px 24px 90px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    overflow: hidden;
}

/* Atmospheric glow behind the title */

.home-hero::before {
    content: "";
    position: absolute;

    width: min(850px, 100vw);
    height: 500px;

    left: 50%;
    top: 44%;

    transform: translate(-50%, -50%);

    background:
        radial-gradient(
            ellipse,
            rgba(110, 30, 180, 0.17) 0%,
            rgba(35, 60, 150, 0.08) 35%,
            transparent 70%
        );

    filter: blur(22px);
    pointer-events: none;
    z-index: -1;
}

.home-hero::after {
    content: "";
    position: absolute;

    left: 50%;
    bottom: 0;

    width: min(850px, 90%);
    height: 1px;

    transform: translateX(-50%);

    background: linear-gradient(
        90deg,
        transparent,
        rgba(160, 32, 240, 0.45),
        rgba(0, 170, 255, 0.45),
        transparent
    );

    opacity: 0.55;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin: 0 0 28px;
    padding: 9px 15px;

    border: 1px solid rgba(180, 130, 255, 0.18);
    border-radius: 100px;

    background: rgba(18, 9, 32, 0.65);

    color: #d0c3e8;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2.4px;
    text-transform: uppercase;

    box-shadow: 0 0 30px rgba(100, 30, 160, 0.07);

    animation: homeFadeUp 0.8s ease both;
}

.hero-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;
    background: var(--home-cyan);

    box-shadow:
        0 0 8px rgba(0, 170, 255, 0.8),
        0 0 18px rgba(0, 170, 255, 0.3);
}

#nexus-title {
    max-width: 1200px;
    margin: 0;

    color: #fff;

    font-size: clamp(3rem, 8.5vw, 7.6rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: clamp(-4px, -0.35vw, -1px);

    text-wrap: balance;

    text-shadow:
        0 0 55px rgba(160, 32, 240, 0.1),
        0 12px 45px rgba(0, 0, 0, 0.35);

    animation: homeTitleEnter 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-title-accent {
    display: block;
    margin-top: 10px;

    color: transparent;
    background: var(--home-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    filter: drop-shadow(0 0 24px rgba(130, 50, 230, 0.18));
}

#hero-slogan {
    margin: 28px 0 0;

    color: var(--home-muted);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 400;
    letter-spacing: 0.7px;
    line-height: 1.7;

    animation: homeFadeUp 1s ease 0.2s both;
}

#portal-line {
    width: min(260px, 55vw);
    height: 2px;

    margin: 34px auto 28px;

    background: var(--home-gradient);
    border-radius: 100px;

    box-shadow:
        0 0 10px rgba(160, 32, 240, 0.45),
        0 0 28px rgba(0, 170, 255, 0.2);

    animation: homeLineReveal 1s ease 0.4s both;
}

/* Rotating splash text */

#splash-text {
    --px: 0px;
    --py: 0px;

    min-height: 2em;
    max-width: 90vw;
    margin: 0;

    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.6;

    color: transparent;
    background: var(--home-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    filter: drop-shadow(0 0 13px rgba(130, 70, 230, 0.2));

    opacity: 0;
    transform: translate(var(--px), var(--py)) scale(0.92);

    transition:
        opacity 0.4s ease,
        transform 0.4s ease;

    position: relative;
    z-index: 2;
}

#splash-text.splash-show {
    opacity: 1 !important;
    transform: translate(var(--px), var(--py)) scale(1.02) !important;
}

#splash-text.splash-hide {
    pointer-events: none;
}

/* Bottom scroll indicator */

.hero-bottom-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;

    width: max-content;
    max-width: calc(100% - 32px);

    transform: translateX(-50%);

    color: #8d849f;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.hero-indicator-line {
    display: block;
    width: 32px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(160, 32, 240, 0.65)
    );
}

.hero-indicator-line:last-child {
    transform: rotate(180deg);
}


/* =========================================================
   HERO ANIMATIONS
   ========================================================= */

@keyframes homeTitleEnter {
    from {
        opacity: 0;
        transform: translateY(24px);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes homeFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes homeLineReveal {
    from {
        opacity: 0;
        transform: scaleX(0.25);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}


/* =========================================================
   FEATURED PROJECTS SECTION
   ========================================================= */

.home-featured-section {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: calc(var(--home-content-width) + 80px);

    margin: 0 auto;
    padding: 105px 40px 120px;
}

.featured-section-header {
    max-width: 760px;
    margin: 0 auto 46px;

    text-align: center;
}

.featured-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin: 0 0 18px;
}

.featured-dot {
    display: block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;
    background: var(--home-cyan);

    box-shadow:
        0 0 9px rgba(0, 170, 255, 0.85),
        0 0 20px rgba(0, 170, 255, 0.25);

    animation: homeDotPulse 2.8s ease-in-out infinite;
}

.featured-kicker {
    color: #aaa0c0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2.3px;
    text-transform: uppercase;
}

.featured-title {
    margin: 0;

    color: white;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 750;
    letter-spacing: -1.2px;
    line-height: 1.15;

    animation: homeFadeUp 0.8s ease both;

    background: none;
    -webkit-text-fill-color: initial;
    text-shadow: none;
}

.featured-title-accent {
    color: transparent;
    background: var(--home-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.featured-description {
    max-width: 590px;
    margin: 18px auto 0;

    color: var(--home-muted);
    font-size: 0.98rem;
    line-height: 1.9;
}

.featured-store-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin-top: 24px;
    padding: 11px 17px;

    border: 1px solid rgba(160, 32, 240, 0.3);
    border-radius: 10px;

    background: rgba(160, 32, 240, 0.07);

    color: #e6d8ff;
    font-size: 0.86rem;
    font-weight: 600;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.featured-store-link span {
    color: var(--home-cyan);
    transition: transform 0.25s ease;
}

.featured-store-link:hover {
    transform: translateY(-2px);
    background: rgba(160, 32, 240, 0.13);
    border-color: rgba(0, 170, 255, 0.42);
    box-shadow: var(--home-glow-purple);
}

.featured-store-link:hover span {
    transform: translate(2px, -2px);
}


/* =========================================================
   PROJECT CARDS
   ========================================================= */

.featured-projects {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;

    padding: 0;
    margin: 0;
}

.fp-card {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(28, 15, 45, 0.86),
            rgba(10, 7, 20, 0.94) 70%
        );

    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    transition:
        transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        background 0.35s ease;
}

.fp-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        125deg,
        rgba(160, 32, 240, 0.1),
        transparent 38%,
        transparent 68%,
        rgba(0, 170, 255, 0.07)
    );

    opacity: 0.65;
    pointer-events: none;
    z-index: -1;

    transition: opacity 0.35s ease;
}

.fp-card::after {
    content: "";
    position: absolute;

    top: 0;
    left: 15%;
    right: 15%;

    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(190, 145, 255, 0.5),
        transparent
    );

    opacity: 0.65;
    pointer-events: none;
}

.fp-card:hover {
    transform: translateY(-7px);

    border-color: var(--home-border-hover);

    background: var(--home-glass-hover);

    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.32),
        0 0 32px rgba(120, 45, 200, 0.12),
        0 0 25px rgba(0, 170, 255, 0.06);
}

.fp-card:hover::before {
    opacity: 1;
}

.fp-card img {
    display: block;

    width: 100%;
    height: 205px;

    object-fit: cover;

    border-bottom: 1px solid rgba(180, 130, 255, 0.12);

    transition:
        transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 0.35s ease;

    filter: saturate(0.9);
}

.fp-card:hover img {
    transform: scale(1.035);
    filter: saturate(1.08);
}

.fp-info {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    flex: 1;

    padding: 25px 24px 27px;
}

.fp-info h3 {
    margin: 0 0 12px;

    color: white;
    font-size: 1.25rem;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.fp-info p {
    margin: 0;

    color: #b9b3c8;
    font-size: 0.91rem;
    line-height: 1.8;

    overflow-wrap: anywhere;
}

.fp-loading {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 180px;
    padding: 35px;

    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);

    background: rgba(16, 9, 29, 0.6);

    color: var(--home-muted);
    font-size: 0.95rem;
    text-align: center;
}

.fp-fallback {
    min-height: 190px;
}

.fp-fallback .fp-info {
    justify-content: center;
}


/* =========================================================
   FOOTER
   ========================================================= */

.home-footer {
    position: relative;
    z-index: 1;

    padding: 30px 24px 45px;

    text-align: center;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(10, 5, 18, 0.55)
    );
}

.footer-divider {
    width: min(900px, 90%);
    height: 1px;

    margin: 0 auto 36px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(160, 32, 240, 0.35),
        rgba(0, 170, 255, 0.35),
        transparent
    );
}

.footer-brand {
    margin: 0;

    color: #ded5f0;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 3px;
}

.footer-copyright {
    margin: 14px 0 0;

    color: #8f879f;
    font-size: 0.82rem;
    line-height: 1.8;
}

.footer-separator {
    padding: 0 7px;
    color: var(--home-purple);
}

.footer-tagline {
    margin: 8px 0 0;

    color: #696176;
    font-size: 0.8rem;
    letter-spacing: 0.4px;
}


/* =========================================================
   DOT ANIMATION
   ========================================================= */

@keyframes homeDotPulse {
    0%, 100% {
        opacity: 0.8;
        box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
    }

    50% {
        opacity: 1;
        box-shadow:
            0 0 12px rgba(0, 170, 255, 0.8),
            0 0 24px rgba(0, 170, 255, 0.25);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 1500px) {
    .home-hero {
        min-height: 940px;
    }

    .home-featured-section {
        padding-top: 125px;
        padding-bottom: 140px;
    }

    .featured-projects {
        gap: 28px;
    }
}

@media (max-width: 1000px) {
    .home-navbar {
        width: calc(100% - 32px);
        padding: 12px 18px;
    }

    .home-navbar .nav-links {
        gap: 22px;
    }

    .home-hero {
        min-height: 85svh;
        padding-top: 145px;
    }

    .home-featured-section {
        padding: 85px 28px 100px;
    }

    .featured-projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .fp-card img {
        height: 190px;
    }
}

@media (max-width: 650px) {
    .home-navbar {
        top: 8px;
        width: calc(100% - 20px);
        min-height: 60px;

        padding: 10px 12px;
        gap: 10px;

        border-radius: 13px;
    }

    #navbar-logo-wrapper {
        min-width: 0;
        width: 140px;
    }

    #navbar-logo {
        max-width: 100%;
    }

    .home-navbar .nav-links {
        gap: 13px;
    }

    .home-navbar .nav-links a {
        font-size: 0.78rem;
        letter-spacing: 0;
    }

    .home-navbar .nav-icon-button {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .home-hero {
        min-height: 790px;
        min-height: 100svh;

        padding: 135px 20px 90px;
    }

    .hero-eyebrow {
        gap: 8px;
        margin-bottom: 25px;
        padding: 8px 12px;

        font-size: 0.6rem;
        letter-spacing: 1.5px;
    }

    #nexus-title {
        font-size: clamp(2.7rem, 11vw, 4.5rem);
        line-height: 1.03;
        letter-spacing: -1.8px;
    }

    .hero-title-accent {
        margin-top: 7px;
    }

    #hero-slogan {
        margin-top: 22px;
        font-size: 1rem;
    }

    #portal-line {
        margin: 27px auto 22px;
    }

    #splash-text {
        font-size: 1rem;
    }

    .hero-bottom-indicator {
        bottom: 25px;
        gap: 8px;
        font-size: 0.53rem;
        letter-spacing: 1.5px;
    }

    .hero-indicator-line {
        width: 20px;
    }

    .home-featured-section {
        padding: 75px 18px 85px;
    }

    .featured-section-header {
        margin-bottom: 32px;
    }

    .featured-title-wrapper {
        margin-bottom: 15px;
    }

    .featured-kicker {
        font-size: 0.6rem;
        letter-spacing: 1.6px;
    }

    .featured-title {
        font-size: clamp(2rem, 8vw, 2.6rem);
        letter-spacing: -0.7px;
    }

    .featured-description {
        font-size: 0.91rem;
        line-height: 1.8;
    }

    .featured-projects {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .fp-card img {
        height: 210px;
    }

    .fp-info {
        padding: 22px;
    }

    .home-footer {
        padding: 25px 18px 35px;
    }
}

@media (max-width: 380px) {
    .home-navbar {
        padding: 9px 8px;
    }

    #navbar-logo-wrapper {
        width: 120px;
    }

    #navbar-logo {
        width: 120px;
    }

    .home-navbar .nav-links {
        gap: 9px;
    }

    .home-navbar .nav-links a {
        font-size: 0.7rem;
    }

    .home-navbar .nav-icon-button {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }

    .hero-eyebrow {
        font-size: 0.54rem;
        letter-spacing: 1.1px;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    #nebula-layer,
    .hero-eyebrow,
    #nexus-title,
    #hero-slogan,
    #portal-line,
    .featured-title,
    .featured-dot {
        animation: none !important;
    }

    .fp-card,
    .fp-card img,
    .featured-store-link,
    .featured-store-link span {
        transition: none !important;
    }

    .fp-card:hover,
    .fp-card:hover img,
    .featured-store-link:hover {
        transform: none;
    }
}