/* ─── Neutralize Landing Page ─────────────────────── */

/* ─── Tokens ──────────────────────────────────────── */
:root {
    --bg-color: #0d0d12;
    --bg-gradient: linear-gradient(180deg, #0d0d12 0%, #12111a 50%, #0d0d12 100%);
    --panel-bg: rgba(255, 255, 255, 0.04);
    --panel-bg-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0ab;
    --text-muted: #6b6b78;

    --tile-positive-bg: #b0b0b0;
    --tile-positive-text: #333;
    --tile-negative-bg: #3a3a3a;
    --tile-negative-text: #ccc;
    --tile-neutral-bg: #c4a882;
    --tile-neutral-text: #fff;

    --glow-color: rgba(196, 168, 130, 0.15);
    --glow-strong: rgba(196, 168, 130, 0.25);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --max-width: 900px;
    --section-gap: 3rem;
}

/* ─── Reset ───────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ─── Background Canvas ──────────────────────────── */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── Main Content ───────────────────────────────── */
main {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Hero ────────────────────────────────────────── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    min-height: 90dvh;
    text-align: center;
    position: relative;
    padding: 40px 0;
}

/* Decorative tiles — full-page fixed layer */
.deco-tiles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.deco-tile {
    position: absolute;
    border-radius: 18%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: decoFadeIn 1s ease-out forwards;
    cursor: pointer;
    pointer-events: all;
    filter: brightness(1) drop-shadow(0 0 0px rgba(196, 168, 130, 0.3));
    transition: scale 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.6s ease,
        filter 0.6s ease;
}

@media (hover: hover) {
    .deco-tile:hover {
        scale: 1.2;
        opacity: 1;
        filter: brightness(1.2) drop-shadow(0 0 8px rgba(196, 168, 130, 0.4));
        transition: scale 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
            opacity 0.25s ease,
            filter 0.3s ease;
    }
}

.deco-tile:active,
.deco-tile.deco-touched {
    scale: 1.15;
    opacity: 1;
    filter: brightness(1.3) drop-shadow(0 0 10px rgba(196, 168, 130, 0.5));
    transition: scale 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.15s ease,
        filter 0.15s ease;
}

.deco-tile.deco-spinning {
    opacity: 1;
}

.deco-tile svg {
    width: 55%;
    height: 55%;
}

.deco-tile.tile-pos {
    background: var(--tile-positive-bg);
    color: var(--tile-positive-text);
}

.deco-tile.tile-neg {
    background: var(--tile-negative-bg);
    color: var(--tile-negative-text);
}

.deco-tile.tile-neutral {
    background: var(--tile-neutral-bg);
    color: var(--tile-neutral-text);
}

@keyframes decoFadeIn {
    from {
        opacity: 0;
        transform: scale(0) var(--deco-rotate, rotate(0deg));
    }

    to {
        opacity: var(--deco-opacity, 0.4);
        transform: scale(1) var(--deco-rotate, rotate(0deg));
    }
}

@keyframes decoFloat {

    0%,
    100% {
        transform: translate(0, 0) var(--deco-rotate, rotate(0deg));
    }

    50% {
        transform: translate(var(--float-x, 5px), var(--float-y, -8px)) var(--deco-rotate, rotate(0deg));
    }
}

/* Hero Icon */
.hero-icon {
    width: 120px;
    height: 120px;
    background: var(--tile-neutral-bg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow:
        0 0 60px var(--glow-strong),
        0 0 120px var(--glow-color);
    animation:
        heroScaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        heroBreathe 3.5s ease-in-out 1s infinite;
    cursor: pointer;
    transition: filter 0.5s ease;
    will-change: filter;
    margin-bottom: 2rem;
    -webkit-user-select: none;
    user-select: none;
}

@keyframes heroBreathe {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 50px rgba(196, 168, 130, 0.20),
            0 0 100px rgba(196, 168, 130, 0.08);
    }

    50% {
        transform: scale(1.035);
        box-shadow:
            0 0 70px rgba(196, 168, 130, 0.35),
            0 0 130px rgba(196, 168, 130, 0.14);
    }
}

@media (hover: hover) {
    .hero-icon:hover {
        filter: brightness(1.15);
    }
}

.hero-icon svg {
    width: 55%;
    height: 55%;
}

@keyframes heroScaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.12);
        opacity: 1;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hero Text */
