:root {
    --accent: #00f7ff;
    --dark: #01080e;
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; scroll-behavior: smooth; }
body { background: var(--dark); color: white; overflow-x: hidden; }

/* Snow Canvas */
#snowfall { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Scroll progress bar at the very top */
#scrollProgress {
    position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 9999;
    background: linear-gradient(90deg, rgba(0,247,255,0.9), rgba(78,242,177,0.9));
    transform-origin: left center; transform: scaleX(0); will-change: transform;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: 1s all ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Staggered reveal items inside a container with .staggered */
.staggered > * { opacity: 0; transform: translateY(20px); transition: opacity 420ms ease, transform 420ms ease; }
.staggered > *.visible { opacity: 1; transform: translateY(0); }
.staggered .reveal-item { will-change: transform, opacity; }

/* Header */
header {
    position: fixed; width: 100%; top: 0; z-index: 1000;
    background: rgba(1, 8, 14, 0.8); backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border); padding: 15px 5%;
}
header.scrolled { padding: 8px 5%; background: rgba(1,8,14,0.9); box-shadow: 0 6px 24px rgba(0,0,0,0.45); }
nav { display: flex; justify-content: space-between; align-items: center; }
.nav-coin { width: 40px; height: 40px; border-radius: 50%; }
.logo-group { display: flex; align-items: center; gap: 10px; }
.logo-group .nav-coin { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; transition: width 220ms ease, height 220ms ease; }
header.scrolled .logo-group .nav-coin { width: 30px; height: 30px; }
.brand { font-weight: 800; letter-spacing: 2px; font-size: 1.4rem; text-transform: uppercase; }
.nav-links a { color: #aaa; text-decoration: none; margin-left: 25px; font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }

/* Menu link/button styling (desktop & mobile) */
.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.92);
    background: transparent;
    font-weight: 700;
    letter-spacing: 0.6px;
    border: 1px solid transparent;
    transition: background 180ms ease, color 180ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.nav-links a:hover,
.nav-links a:focus {
    background: rgba(255,255,255,0.03);
    color: var(--accent);
    transform: translateY(-2px);
    outline: none;
}
.nav-links a.active {
    background: linear-gradient(90deg, rgba(0,247,255,0.12), rgba(0,213,255,0.06));
    color: black;
    box-shadow: 0 8px 24px rgba(0,217,255,0.06);
}

/* Mobile nav toggle button */
.nav-toggle { display: none; background: transparent; border: none; color: white; font-size: 1.25rem; cursor: pointer; padding: 8px; border-radius: 8px; }

/* hamburger / toggle visual */
.nav-toggle {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
}
.nav-toggle:focus { outline: 3px solid rgba(0,217,255,0.12); }

/* Desktop: nav links inline */
.nav-links { list-style: none; display: flex; gap: 18px; align-items: center; }

/* Desktop vs Mobile wallet button visibility */
.nav-cta { display: flex; align-items: center; }
.mobile-wallet { display: none; }

