/* =========================================================
   NISCHAL KHANAL — SHARED SITE STYLES
   Reusable design system for index.html, 404.html, etc.
   ========================================================= */

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

:root {
    --bg: #07070a;
    --surface: rgba(255, 255, 255, .045);
    --surface-hover: rgba(255, 255, 255, .075);
    --border: rgba(255, 255, 255, .10);

    --text: #f5f5f7;
    --muted: #9999a6;

    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --blue: #2563eb;
    --cyan: #06b6d4;
    --cyan-light: #67e8f9;

    --radius: 20px;
    --content-width: 1100px;
    --page-gutter: 32px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   SHARED BACKGROUND
   ========================================================= */

.background {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.background::before,
.background::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.background::before {
    width: 550px;
    height: 550px;
    top: -250px;
    left: -200px;
    background: rgba(139, 92, 246, .16);
}

.background::after {
    width: 500px;
    height: 500px;
    right: -200px;
    bottom: 10%;
    background: rgba(6, 182, 212, .10);
}

.stars {
    position: absolute;
    inset: 0;
    opacity: .25;
    background-image:
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 1px, transparent 1px);
    background-size: 90px 90px, 150px 150px;
    background-position: 10px 20px, 60px 80px;
}

/* =========================================================
   NAVBAR
   ========================================================= */

nav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(var(--content-width), calc(100% - var(--page-gutter)));
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 16, .72);
    border: 1px solid var(--border);
    border-radius: 15px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: white;
    font-weight: 700;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 19px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: #d8d8df;
    text-decoration: none;
    font-size: 14px;
    transition: color .2s ease;
}

.nav-links a:hover {
    color: white;
}