.hero-title {
    font-family: 'Jost', sans-serif;
    font-size: 3.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--tile-neutral-bg);
    margin-bottom: 0.5rem;
    animation: fadeSlideUp 0.8s ease-out 0.3s both;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.8s ease-out 0.5s both;
}

.hero-tagline {
    max-width: 520px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 0.8s ease-out 0.7s both;
}

.tagline-cta {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--tile-neutral-bg);
    font-weight: 500;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Store Badges */
.store-badges {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeSlideUp 0.8s ease-out 0.9s both;
}

.store-badge {
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.store-badge svg {
    height: 48px;
    width: auto;
    display: block;
}

.store-badge:hover {
    transform: scale(1.06);
    filter: brightness(1.15);
}

.store-badge:active {
    transform: scale(0.96);
}

/* ─── Features ────────────────────────────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: var(--section-gap) 0;
}

.feature-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.feature-card:hover {
    background: var(--panel-bg-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 1.2rem;
    color: var(--tile-neutral-bg);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-op {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Screenshots ─────────────────────────────────── */
.screenshots {
    padding: var(--section-gap) 0 2rem;
    text-align: center;
}

.section-title {
    font-family: 'Jost', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--tile-neutral-bg);
    margin-bottom: 2.5rem;
    text-transform: uppercase;
}

.screenshots-track {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem calc(50% - 110px) 2rem;
    scrollbar-width: none;
    cursor: grab;
}

.screenshots-track:active {
    cursor: grabbing;
}

.screenshots-track::-webkit-scrollbar {
    display: none;
}

.screenshot-frame {
    flex: 0 0 auto;
    width: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--border-color);
    scroll-snap-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-frame:hover {
    transform: scale(1.03);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--border-color-hover);
}

.screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── How to Play ─────────────────────────────────── */
.how-to-play {
    padding: 1.5rem 0 var(--section-gap);
    text-align: center;
}

.htp-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.htp-step-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.2rem;
    text-align: center;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.htp-step-card:hover {
    background: var(--panel-bg-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
}

.htp-step-num {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--tile-neutral-bg);
    color: #0d0d12;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.htp-step-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 48px;
}

.htp-step-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: fit-content;
    margin: 0 auto 1rem;
}

.htp-tile {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.htp-tile.mini {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.htp-tile svg {
    width: 55%;
    height: 55%;
}

.tile-pos {
    background: var(--tile-positive-bg);
    color: var(--tile-positive-text);
}

.tile-neg {
    background: var(--tile-negative-bg);
    color: var(--tile-negative-text);
}

.tile-neutral {
    background: var(--tile-neutral-bg);
    color: var(--tile-neutral-text);
}

.htp-arrow,
.htp-op,
.htp-lock {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.htp-step-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.htp-step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ─── Bottom CTA ──────────────────────────────────── */
.bottom-cta {
    padding: 1rem 0 var(--section-gap);
    text-align: center;
}

.cta-text {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--tile-neutral-bg);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.store-badges-bottom {
    animation: none;
}

.discord-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
        transform 0.2s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.discord-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: filter 0.3s ease;
}

@media (hover: hover) {
    .discord-link:hover {
        background: rgba(88, 101, 242, 0.12);
        border-color: rgba(88, 101, 242, 0.4);
        color: #5865F2;
        transform: translateY(-2px) scale(1.04);
        box-shadow: 0 0 20px rgba(88, 101, 242, 0.25), 0 0 40px rgba(88, 101, 242, 0.1);
    }

    .discord-link:hover svg {
        filter: drop-shadow(0 0 6px rgba(88, 101, 242, 0.6));
    }
}

.discord-link:active {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(88, 101, 242, 0.5);
    color: #5865F2;
    transform: scale(0.95);
    box-shadow: 0 0 24px rgba(88, 101, 242, 0.35), 0 0 48px rgba(88, 101, 242, 0.15);
    transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
}

/* Touch devices: use :active for the glow since there's no hover */
@media (hover: none) {
    .discord-link:active {
        background: rgba(88, 101, 242, 0.18);
        border-color: rgba(88, 101, 242, 0.45);
        color: #5865F2;
        transform: scale(0.96);
        box-shadow: 0 0 22px rgba(88, 101, 242, 0.3), 0 0 44px rgba(88, 101, 242, 0.12);
    }

    .discord-link:active svg {
        filter: drop-shadow(0 0 6px rgba(88, 101, 242, 0.6));
    }
}

.htp-lock svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* ─── Footer ──────────────────────────────────────── */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 24px 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--tile-neutral-bg);
}

