/* =========================================
   VARIABLES & BASE STYLES
   ========================================= */

html {
    scroll-behavior: smooth;
    /* Smooth transition instead of a jump */

    /* THE FIX: Adjust this to match your header height (approx 70px-80px) */
    /* This ensures the 'About' section doesn't hide behind the navbar */
    scroll-padding-top: 80px;
}

:root {
    /* Colors */
    --bg-gradient: linear-gradient(360deg, #7A6196 0%, #504063 37%, #3C2F4A 69%, #271F30 100%);
    --accent-cyan: #18CCCA;
    --accent-green: #06D6A0;
    --text-primary: #F8FFF4;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.25);
    --input-bg: rgba(255, 255, 255, 0.1);

    /* Magic text colors */
    --purple: #833AB4;
    --violet: #FD1D1D;
    --pink: #FCB045;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    font-family: 'Poppins', sans-serif;
    color: white;
}

/* =========================================
   NAVIGATION BAR
   ========================================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1% 2%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: white;
}

.highlight {
    color: var(--accent-green);
}

.navbar-links {
    margin-right: 7%;
    display: flex;
    gap: 40px;
}

.nav-item {
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: smaller;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: var(--accent-cyan);
}

/* =========================================
   HERO SECTION & HACKER TEXT
   ========================================= */
.hero-text-container {
    margin-left: 15%;
    margin-top: 8%;
    width: fit-content;
}

h1 {
    font-family: 'Poppins', monospace;
    font-weight: 500;
    font-size: 7rem;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
}

.line-two {
    display: flex;
    gap: 30px;
    align-items: center;
}

.your {
    color: var(--accent-cyan);
}

h3 {
    color: var(--text-primary);
    font-weight: 100;
    margin-top: 1%;
    margin-left: 15.7%;
    font-size: 1.5em;
    padding-bottom: 50px;
}

/* =========================================
   GLASS CARD (SIGN IN)
   ========================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 20%;
    height: 50%;
    padding: 30px 20px 0 20px;
    color: white;
    position: absolute;
    top: 55%;
    right: 8%;
    transform: translateY(-50%);
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.glass-card h2 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 30px;
    margin-top: 0%;
    text-align: center;
}

.glass-card h2 span {
    color: #4ed9d9;
}

.input-group {
    margin-right: 20px;
    margin-bottom: 5px;
}

.input-group label {
    padding-top: 5%;
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 10px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.footer-text {
    padding-top: 2%;
    font-size: small;
    text-align: center;
    margin-top: -10px;
}

.footer-text a {
    color: white;
    font-weight: 200;
    text-decoration: underline;
    cursor: pointer;
}

/* =========================================
   TRACKER PILE & SCROLL LOGIC
   ========================================= */
.tracker-pile {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    margin-top: 100px;
}

.tracker-img {
    position: absolute;
    width: 600px;
    height: 400px;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: solid 2px grey;
    left: var(--start-x);
    top: var(--start-y);
    transform: rotate(var(--current-rot, var(--start-rot))) scale(1);
    will-change: transform, left, top, width;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        width 0.4s ease-in-out,
        transform 0.4s ease-in-out;
}

.tracker-img:hover {
    transform: rotate(var(--current-rot, var(--start-rot))) scale(1.1) !important;
}

.tracker-pile.is-stacked .tracker-img {
    --current-rot: 0deg !important;
    top: 0 !important;
    left: 450px !important;
    transition: transform 1s cubic-bezier(0.17, 0.67, 0.83, 0.67), top 1s, left 1s;
}

.tracker-pile.is-stacked .img-mid {
    top: 10px !important;
    left: 460px !important;
}

.tracker-pile.is-stacked .img-back {
    top: 20px !important;
    left: 470px !important;
}

.img-back {
    z-index: 1;
    object-fit: cover;
    object-position: left;
    --start-x: 400px;
    --start-y: -60px;
    --start-rot: 10.62deg;
}

.img-mid {
    z-index: 2;
    object-fit: cover;
    object-position: left;
    --start-x: 300px;
    --start-y: -35px;
    --start-rot: -2.11deg;
}

.img-front {
    z-index: 3;
    object-fit: cover;
    object-position: left;
    --start-x: 200px;
    --start-y: 30px;
    --start-rot: -20.83deg;
}

.shuffling {
    animation: card-pop-vertical 0.6s cubic-bezier(0.8, 0.2, 0.1, 0.8) forwards;
    pointer-events: none;
}

@keyframes card-pop-vertical {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-120%) rotate(-5deg);
    }

    100% {
        transform: translateY(0);
    }
}

.Heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 550;
    font-size: 2rem;
    text-align: left;
    margin-left: 50px;
    margin-top: -570px;
    transition: opacity 0.3s ease-in-out;
}

.Description {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 1.2rem;
    text-align: left;
    margin-left: 50px;
    color: var(--text-primary);
    margin-top: 490px;
    transition: opacity 0.3s ease-in-out;
}

.initial-hidden {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.appear-visible {
    opacity: 1;
}

.title-fade {
    opacity: 0;
}

/* =========================================
   MOUSE TRAILER
   ========================================= */
#trailer {
    height: 30px;
    width: 30px;
    background-color: white;
    border-radius: 50%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

#trailer-icon {
    width: 8px;
    height: 8px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 200ms ease;
    user-select: none;
    -webkit-user-drag: none;
}

body:hover>#trailer {
    opacity: 1;
}

#trailer.Active {
    background-color: var(--accent-green);
}

/* =========================================
   MAGIC TEXT & STARS
   ========================================= */
h4 {
    color: white;
    font-family: "poppins", sans-serif;
    font-size: 1.5em;
    font-weight: 400;
    margin-top: 150px;
    padding: 20px;
    text-align: center;
}

h4>.magic {
    display: inline-block;
    position: relative;
}

h4>.magic>.magic-star {
    --size: clamp(20px, 1.5vw, 30px);
    animation: scale 700ms ease forwards;
    display: block;
    height: var(--size);
    left: var(--star-left);
    position: absolute;
    top: var(--star-top);
    width: var(--size);
}

h4>.magic>.magic-star>svg {
    animation: rotate 1000ms linear infinite;
    display: block;
    opacity: 0.7;
}

h4>.magic>.magic-star>svg>path {
    fill: var(--violet);
}

h4>.magic>.magic-text {
    animation: background-pan 3s linear infinite;
    background: linear-gradient(to right, var(--purple), var(--violet), var(--pink), var(--purple));
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

@keyframes background-pan {
    from {
        background-position: 0% center;
    }

    to {
        background-position: -200% center;
    }
}

@keyframes scale {

    from,
    to {
        transform: scale(0);
    }

    50% {
        transform: scale(1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(180deg);
    }
}

/* =========================================
   RESPONSIVE DESIGN (320px - 480px)
   ========================================= */
@media screen and (max-width: 480px) {
    h1 {
        font-size: 3rem;
    }

    .hero-text-container {
        margin-left: 5%;
        margin-top: 20%;
    }

    h3 {
        margin-left: 5%;
        font-size: 1.1rem;
    }

    .line-two {
        gap: 15px;
    }

    .glass-card {
        width: 85%;
        height: auto;
        position: relative;
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        margin-bottom: 50px;
        padding-bottom: 30px;
    }

    .glass-card:hover {
        transform: translateX(-50%) scale(1.02);
    }

    .tracker-pile {
        margin-top: 50px;
        height: 60vh;
        flex-direction: column;
        align-items: center;
    }

    .tracker-img {
        width: 90%;
        height: auto;
        aspect-ratio: 3/2;
    }

    .Heading,
    .Description {
        margin-left: 20px;
        margin-right: 20px;
    }

    .Heading {
        margin-top: 20px;
        font-size: 1.5rem;
    }

    .Description {
        margin-top: 10px;
        font-size: 1rem;
    }

    .navbar-links {
        gap: 20px;
        margin-right: 5%;
    }

    #trailer {
        display: none;
        /* Hide trailer on touch devices */
    }
}

.button {
    font-size: small;
    font-family: "Poppins";
    margin: 20px auto;

    background-color: #271F30;
    padding: 8px 14px;
    border-radius: 10px;
    width: fit-content;
}