@media (max-width: 880px) {
    .nav-toggle { display: inline-flex; }
    /* dropdown style: full-width menu under the header */
    .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: rgba(5,16,24,0.98); flex-direction: column; gap: 6px; padding: 12px 12px; border-radius: 0 0 10px 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); border-top: 1px solid rgba(255,255,255,0.02); z-index: 1200; transform-origin: top; opacity: 0; transform: translateY(-8px); }
    .nav-links.mobile-open { display: flex; opacity: 1; transform: translateY(0); }
    .nav-links li a { margin-left: 0; display: block; padding: 12px 16px; border-radius: 8px; }
    /* show CTA inside dropdown instead of the header */
    .nav-cta { display: none; }
    /* show mobile wallet item inside dropdown */
    .mobile-wallet { display: list-item; }
    .wallet-btn {
        background: linear-gradient(135deg, #00f7ff, #4ce0ff);
        color: #001; border: none; padding: 10px 16px; border-radius: 12px; font-weight: 900; cursor: pointer;
        box-shadow: 0 8px 24px rgba(0,217,255,0.08); transition: transform 140ms ease, box-shadow 140ms ease;
    }
    .wallet-btn:hover, .wallet-btn:focus { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,217,255,0.12); outline: none; }

    /* Animated gradient & connection states for wallet button */
    .wallet-btn {
        position: relative;
        overflow: hidden;
        background-size: 200% 200%;
        animation: gradientShift 6s linear infinite;
    }
    .wallet-btn::after {
        content: '';
        position: absolute; inset: 0; pointer-events: none;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
        mix-blend-mode: overlay;
    }

    @keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

    .wallet-btn.connecting { transform: scale(0.98); box-shadow: 0 6px 18px rgba(0,217,255,0.06); }
    .wallet-btn.connecting::before{
        /* animated spinner dot */
        content: '';
        position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
        width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.95);
        box-shadow: 0 0 8px rgba(255,255,255,0.15);
        animation: connectSpin 0.9s linear infinite;
    }
    .wallet-btn.connecting::after { content: 'Connecting...'; position: absolute; left: 34px; top: 50%; transform: translateY(-50%); color: rgba(0,0,0,0.75); font-weight: 800; }

    @keyframes connectSpin { 0% { transform: translateY(-50%) scale(1); opacity: 1; } 50% { transform: translateY(-50%) scale(0.6); opacity: 0.6; } 100% { transform: translateY(-50%) scale(1); opacity: 1; } }

    .wallet-btn.connected {
        background: linear-gradient(90deg, #4ef2b1, #00f7ff);
        color: #012; box-shadow: 0 18px 48px rgba(0,217,255,0.12);
        animation: pulseGreen 2.6s ease-in-out infinite;
    }
    .wallet-btn.connected .wallet-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #005a40; margin-right: 8px; box-shadow: 0 0 8px rgba(78,242,177,0.6); }

    @keyframes pulseGreen { 0% { box-shadow: 0 12px 30px rgba(0,217,255,0.06); } 50% { box-shadow: 0 22px 50px rgba(0,217,255,0.12); } 100% { box-shadow: 0 12px 30px rgba(0,217,255,0.06); } }

    .wallet-btn .addr-short { font-weight: 800; color: rgba(0,0,0,0.9); }

    /* reduce animation on mobile for perf */
    @media (max-width: 480px) {
        .wallet-btn { animation: none; }
        .wallet-btn.connected { animation: none; }
    }

    /* Mobile dropdown wallet button style */
    .wallet-btn.mobile { width: 100%; text-align: center; padding: 12px 14px; font-size: 1rem; }

    /* ensure nav link children look good on mobile */
    .nav-links li a { width: 100%; }
    .nav-links li.mobile-wallet { padding-top: 8px; }
}

