/* ===================================================================
   LANDING PAGE STYLES
   Terminal HUD Aesthetic
   =================================================================== */

body {
    background-color: #050505;
    color: #e5e2e1;
    overflow-x: hidden;
    cursor: none;
    scrollbar-width:auto;
    scrollbar-color: #00FF41 #0a0a0a;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #00FF41; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,65,0.6); }
a, button, input, select, textarea, label, [role="button"], .gallery-nav, .scroll-indicator {
    cursor: none;
}
.bg-scanlines {
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
}
#dot-grid {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -1;
}
.infinite-grid { perspective: 1000px; overflow: hidden; }
.grid-plane {
    position: absolute;
    width: 300%; height: 300%;
    top: -50%; left: -100%;
    background-image:
        linear-gradient(to right, rgba(0, 255, 65, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(65deg) translateY(-20%);
    animation: grid-move 10s linear infinite;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
}
@keyframes grid-move {
    0%   { transform: rotateX(65deg) translateY(0); }
    100% { transform: rotateX(65deg) translateY(60px); }
}
.glow-sm    { box-shadow: 0 0 15px rgba(0, 255, 65, 0.4); }
.bloom-text { text-shadow: 0 0 12px rgba(0, 255, 65, 0.5); }
.hud-border { border: 1px solid rgba(0, 255, 65, 0.15); position: relative; }
.hud-bracket-tl { border-top: 2px solid #00FF41; border-left: 2px solid #00FF41; width: 12px; height: 12px; position: absolute; top: 0; left: 0; z-index: 10; pointer-events: none; }
.hud-bracket-tr { border-top: 2px solid #00FF41; border-right: 2px solid #00FF41; width: 12px; height: 12px; position: absolute; top: 0; right: 0; z-index: 10; pointer-events: none; }
.hud-bracket-bl { border-bottom: 2px solid #00FF41; border-left: 2px solid #00FF41; width: 12px; height: 12px; position: absolute; bottom: 0; left: 0; z-index: 10; pointer-events: none; }
.hud-bracket-br { border-bottom: 2px solid #00FF41; border-right: 2px solid #00FF41; width: 12px; height: 12px; position: absolute; bottom: 0; right: 0; z-index: 10; pointer-events: none; }
.ticker-scroll { animation: ticker 40s linear infinite; }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
#scroll-progress {
    position: fixed; top: 0; left: 0;
    width: 0%; height: 3px;
    background: #00FF41; z-index: 100;
    box-shadow: 0 0 10px #00FF41;
    transition: width 0.1s ease-out;
}
.data-panel {
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 65, 0.15);
}
#custom-cursor {
    width: 40px; height: 40px;
    pointer-events: none; position: fixed;
    z-index: 9999; mix-blend-mode: screen;
    transition: transform 0.15s ease-out, filter 0.15s ease-out;
}
#custom-cursor.cursor-active {
    transform: scale(1.5) rotate(45deg);
    filter: drop-shadow(0 0 8px #00FF41) drop-shadow(0 0 16px rgba(0,255,65,0.4));
}
/* Solid ring on hover — target locked */
#custom-cursor.cursor-active svg circle:last-of-type {
    stroke-dasharray: none;
    stroke-width: 1;
    opacity: 1;
}
.particle {
    position: absolute;
    background: #00FF41;
    width: 4px; height: 4px;
    border-radius: 1px;
    pointer-events: none; opacity: 0.8;
    box-shadow: 0 0 6px #00FF41;
}
.terminal-cursor {
    display: inline-block;
    width: 10px; height: 1.2em;
    background: #00FF41;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}
@keyframes blink {
    0%, 50%  { opacity: 1; }
    51%, 100%{ opacity: 0; }
}
.scroll-indicator {
    position: absolute; bottom: 3rem; left: 50%;
    transform: translateX(-50%);
    text-align: center; cursor: pointer; z-index: 20;
}

/* === GALLERY === */
.gallery-section {
    display: flex; flex-direction: column;
    justify-content: center;
    padding: 3rem 2rem; background: #050505; position: relative;
}
.gallery-container {
    max-width: 100%; margin: 0 auto;
    position: relative; width: 100%;
    display: flex; justify-content: center;
    padding: 1.5rem 0 3rem;
}
.gallery-wrapper {
    overflow: hidden; padding: 1rem 0;
    width: 100%; position: relative;
}
.gallery-wrapper::before, .gallery-wrapper::after {
    content: ''; position: absolute;
    top: 0; bottom: 0; width: 200px;
    z-index: 10; pointer-events: none;
}
.gallery-wrapper::before { left: 0; background: linear-gradient(to right, #050505 0%, transparent 100%); }
.gallery-wrapper::after  { right: 0; background: linear-gradient(to left,  #050505 0%, transparent 100%); }
.gallery-track {
    display: flex; gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-item {
    width: 50vw; aspect-ratio: 16 / 10.5; height: auto; flex-shrink: 0;
    position: relative; overflow: hidden;
    border: 1px solid rgba(0, 255, 65, 0.2);
    transition: all 0.4s ease;
}
.gallery-item:hover { border-color: #00FF41; box-shadow: 0 0 40px rgba(0, 255, 65, 0.15); }
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    filter: grayscale(0.4); transition: filter 0.7s ease;
}
.gallery-item:hover img { filter: grayscale(0); }
.gallery-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 2.5rem;
    display: flex; flex-direction: column; align-items: center;
}
.gallery-caption span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem; font-weight: 900; color: #00FF41;
    text-shadow: 0 0 10px rgba(0,255,65,0.5);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem;
}
.gallery-caption p {
    color: rgba(185,204,178,0.8); text-align: center;
    font-size: 0.9rem; font-family: 'IBM Plex Mono', monospace; margin: 0;
}
.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 20; background: rgba(0,0,0,0.8);
    border: 1px solid rgba(0,255,65,0.3); color: #00FF41;
    font-size: 3rem; width: 60px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s;
    font-family: 'IBM Plex Mono', monospace;
}
.gallery-nav:hover { background: rgba(0,255,65,0.1); border-color: #00FF41; box-shadow: 0 0 20px rgba(0,255,65,0.3); }
.gallery-nav-left  { left:  1rem; }
.gallery-nav-right { right: 1rem; }

/* Mobile: disable carousel, switch to vertical scroll */
@media (max-width: 767px) {
    .gallery-container {
        padding-bottom: 1.5rem;
    }
    .gallery-wrapper {
        overflow: visible;
    }
    .gallery-wrapper::before,
    .gallery-wrapper::after {
        display: none;
    }
    .gallery-track {
        flex-direction: column;
        transform: none !important;
        gap: 3rem; /* extra gap accounts for the title label above each item */
        padding: 0 1.25rem;
    }

    /* Items fill the available width on mobile */
    .gallery-item {
        width: 100%;
    }
    .gallery-nav {
        display: none;
    }
    .gallery-item.gallery-clone {
        display: none;
    }

    /* Title above image as a box label */
    .gallery-item {
        overflow: visible;
        margin-top: 2.25rem; /* space for the title label that floats above */
    }

    /* Extend caption to full image height so top:0 anchors at image top */
    .gallery-caption {
        top: 0;
        bottom: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 35%, transparent 65%);
        justify-content: flex-end;
        padding: 1rem 1.25rem;
    }

    /* Pull the title span above the image */
    .gallery-caption span {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        transform: translateY(calc(-100% - 0.4rem));
        background: #00FF41;
        border: none;
        padding: 0.45rem 0.75rem;
        font-size: 0.65rem;
        letter-spacing: 0.15em;
        color: #050505;
        text-align: left;
        text-shadow: none;
        margin-bottom: 0;
    }

    /* Description stays inside image at bottom, smaller */
    .gallery-caption p {
        font-size: 0.72rem;
        text-align: center;
        margin: 0;
    }
}

/* === TOAST === */
.toast {
    position: fixed; bottom: 2rem; right: 2rem;
    padding: 1rem 1.5rem;
    background: #131313; border: 1px solid rgba(0,255,65,0.3);
    color: #00FF41; font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem; z-index: 1000;
    transform: translateX(120%); transition: transform 0.3s ease;
    text-transform: uppercase; letter-spacing: 0.1em; max-width: 380px;
}
.toast.show { transform: translateX(0); }
.toast.toast-error { border-color: rgba(255,100,100,0.4); color: #ff6b6b; }

/* === REVEAL === */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.30s; }

/* === MISC === */
select option { background: #131313; color: #00FF41; }

/* === RESPONSIVE HEADING SIZES: fluid clamp to prevent overflow === */

/* "Why StonkPro?" h2: text-5xl Orbitron too wide on narrow phones */
.font-body.about-container h2 {
    font-size: clamp(1.5rem, 8vw, 3rem);
}

/* Signup JOIN_THE_BETA h2: tighter clamp to fit on narrowest phones */
#signup h2 {
    font-size: clamp(1.25rem, 7.5vw, 4.5rem);
    overflow-wrap: break-word;
}

/* Gallery section heading: tracking-[0.6em] causes overflow on mobile */
@media (max-width: 767px) {
    .gallery-section h2 {
        font-size: 0.95rem;
        letter-spacing: 0.15em;
    }

    /* Hero badge: long wide-tracked string overflows narrow viewports */
    .infinite-grid .animate-pulse {
        letter-spacing: 0.12em;
        white-space: normal;
    }
}

@media (max-width: 479px) {
    .gallery-section h2 {
        font-size: 0.8rem;
        letter-spacing: 0.1em;
    }
}

/* System_Approach section heading: tracking-[0.4em] + w-32 rule overflows on mobile */
@media (max-width: 640px) {
    #approach h2 {
        font-size: 1.1rem;
        letter-spacing: 0.15em;
    }
    /* hide the decorative rule on mobile so the h2 has room */
    #approach .flex.items-center > div {
        display: none;
    }
}

/* Beta submit button: reduce tracking on very small screens so text fits */
@media (max-width: 479px) {
    #beta-queue-btn {
        letter-spacing: 0.05em;
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.75rem;
    }
}

/* Touch devices: disable custom cursor, restore native pointer */
@media (hover: none) and (pointer: coarse) {
    body, a, button, input, select, textarea, label, [role="button"],
    .gallery-nav, .scroll-indicator {
        cursor: auto !important;
    }
    #custom-cursor {
        display: none !important;
    }
}
