@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@300;400;600;800&display=swap');

:root {
    --primary: #00b388;
    --accent: #00e5a0;
    --dark: #060a10;
    --deep: #0d1420;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #e2e8f0;
    --dim: #7e8fa6;
    --gold: #ffd86b;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --pad-x: clamp(1rem, 4vw, 2rem);
    --section-y: clamp(4rem, 10vw, 7.5rem);
}

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

/* Links: color / button feedback only — never underline */
a {
    text-decoration: none;
}
a:hover,
a:focus {
    text-decoration: none;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* iOS Safari: body-only overflow-x is ignored — lock both */
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--dark);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
    transition: background-color 0.5s ease;
    min-height: 100%;
}

body.loading { opacity: 0; }
/* Never leave the landing page invisible if JS is slow/fails */
body.loading {
  animation: show-fallback 0.01s linear 0.8s forwards;
}
@keyframes show-fallback { to { opacity: 1; } }
body:not(.loading) { opacity: 1; }

h1, h2, h3 {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: max(var(--pad-x), env(safe-area-inset-left));
    padding-right: max(var(--pad-x), env(safe-area-inset-right));
}

/* --- Background Particles --- */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(1px);
    will-change: transform;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: clamp(4.5rem, 12vh, 6rem) 0 clamp(3rem, 8vh, 5rem);
    /* Clip oversized parallax layer so it can't widen the page */
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    /* Oversized so mouse parallax can shift without exposing edges */
    inset: -10%;
    z-index: -1;
    pointer-events: none;
    background-color: #0a121c;
    /* Drop your art at img/images/hero.webp — cover + center on every viewport */
    background-image:
        linear-gradient(
            to bottom,
            rgba(6, 10, 16, 0.78) 0%,
            rgba(6, 10, 16, 0.55) 42%,
            rgba(6, 10, 16, 0.88) 100%
        ),
        url("../img/images/hero.webp");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.hero-content {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}

.badge-new {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(0, 179, 136, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.45rem, 1.6vw, 0.6rem);
    border-radius: 50px;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
    animation: fadeInDown 0.8s var(--ease-out-expo);
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(1.35rem, 5.5vw, 4.5rem);
    color: #fff;
    margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
    position: relative;
    letter-spacing: -0.02em;
}

.hero .highlight { color: var(--primary); }

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--dark);
    overflow: hidden;
    pointer-events: none;
}