/* Rotating Hero Logo */
.main-rotating-logo {
    width: 260px; height: 260px; border-radius: 50%;
    animation: rotate3d 10s linear infinite;
    box-shadow: 0 0 70px rgba(0, 247, 255, 0.2);
}
@keyframes rotate3d { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

.hero { height: calc(var(--vh, 1vh) * 100 - var(--header-height, 72px)); display: flex; align-items: center; justify-content: center; text-align: center; }
.glow-title { font-size: 5rem; font-weight: 900; background: linear-gradient(white, #666); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tagline span { color: var(--accent); font-weight: 800; }

.buy-now-btn {
    background: var(--accent); color: black; padding: 18px 45px;
    border-radius: 50px; text-decoration: none; font-weight: 800;
    display: inline-block; margin-top: 30px; transition: 0.3s;
}
.buy-now-btn:hover { transform: scale(1.05); box-shadow: 0 0 30px var(--accent); }

/* Vision & Tokenomics */
.vision-section, .token-section, .roadmap-section, .contest-section, .meme-section { padding: 72px 6% 44px; }

.container, .glass-container, .glass-wrap { max-width: 1100px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.vision-grid, .token-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 28px; align-items: start; }
.vision-box { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border: 1px solid var(--border); padding: 28px; border-radius: 18px; margin-top: 18px; }
.vision-card, .t-item { background: var(--glass); border: 1px solid var(--border); padding: 28px; border-radius: 16px; transition: transform 220ms ease, border-color 220ms ease; }
.vision-card:hover { border-color: var(--accent); transform: translateY(-6px); }
.vision-card i { font-size: 28px; color: var(--accent); margin-bottom: 8px; display: inline-block; }
.vision-card h3 { margin-top: 6px; margin-bottom: 8px; font-size: 1.05rem; }
.vision-card p { color: rgba(255,255,255,0.88); line-height: 1.5; }

.token-stats { margin-top: 18px; display: block; }
.token-stats .t-main { font-size: 1.25rem; font-weight: 800; padding: 18px; background: rgba(255,255,255,0.02); border-radius: 12px; display: inline-block; }
.token-stats .t-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 18px; }
.t-bar { background: rgba(255,255,255,0.02); border: 1px solid var(--border); padding: 18px; border-radius: 14px; text-align: center; }
.t-bar span { display: block; font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.t-bar p { margin-top: 8px; color: rgba(255,255,255,0.9); }

/* Infinite Slider (responsive, CSS-vars + JS-driven duration) */
.slider-container { width: 100%; overflow: hidden; padding: 60px 0; }
.slider-track, .slide-track { display: flex; gap: 18px; align-items: center; /* animation set from JS via --scroll-duration */
    animation-name: scrollX; animation-timing-function: linear; animation-iteration-count: infinite; animation-duration: var(--scroll-duration, 30s);
}
.slider-track:hover, .slide-track:hover { animation-play-state: paused; }
.slide { flex: 0 0 auto; width: var(--slide-width, 280px); padding: 8px; transition: transform 220ms cubic-bezier(.2,.9,.2,1), filter 220ms ease, box-shadow 220ms ease; will-change: transform, filter; }
.slide img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); display: block; transform-origin: 50% 50%; }

/* visual focus for center slide */
.slide.focused { box-shadow: 0 14px 40px rgba(0,0,0,0.45), 0 6px 18px rgba(0,247,255,0.06); }
@keyframes scrollX { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Smaller main coin in hero and spin animation */
.main-coin {
    width: 160px;
    height: auto;
    border-radius: 50%;
    animation: rotate3d 8s linear infinite;
    box-shadow: 0 0 40px rgba(0, 247, 255, 0.12);
}
/* allow transform updates for parallax */
.main-coin { will-change: transform; }

/* Roadmap */
.roadmap-container { max-width: 980px; margin: 18px auto 0; display: grid; gap: 18px; }
.roadmap-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); }
.rm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: 0 0 auto; box-shadow: 0 6px 18px rgba(0,247,255,0.06); }
.rm-content h3 { margin: 0 0 6px 0; font-size: 1.05rem; }
.rm-content p { margin: 0; color: rgba(255,255,255,0.9); }
.roadmap-item.active { background: linear-gradient(90deg, rgba(0,247,255,0.03), rgba(0,213,255,0.02)); border-color: rgba(0,217,255,0.06); }

/* Center hero content and style headings */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 8px 16px;
}
.logo-center { display: flex; align-items: center; justify-content: center; }
.brand-lines { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand-small { font-size: 0.95rem; letter-spacing: 1px; color: rgba(255,255,255,0.85); font-weight: 700; }
.glitch-text {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-top: 2px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0.7));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc { max-width: 780px; color: rgba(255,255,255,0.9); font-size: 1.05rem; }

/* Hero buttons layout */
.hero-btns { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 6px; }
.btn-primary { background: var(--accent); color: #001; padding: 10px 18px; border-radius: 999px; font-weight: 800; text-decoration: none; }
.btn-outline { color: white; border: 1px solid rgba(255,255,255,0.06); padding: 10px 16px; border-radius: 999px; text-decoration: none; }

@media (max-width: 880px) {
    .glitch-text { font-size: 2.2rem; }
    .main-coin { width: 120px; }
    .hero-desc { font-size: 0.98rem; }
}

@media (max-width: 480px) {
    .glitch-text { font-size: 1.8rem; }
    .main-coin { width: 96px; }
    .hero-btns { flex-direction: column; gap: 8px; }
    .btn-primary, .btn-outline { width: 100%; display: inline-block; text-align: center; }
}

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; z-index: 2000; align-items: center; justify-content: center; }
.modal-box { background: #050f1a; padding: 40px; border-radius: 30px; text-align: center; width: 90%; max-width: 420px; position: relative; }
.w-btn, .w-item { width: 100%; padding: 12px 14px; margin-top: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--glass); color: white; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; justify-content: flex-start; }
.w-item img { width: 22px; height: 22px; border-radius: 6px; display: inline-block; object-fit: cover; }
.w-item:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

