*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #050507;
    --surface: #0a0a10;
    --surface-2: #101018;
    --border: rgba(255, 255, 255, 0.05);
    --border-h: rgba(255, 255, 255, 0.1);
    --text: #e8e8ee;
    --text-2: #7c7c90;
    --text-3: #4a4a5c;
    --purple: #a855f7;
    --purple-d: #7c3aed;
    --gold: #f59e0b;
    --gold-bg: rgba(245, 158, 11, 0.12);
    --glow: rgba(168, 85, 247, 0.15);
    --r: 14px;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* ---- Nav ---- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 5, 7, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.navbar.scrolled { background: rgba(5, 5, 7, 0.92); }

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo { width: 30px; height: 30px; object-fit: contain; }

.nav-brand span {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
    background: var(--purple-d) !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 7px;
    font-weight: 600 !important;
    transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--purple) !important; }

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.burger span {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

.burger.open span:first-child { transform: rotate(45deg) translate(2.5px, 2.5px); }
.burger.open span:last-child { transform: rotate(-45deg) translate(2.5px, -2.5px); }

/* ---- Hero ---- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    z-index: 1;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 140px 28px 100px;
    width: 100%;
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-logo {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
    margin: 0 auto 24px;
    filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.3));
}

.hero-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-bg);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -2px;
    margin-bottom: 20px;
    overflow: visible;
}

.hero h1 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--purple), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 0.2em 0.1em 0;
    display: inline-block;
    transition: opacity 0.4s, transform 0.4s;
}

.hero h1 em.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.hero h1 em.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.hero-inner > p {
    font-size: 1.05rem;
    color: var(--text-2);
    max-width: 440px;
    margin: 0 auto 32px;
}

.hero-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    z-index: 1;
    pointer-events: none;
}

/* ---- Buttons ---- */

.btn-fill {
    display: inline-flex;
    align-items: center;
    padding: 11px 26px;
    background: var(--purple-d);
    color: #fff;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s;
    box-shadow: 0 0 20px var(--glow);
}

.btn-fill:hover {
    background: var(--purple);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(168, 85, 247, 0.3);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 11px 26px;
    background: transparent;
    color: var(--text-2);
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-h);
    transition: all 0.25s;
}

.btn-outline:hover {
    color: var(--text);
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.05);
    transform: translateY(-2px);
}

.btn-lg { padding: 14px 36px; font-size: 0.95rem; }

.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---- Section labels ---- */

.stag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 10px;
}

.clusters h2,
.join h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* ---- Clusters ---- */

.clusters {
    position: relative;
    z-index: 1;
    padding: 40px 0 80px;
}

.clusters-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

.clusters h2 { margin-bottom: 40px; }

.cluster-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cluster-card {
    position: relative;
    display: block;
    height: 180px;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.4s, border-color 0.35s, box-shadow 0.4s;
    opacity: 0;
    transform: translateY(20px);
}

.cluster-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, border-color 0.35s, box-shadow 0.4s;
}

.cluster-card:hover {
    border-color: var(--purple);
    transform: translateY(-3px) scale(1.005);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,85,247,0.08);
}

.cluster-card.flagship { border-color: rgba(245, 158, 11, 0.2); }
.cluster-card.flagship:hover {
    border-color: var(--gold);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(245,158,11,0.08);
}

.card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.cluster-card:hover .card-bg { transform: scale(1.06); }

.card-dim {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5,5,7,0.92) 0%, rgba(5,5,7,0.7) 50%, rgba(5,5,7,0.4) 100%);
}

.card-flag {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #000;
    background: var(--gold);
    padding: 3px 10px;
    border-radius: 5px;
}

.card-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 32px;
}

.card-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(6px);
    padding: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.card-inner h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.card-inner > div:nth-child(2) p {
    font-size: 0.85rem;
    color: var(--text-2);
}

.tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.tags span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.1);
}

.card-arrow {
    margin-left: auto;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.card-arrow svg { width: 18px; height: 18px; color: var(--text-3); transition: color 0.3s; }

.cluster-card:hover .card-arrow {
    background: var(--purple-d);
    border-color: var(--purple-d);
}

.cluster-card:hover .card-arrow svg { color: #fff; }

/* ---- Join ---- */

.join {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 100px 28px;
}

.join-inner { position: relative; z-index: 1; }

.join-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 24px var(--glow));
    animation: drift 4s ease-in-out infinite;
}