.glitch::before {
    left: 2px; text-shadow: -2px 0 #ff00c1;
    clip-path: inset(35% 0 40% 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px; text-shadow: -2px 0 #00fff9;
    clip-path: inset(55% 0 20% 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.hero p {
    font-size: clamp(0.95rem, 2.1vw, 1.35rem);
    color: var(--dim);
    max-width: 42rem;
    margin: 0 auto clamp(1.75rem, 4vw, 3rem);
    padding: 0 0.25rem;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(12px, 2.5vw, 20px);
    justify-content: center;
    align-items: center;
}

.cta-btn {
    font-family: 'Press Start 2P', cursive;
    padding: clamp(14px, 2.2vw, 18px) clamp(18px, 3vw, 32px);
    font-size: clamp(0.62rem, 1.8vw, 0.85rem);
    text-decoration: none;
    border-radius: 4px;
    transition: transform 0.3s var(--ease-out-expo), background 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: inline-block;
    line-height: 1.3;
    text-align: center;
}

.cta-btn.primary {
    background: var(--primary);
    color: #060a10;
    box-shadow: 0 8px 0 #007a5c;
}

.cta-btn.secondary {
    background: transparent;
    color: #fff;
    border: 1px solid var(--glass-border);
}

.cta-btn:hover { transform: translateY(-3px); }
.cta-btn.primary:hover { background: var(--accent); box-shadow: 0 12px 20px rgba(0, 179, 136, 0.4); }
.cta-btn.secondary:hover { background: var(--glass); border-color: var(--primary); }

@media (hover: none) {
    .cta-btn:hover { transform: none; }
    .cta-btn.primary:hover { background: var(--primary); box-shadow: 0 8px 0 #007a5c; }
    .card.glass:hover { transform: none; background: var(--glass); border-color: var(--glass-border); }
}

/* --- Feature Sections --- */
section {
    padding: var(--section-y) 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
section.visible { opacity: 1; transform: translateY(0); }
section.hero.visible { transform: none; }

.feature-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.feature-wrapper.reverse .feature-text { order: 2; }
.feature-wrapper.reverse .feature-visual { order: 1; }

.feat-tag {
    font-family: 'Press Start 2P', cursive;
    color: var(--primary);
    font-size: clamp(0.55rem, 1.5vw, 0.7rem);
    margin-bottom: 1rem;
}

.feature-text h2 {
    font-size: clamp(1.15rem, 3.2vw, 2rem);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.feature-text .highlight { color: var(--primary); }

.feature-text p {
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    color: var(--dim);
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.feat-list { list-style: none; }
.feat-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
    color: var(--text);
    align-items: flex-start;
    text-align: left;
}

.feat-list .check {
    color: var(--primary);
    font-family: 'Press Start 2P', cursive;
    flex: 0 0 auto;
    line-height: 1.6;
}

.feature-visual {
    position: relative;
    border-radius: clamp(14px, 2vw, 24px);
    background: var(--deep);
    padding: clamp(10px, 1.5vw, 15px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* contain .visual-glow inset bleed */
}

.feature-visual img {
    width: 100%;
    border-radius: clamp(10px, 1.5vw, 15px);
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #121a26;
}

.visual-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at center, var(--primary), transparent 70%);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.visual-caption {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.48rem, 1.4vw, 0.6rem);
    color: var(--dim);
    margin-top: 15px;
    line-height: 1.5;
    padding: 0 0.5rem;
}

.floating { animation: float 6s ease-in-out infinite; }

/* --- Capabilities Grid --- */
.sec-header {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 3.75rem);
}
.sec-header h2 {
    font-size: clamp(1.15rem, 3.2vw, 2rem);
    margin-bottom: 1rem;
}
.sec-header p {
    color: var(--dim);
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    max-width: 36rem;
    margin: 0 auto;
}

.highlight-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(16px, 2.5vw, 30px);
}

.card.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: clamp(1.25rem, 2.5vw, 2.5rem);
    border-radius: clamp(14px, 2vw, 20px);
    transition: transform 0.4s var(--ease-out-expo), border-color 0.4s, background 0.4s;
}

.card.glass:hover {
    border-color: var(--primary);
    transform: translateY(-10px) scale(1.02);
    background: rgba(0, 179, 136, 0.05);
}

.card-icon { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 1.25rem; }
.card h3 {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    margin-bottom: 0.85rem;
    color: var(--gold);
}
.card p {
    color: var(--dim);
    font-size: clamp(0.88rem, 1.4vw, 0.95rem);
}

/* --- Final CTA --- */
.final-cta {
    text-align: center;
    padding: clamp(4rem, 12vw, 9.5rem) 0;
}
.cta-glass {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2.5rem);
    border-radius: clamp(20px, 4vw, 40px);
}
.cta-glass h2 {
    font-size: clamp(1.15rem, 3.2vw, 2rem);
    margin-bottom: 1rem;
}
.cta-glass p {
    color: var(--dim);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    max-width: 32rem;
    margin: 0 auto 1.75rem;
}

/* --- Footer --- */
.page-foot {
    padding: clamp(1.75rem, 4vw, 2.5rem) 0 calc(2.5rem + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--dim);
    font-size: clamp(0.72rem, 1.5vw, 0.8rem);
}
.page-foot p {
    max-width: 40rem;
    margin: 0 auto 0.85rem;
    line-height: 1.7;
}
.page-foot .foot-link {
  font-size: inherit;
  vertical-align: baseline;
}
.page-foot p .footer-sep {
    margin: 0 0.45em;
    color: #3d4d63;
}
.legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
/* Plain hyperlinks — not buttons */
a.foot-link,
.foot-link {
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    color: #8ba0b8;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    display: inline;
}
a.foot-link:hover,
.foot-link:hover { color: var(--accent); }
.foot-sep { color: #3d4d63; }

/* --- Cookie banner + legal modal (landing only for Terms links; banner mirrors shell) --- */
.cookie-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 14px max(16px, env(safe-area-inset-left)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
    background: rgba(10, 18, 28, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.cookie-bar[hidden] { display: none !important; }
.cookie-msg {
    margin: 0;
    color: #c7d3e4;
    font-size: 0.86rem;
    line-height: 1.5;
    max-width: 760px;
}
.cookie-link {
    background: none !important;
    border: 0 !important;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.86rem;
    padding: 0;
    font-family: inherit;
    display: inline;
}
.cookie-link:hover { color: #6ff2cf; }
.cookie-ok {
    background: var(--primary);
    color: #03150f;
    border: 0;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 18px;
    font: 700 0.85rem/1 Inter, system-ui, sans-serif;
    white-space: nowrap;
}
.cookie-ok:hover { filter: brightness(1.12); }

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
}
.legal-modal[hidden] { display: none !important; }
.legal-modal:not([hidden]) { display: flex; }
.legal-box {
    background: #0e1723;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    width: min(720px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.legal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #1b2636;
}
.legal-head h2 {
    margin: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.72rem;
    color: #eaf2fb;
    line-height: 1.4;
    text-transform: none;
}
.legal-close {
    background: none;
    border: 0;
    color: #9fb0c4;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    line-height: 1;
}
.legal-close:hover { color: #fff; }
.legal-body {
    padding: 18px 20px;
    overflow: auto;
    color: #c7d3e4;
    line-height: 1.65;
    font-size: 0.95rem;
    font-family: Inter, system-ui, sans-serif;
}
.legal-body h2 { font-size: 1.2rem; color: #eaf2fb; margin: 0 0 12px; font-family: Inter, system-ui, sans-serif; text-transform: none; }
.legal-body h3 { font-size: 1rem; color: #eaf2fb; margin: 18px 0 6px; font-family: Inter, system-ui, sans-serif; text-transform: none; }
.legal-body p { margin: 0 0 12px; }
.legal-body a { color: var(--accent); }
.legal-body ul, .legal-body ol { margin: 0 0 12px; padding-left: 22px; }
.legal-loading { color: #8fa2b8; }

@media (max-width: 560px) {
    .cookie-msg { font-size: 0.82rem; }
    .cookie-bar { flex-direction: column; align-items: stretch; }
    .cookie-ok { width: 100%; }
}

/* --- Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glitch-anim {
    0% { clip-path: inset(10% 0 75% 0); }
    20% { clip-path: inset(55% 0 20% 0); }
    40% { clip-path: inset(25% 0 50% 0); }
    60% { clip-path: inset(70% 0 5% 0); }
    80% { clip-path: inset(8% 0 70% 0); }
    100% { clip-path: inset(40% 0 35% 0); }
}

@keyframes glitch-anim2 {
    0% { clip-path: inset(25% 0 50% 0); }
    20% { clip-path: inset(8% 0 75% 0); }
    40% { clip-path: inset(60% 0 15% 0); }
    60% { clip-path: inset(35% 0 40% 0); }
    80% { clip-path: inset(15% 0 60% 0); }
    100% { clip-path: inset(50% 0 25% 0); }
}

/* ========== Responsive breakpoints ========== */

/* Large tablet / small laptop */
@media (max-width: 1100px) {
    .highlight-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet — stack feature rows before columns get cramped */
@media (max-width: 900px) {
    .feature-wrapper {
        grid-template-columns: 1fr;
        gap: clamp(1.75rem, 4vw, 2.5rem);
        text-align: center;
    }

    .feature-wrapper.reverse .feature-text,
    .feature-wrapper.reverse .feature-visual,
    .feature-wrapper .feature-text,
    .feature-wrapper .feature-visual {
        order: initial;
    }

    /* Visual after copy on mobile/tablet for reading flow */
    .feature-wrapper .feature-text { order: 1; }
    .feature-wrapper .feature-visual { order: 2; }

    .feat-list {
        display: inline-flex;
        flex-direction: column;
        align-items: stretch;
        max-width: 34rem;
        width: 100%;
        margin: 0 auto;
        text-align: left;
    }

    .feature-visual {
        max-width: 560px;
        margin: 0 auto;
    }

    .floating { animation-duration: 8s; }
}

/* Phone / large phone */
@media (max-width: 640px) {
    .hero {
        min-height: auto;
        padding-top: clamp(5rem, 18vw, 6.5rem);
        padding-bottom: clamp(3rem, 10vw, 4rem);
    }

    /* No desktop parallax on phones — keep bg flush so nothing sticks out */
    .parallax-bg {
        inset: 0;
        transform: none !important;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        max-width: 22rem;
        margin: 0 auto;
    }

    .cta-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .cta-btn.primary { box-shadow: 0 6px 0 #007a5c; }

    .highlight-cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .footer-sep {
        /* Hide only the pipe characters on narrow screens — never the Credits link */
        display: none;
    }

    .page-foot p {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }

    .floating { animation: none; } /* quieter on small screens */

    .visual-glow {
        inset: 0; /* no side bleed on narrow screens */
    }

    .cta-glass {
        /* Avoid rare 96vw + padding overflow on small devices */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Narrow phones — keep pixel titles readable */
@media (max-width: 400px) {
    .hero h1 { font-size: clamp(1.1rem, 9vw, 1.45rem); }
    .feature-text h2,
    .sec-header h2,
    .cta-glass h2 { font-size: 1.05rem; }
    .badge-new { font-size: 0.42rem; padding: 5px 10px; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .floating,
    .glitch::before,
    .glitch::after,
    .badge-new,
    .particle {
        animation: none !important;
    }
    section {
        opacity: 1;
        transform: none;
        transition: none;
    }
    body.loading { opacity: 1; animation: none; }
}