/* Footer centered with icon image */
footer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 6%; background: transparent; color: rgba(255,255,255,0.88); }
.f-logo { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
footer { margin-top: 36px; }
footer p { margin: 0; font-size: 0.95rem; color: rgba(255,255,255,0.75); }

/* small-screen tweaks for footer/icon */
@media (max-width: 480px) {
    .f-logo { width: 52px; height: 52px; }
    footer p { font-size: 0.88rem; }
}

/* Footer logo spin animation */
@keyframes footerSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.f-logo { transform-origin: center center; animation: footerSpin 8s linear infinite; }

/* Honor users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .f-logo { animation: none !important; }
}

/* Make footer-box stretch & center nicely on very small screens */
@media (max-width: 580px) {
    .footer-box { width: calc(100% - 32px); justify-content: center; padding: 10px 14px; }
    .footer-box .f-logo { width: 44px; height: 44px; }
}

/* Footer boxed panel */
.footer-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    max-width: 820px;
}
.footer-box .footer-copy { color: rgba(255,255,255,0.85); }

@media (max-width: 580px) {
    .footer-box { flex-direction: column; gap: 8px; padding: 10px 12px; }
    .footer-box .footer-copy p { text-align: center; font-size: 0.92rem; margin:0; }
}

/* Contest section */
.contest-section .glass-container { padding: 28px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border: 1px solid var(--border); }
.contest-section h2 { margin-bottom: 8px; }
.prize-pool { margin-top: 12px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,0.18); display: inline-block; font-weight: 800; }

/* -------------------- Mobile Responsive Rules -------------------- */
@media (max-width: 880px) {
    /* Header */
    header { padding: 10px 4%; }
    .brand { font-size: 1.05rem; }
    .nav-coin { width: 36px; height: 36px; }

    /* Hero adjustments */
    .hero { height: auto; padding: 70px 18px 40px; }
    .glow-title { font-size: 2.6rem; }
    .hero-desc { font-size: 0.95rem; }
    .main-coin { width: 120px; }

    /* Slider: smaller slides and padding */
    .slider-container, .infinite-slider { padding: 36px 0; }
    :root { --slide-width: 180px; }

    .vision-section, .token-section, .roadmap-section, .contest-section, .meme-section { padding: 40px 5% 28px; }
    .vision-card, .t-item { padding: 18px; }
    .token-stats .t-grid { gap: 12px; }

    /* Mobile menu handled via .mobile-open; ensure CTA remains visible */
    .nav-cta { display: none; }
}

@media (max-width: 480px) {
    /* Tighten spacing on very small screens */
    .brand { font-size: 1rem; }
    .nav-coin { width: 32px; height: 32px; }
    .hero { padding: 60px 12px; }
    .glow-title { font-size: 2.2rem; }
    .hero-desc { font-size: 0.9rem; }
    .main-coin { width: 96px; }

    /* Reduce slide width on tiny screens */
    :root { --slide-width: 150px; }

    /* Modal sizing */
    .modal-box { padding: 20px; max-width: 92%; }

    /* Footer */
    .f-logo { width: 60px; }
}

/* Smooth mobile menu animation */
.nav-links {
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.2,.9,.2,1);
}
.nav-links.mobile-open { opacity: 1; transform: translateY(0); }

/* Ensure images and content never overflow on small screens */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }

/* Tighten main containers for small viewports */
.container, .glass-container, .glass-wrap { padding-left: 16px; padding-right: 16px; }

/* slider clipping guard */
.infinite-slider, .slider-container { overflow: hidden; }

/* Modal responsive tweaks */
.modal-box { width: 92%; max-width: 420px; padding: 28px; }

/* Make nav links stack cleanly on tiny screens */
@media (max-width: 480px) {
    nav { gap: 8px; }
    .nav-links { left: 6px; right: 6px; padding: 8px; }
    .nav-links li a { padding: 10px 12px; border-radius: 10px; }
    .hero { padding: 56px 12px 24px; }
    .slider-track, .slide-track { gap: 12px; }
    :root { --slide-width: 140px; }
}

/* minor utility for swap inputs in modal */
.swap-info { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 12px; font-size: 0.95rem; }
.swap-inputs { display: flex; gap: 8px; flex-direction: column; }
.swap-inputs label { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.swap-inputs input { width: 160px; max-width: 40%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); color: white; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.modal-actions button { padding: 10px 14px; border-radius: 10px; border: 0; cursor: pointer; }
.modal-actions button:first-child { background: transparent; border: 1px solid var(--border); color: white; }

/* ensure body doesn't get extra horizontal space from wide shadows */
* { box-sizing: border-box; }