.footer-dot {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-credit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.footer-credit a {
    color: var(--tile-neutral-bg);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-credit a:hover {
    opacity: 0.8;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Easter Egg: Neutralization Effect ──────────── */
.neutralize-burst {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: burstExpand 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes burstExpand {
    0% {
        width: 8px;
        height: 8px;
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.merge-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: particleFly 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    70% {
        opacity: 0.7;
    }

    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(0);
    }
}

/* Title letter hop */
.letter-hop {
    display: inline-block;
    animation: hopBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hopBounce {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
        color: var(--tile-neutral-bg);
    }

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

/* ─── Scroll Reveal ───────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        max-width: 90vw;
    }

    .hero-icon {
        width: 90px;
        height: 90px;
        border-radius: var(--radius-md);
    }

    .features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .screenshot-frame {
        width: 180px;
    }

    .screenshots-track {
        padding: 1rem calc(50% - 90px) 2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .cta-text {
        font-size: 1.3rem;
    }

    /* Scale down floating tiles on tablet */
    .deco-tile {
        transform: scale(0.8);
    }

    /* Store badges stack on narrow screens */
    .store-badges {
        flex-direction: column;
        gap: 0.75rem;
    }

    .discord-link {
        margin-top: 1rem;
    }

    /* Footer wraps gracefully */
    .footer-links {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 16px;
    }

    .hero {
        padding: 30px 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-icon {
        width: 80px;
        height: 80px;
        border-radius: 16px;
        margin-bottom: 1.5rem;
    }

    .htp-steps {
        grid-template-columns: 1fr;
    }

    .screenshot-frame {
        width: 160px;
    }

    .screenshots-track {
        padding: 1rem calc(50% - 80px) 2rem;
        gap: 1rem;
    }

    .store-badge svg {
        height: 42px;
    }

    .cta-text {
        font-size: 1.1rem;
    }

    /* Scale down and hide some tiles to avoid clutter */
    .deco-tile {
        transform: scale(0.65);
    }

    /* Hide every other mid/bottom tile to reduce visual noise */
    .deco-tile:nth-child(8),
    .deco-tile:nth-child(10),
    .deco-tile:nth-child(14) {
        display: none;
    }

    .discord-link {
        font-size: 0.85rem;
        padding: 0.5rem 1.2rem;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    .htp-step-card {
        padding: 1.5rem 1rem;
    }

    footer {
        padding: 1.5rem 16px 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.4rem;
    }

    .footer-dot {
        display: none;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.9rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .hero-icon {
        width: 70px;
        height: 70px;
        border-radius: 14px;
    }

    .screenshot-frame {
        width: 140px;
    }

    /* Further reduce tiles on very small screens */
    .deco-tile {
        transform: scale(0.5);
    }

    .deco-tile:nth-child(n+10) {
        display: none;
    }
}

/* ─── Reduced Motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}