.nav-contact {
    padding: 9px 16px;
    border-radius: 10px;
    color: white !important;
    text-decoration: none;
    background: linear-gradient(135deg, #7651e8, #315fd5);
}

/* =========================================================
   GENERAL LAYOUT
   ========================================================= */

.wrapper {
    width: min(var(--content-width), calc(100% - var(--page-gutter)));
    margin: auto;
}

section {
    padding: 90px 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 25px;
}

.eyebrow {
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.section-title {
    font-size: 28px;
    margin-top: 5px;
    letter-spacing: -.5px;
}

/* =========================================================
   SHARED GLASS / BUTTONS
   ========================================================= */

.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 11px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover {
    transform: translateY(-3px);
}

.button.primary {
    border: none;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    box-shadow: 0 10px 35px rgba(99, 70, 220, .25);
}

.button.primary:hover {
    box-shadow: 0 12px 35px rgba(99, 70, 220, .4);
}

.button.secondary {
    background: rgba(255, 255, 255, .035);
}

.button.secondary:hover {
    background: rgba(255, 255, 255, .08);
}

/* =========================================================
   HOMEPAGE — HERO
   ========================================================= */

.hero {
    min-height: 100vh;
    padding-top: 150px;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.welcome {
    color: #aaaab4;
    font-size: 14px;
    margin-bottom: 18px;
}

.welcome span {
    color: #34d399;
}

.hero h1 {
    font-size: clamp(55px, 8vw, 92px);
    line-height: .95;
    letter-spacing: -5px;
}

.gradient {
    background: linear-gradient(120deg, var(--purple-light), #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    color: var(--muted);
    max-width: 520px;
    margin-top: 25px;
    font-size: 17px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.socials {
    display: flex;
    gap: 18px;
    margin-top: 27px;
}

.socials a {
    color: #a4a4ae;
    text-decoration: none;
    font-size: 13px;
    transition: color .2s ease;
}

.socials a:hover {
    color: white;
}

/* Planet + ring are intentionally wrapped in one animated object. */
.hero-visual {
    height: 430px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.planet-system {
    position: relative;
    width: 370px;
    height: 370px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: planetFloat 6s ease-in-out infinite;
}

.orb {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 35% 30%,
            #c4b5fd,
            #8b5cf6 40%,
            #312e81 70%,
            #08080c
        );
    box-shadow: 0 0 100px rgba(139, 92, 246, .25);
}

.orbit {
    position: absolute;
    width: 370px;
    height: 110px;
    border: 1px solid rgba(167, 139, 250, .4);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.orbit::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan-light);
    box-shadow: 0 0 20px var(--cyan-light);
    right: 45px;
    top: 5px;
}

@keyframes planetFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-18px);
    }
}

/* =========================================================
   HOMEPAGE — ABOUT
   ========================================================= */

.about-card {
    padding: 35px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

.about-text h3 {
    font-size: 27px;
    margin: 8px 0 12px;
}

.about-text p {
    color: var(--muted);
}

.facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.fact {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, .025);
}

.fact-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.fact-label {
    color: #888893;
    font-size: 12px;
}

.fact-value {
    font-size: 14px;
    margin-top: 2px;
}

/* =========================================================
   HOMEPAGE — PROJECTS
   ========================================================= */

.projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.project {
    overflow: hidden;
    transition: transform .25s ease, background .25s ease;
}

.project:hover {
    transform: translateY(-6px);
    background: var(--surface-hover);
}

.project-image {
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(
            circle at center,
            rgba(139, 92, 246, .35),
            rgba(6, 182, 212, .08) 40%,
            rgba(0, 0, 0, .4)
        );
    font-size: 50px;
}

.project-content {
    padding: 20px;
}

.project h3 {
    font-size: 18px;
}

.project p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.tag {
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    background: rgba(139, 92, 246, .12);
    color: #c4b5fd;
}

.project-links {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.project-links a {
    color: #bbb;
    text-decoration: none;
    font-size: 12px;
}

.project-links a:hover {
    color: white;
}

/* =========================================================
   HOMEPAGE — CURRENTLY / TECH
   ========================================================= */

.currently {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.current {
    padding: 20px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.current-icon {
    font-size: 25px;
    margin-bottom: 8px;
}

.current small {
    color: #898995;
}

.current p {
    font-size: 14px;
    margin-top: 3px;
}

.tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-item {
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
    color: #ccc;
}

/* =========================================================
   HOMEPAGE — CONTACT / FOOTER
   ========================================================= */

.contact-card {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-card h2 {
    font-size: 34px;
    line-height: 1.1;
}

.contact-card p {
    color: var(--muted);
    margin: 12px 0 22px;
}

.contact-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.contact-link {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #ccc;
    text-decoration: none;
    background: rgba(255, 255, 255, .025);
    transition: transform .2s ease, background .2s ease;
}

.contact-link:hover {
    background: rgba(255, 255, 255, .07);
    transform: translateY(-2px);
}

.contact-link strong {
    display: block;
    color: white;
    font-size: 13px;
}

.contact-link span {
    color: #777783;
    font-size: 12px;
}

.site-footer {
    padding: 30px 0 35px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    color: #686873;
    font-size: 12px;
}

.heart {
    color: var(--purple-light);
}

/* =========================================================
   404 PAGE
   ========================================================= */

.error-page {
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 0;
}

.error-page .background::before {
    width: 700px;
    height: 700px;
    top: -300px;
    left: -200px;
    background: radial-gradient(
        circle,
        rgba(139, 92, 246, .18),
        transparent 65%
    );
    filter: none;
    animation: errorFloat1 12s ease-in-out infinite;
}

.error-page .background::after {
    width: 600px;
    height: 600px;
    right: -200px;
    bottom: -250px;
    background: radial-gradient(
        circle,
        rgba(6, 182, 212, .14),
        transparent 65%
    );
    filter: none;
    animation: errorFloat2 14s ease-in-out infinite;
}

@keyframes errorFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(100px, 80px); }
}

@keyframes errorFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-80px, -70px); }
}

.error-card {
    width: min(900px, 90%);
    text-align: center;
    padding: 60px 40px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(255, 255, 255, .055);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow:
        0 30px 100px rgba(0, 0, 0, .45),
        inset 0 1px 0 rgba(255, 255, 255, .05);
    animation: appear .8s ease-out;
    position: relative;
    z-index: 1;
}

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