.join h2 { margin-bottom: 10px; }
.join p { color: var(--text-2); font-size: 1rem; margin-bottom: 28px; }

/* ---- Footer ---- */

.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
}

.footer-brand img { width: 22px; height: 22px; object-fit: contain; }

.footer-links { display: flex; gap: 18px; }

.footer-links a {
    font-size: 0.78rem;
    color: var(--text-3);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

.footer-copy { font-size: 0.72rem; color: var(--text-3); }

/* ---- Cluster page ---- */

.cluster-hero {
    position: relative;
    height: 380px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.cluster-hero .card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cluster-hero .card-dim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5,5,7,0.3) 0%, rgba(5,5,7,0.95) 100%);
}

.cluster-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px 40px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.cluster-hero-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    padding: 8px;
    border: 1px solid var(--border-h);
}

.cluster-hero-info h1 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.cluster-hero-info p {
    color: var(--text-2);
    font-size: 0.95rem;
}

.cluster-hero-info .tags { margin-top: 8px; }

.cluster-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 28px 80px;
    position: relative;
    z-index: 1;
}

.cluster-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.cluster-nav button {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.cluster-nav button:hover { color: var(--text-2); }

.cluster-nav button.active {
    color: var(--purple);
    border-bottom-color: var(--purple);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.info-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
}

.info-tile h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    margin-bottom: 6px;
}

.info-tile span {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold);
}

.info-tile p {
    font-size: 0.88rem;
    color: var(--text-2);
    margin-top: 4px;
}

.cave-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.cave-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    transition: border-color 0.2s;
}

.cave-item:hover { border-color: var(--border-h); }

.cave-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.cave-item p {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.5;
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text-2);
}

.rules-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--purple);
    margin-top: 7px;
    flex-shrink: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 20px;
    transition: color 0.2s;
    position: relative;
    z-index: 2;
    padding-top: 80px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 28px;
    padding-right: 28px;
}

.back-link:hover { color: var(--text); }

.back-link svg { width: 16px; height: 16px; }

/* ---- Shop ---- */

.shop-page {
    position: relative;
    z-index: 1;
    padding: 100px 0 80px;
}

.shop-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

.shop-desc {
    color: var(--text-2);
    font-size: 0.95rem;
    max-width: 480px;
    margin-bottom: 40px;
}

.shop-inner h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 12px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.shop-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, transform 0.3s;
}

.shop-card:hover {
    border-color: var(--border-h);
    transform: translateY(-3px);
}

.shop-card.featured {
    border-color: rgba(168, 85, 247, 0.25);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.06) 0%, var(--surface) 100%);
}

.shop-card.featured:hover {
    border-color: var(--purple);
}

.shop-card-tag {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 12px;
}

.shop-card.featured .shop-card-tag {
    color: var(--gold);
}

.shop-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.shop-card p {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.shop-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 16px;
}

.shop-price span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-3);
}

.shop-card .btn-fill {
    text-align: center;
    justify-content: center;
    width: 100%;
}

/* ---- Anim ---- */

@keyframes drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Mobile ---- */

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(5, 5, 7, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px 28px;
        gap: 14px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open { display: flex; }
    .nav-cta { width: fit-content; }
    .burger { display: flex; }

    .hero h1 { font-size: 2.4rem; letter-spacing: -1px; }

    .hero-inner { padding: 110px 20px 80px; }

    .clusters-inner { padding: 0 20px; }
    .clusters { padding: 20px 0 60px; }

    .cluster-card { height: 160px; }
    .card-inner { padding: 0 20px; gap: 14px; }
    .card-inner h3 { font-size: 1.1rem; }
    .card-logo { width: 44px; height: 44px; }
    .card-arrow { display: none; }

    .join { padding: 60px 20px; }

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }

    .hero-btns { flex-direction: column; }
    .btn-fill, .btn-outline { justify-content: center; }

    .shop-page { padding: 80px 0 60px; }
    .shop-inner { padding: 0 20px; }
    .shop-grid { grid-template-columns: 1fr; }

    .cluster-hero { height: 280px; }
    .cluster-hero-logo { width: 60px; height: 60px; }
    .cluster-hero-info h1 { font-size: 1.6rem; }
    .cluster-body { padding: 32px 20px 60px; }

    .info-grid { grid-template-columns: 1fr 1fr; }
    .cave-list { grid-template-columns: 1fr; }
}