.error-code {
    font-size: clamp(100px, 20vw, 190px);
    font-weight: 900;
    line-height: .85;
    letter-spacing: -12px;
    margin-right: 12px;
    background: linear-gradient(
        135deg,
        #ffffff 10%,
        #b794ff 45%,
        #67e8f9 90%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 60px rgba(139, 92, 246, .15);
    animation: errorGlow 4s ease-in-out infinite;
}

@keyframes errorGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.error-title {
    margin-top: 30px;
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -1px;
}

.error-description {
    max-width: 520px;
    margin: 15px auto 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.error-buttons {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-footer {
    margin-top: 38px;
    color: #60606c;
    font-size: 12px;
}

.error-planet {
    position: absolute;
    width: 80px;
    height: 80px;
    right: 10%;
    top: 15%;
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 30% 30%,
            #d8b4fe,
            #8b5cf6 45%,
            #312e81 75%,
            #111827
        );
    box-shadow: 0 0 50px rgba(139, 92, 246, .25);
    animation: errorPlanetFloat 7s ease-in-out infinite;
    z-index: 0;
}

.error-planet::after {
    content: "";
    position: absolute;
    width: 125px;
    height: 30px;
    left: -23px;
    top: 25px;
    border: 3px solid rgba(167, 139, 250, .45);
    border-radius: 50%;
    transform: rotate(-18deg);
}

@keyframes errorPlanetFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {
    .nav-links {
        display: none;
    }

    .hero {
        min-height: auto;
        padding-top: 155px;
        padding-bottom: 50px;
        width: 100%;
        overflow: hidden;
    }

    .hero .wrapper {
        width: calc(100% - 32px);
        max-width: none;
        margin: 0 auto;
    }

    .hero-grid {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .hero-grid > div:first-child {
        width: 100%;
        min-width: 0;
        text-align: center;
    }

    .welcome {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .hero h1 {
        font-size: clamp(52px, 15vw, 68px);
        line-height: .95;
        letter-spacing: -4px;
        word-break: normal;
    }

    .hero-description {
        width: 100%;
        max-width: 480px;
        margin: 20px auto 0;
        font-size: 15px;
        line-height: 1.65;
    }

    .hero-buttons {
        justify-content: center;
        margin-top: 25px;
    }

    .socials {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
        height: 300px;
        min-width: 0;
    }

    .planet-system {
        width: 270px;
        height: 270px;
        flex-shrink: 0;
    }

    .orb {
        width: 190px;
        height: 190px;
    }

    .orbit {
        width: 270px;
        height: 80px;
    }

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

    .currently {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-card,
    .contact-card {
        grid-template-columns: 1fr;
    }

    .error-page {
        padding: 20px 0;
        overflow: auto;
    }

    .error-card {
        padding: 45px 22px;
        border-radius: 22px;
    }

    .error-planet {
        width: 45px;
        height: 45px;
        right: 7%;
        top: 8%;
    }

    .error-planet::after {
        width: 75px;
        height: 20px;
        left: -15px;
        top: 13px;
    }
}

@media (max-width: 500px) {
    :root {
        --page-gutter: 28px;
    }

    section {
        padding: 65px 0;
    }

    .hero {
        padding-top: 145px;
    }

    .hero .wrapper {
        width: calc(100% - 28px);
    }

    .hero h1 {
        font-size: clamp(48px, 16vw, 60px);
        letter-spacing: -3px;
    }

    .hero-description {
        font-size: 14px;
        max-width: 340px;
    }

    .hero-visual {
        height: 270px;
    }

    .planet-system {
        width: 250px;
        height: 250px;
    }

    .orb {
        width: 175px;
        height: 175px;
    }

    .orbit {
        width: 250px;
        height: 75px;
    }

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

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

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

    .about-card,
    .contact-card {
        padding: 25px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
    }

    .error-code {
        letter-spacing: -7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
