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

:root {
    --bg: #0a0a0f;
    --bg-card: #13131a;
    --bg-elevated: #1a1a24;
    --border: #2a2a3a;
    --text: #e8e8f0;
    --text-secondary: #8888a0;
    --accent: #7c5cfc;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --green: #34d399;
    --orange: #fb923c;
    --red: #f87171;
    --radius: 12px;
    --radius-lg: 20px;
}

html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Nav ========== */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
}
.nav-logo-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-xl { padding: 18px 36px; font-size: 18px; border-radius: 14px; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    background: #6a48f0;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-ghost {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}
.btn-sm.btn {
    background: var(--accent);
    color: #fff;
    padding: 7px 18px;
    border-radius: 8px;
}

/* ========== Hero ========== */
.hero {
    padding: 140px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-centered { min-height: calc(100vh - 80px); }
.hero-inner-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}
.hero-inner-centered h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.hero-inner-centered .hero-desc {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0;
}
.hero-pet-stage {
    width: 180px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.hero-inner-centered .hero-actions {
    margin-top: 8px;
}
.hero-inner-centered .download-version {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.preview-stage {
    margin-top: 56px;
    display: flex;
    justify-content: center;
}
.badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 20px;
}
.hero h1 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}
.hero-desc {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 480px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========== Menubar Mockup ========== */
.hero-visual {
    display: flex;
    justify-content: center;
}
.menubar-mockup {
    width: 340px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.menubar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.menubar-dots {
    display: flex;
    gap: 6px;
}
.menubar-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.menubar-dots span:nth-child(1) { background: var(--red); }
.menubar-dots span:nth-child(2) { background: var(--orange); }
.menubar-dots span:nth-child(3) { background: var(--green); }
.menubar-pet-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.menubar-tokens {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Popover */
.popover-mockup {
    display: flex;
    padding: 16px;
    gap: 0;
}
.popover-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.popover-char {
    width: 64px !important;
    height: 64px !important;
}
.popover-divider {
    width: 1px;
    background: var(--border);
    margin: 0 12px;
}
.popover-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 80px;
}
.popover-btn {
    font-size: 11px;
    text-align: center;
    padding: 10px 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    color: var(--text-secondary);
}

/* Speed bar */
.speed-bar {
    display: flex;
    gap: 3px;
    width: 80%;
}
.speed-bar .bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
}
.speed-bar .bar.active { background: var(--green); }
.speed-bar .bar.active:nth-child(4) { background: var(--orange); }
.speed-bar .bar.active:nth-child(5) { background: var(--red); }

/* Popover stats */
.popover-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px;
}
.stat-row {
    display: flex;
    align-items: center;
    font-size: 11px;
    gap: 6px;
}
.stat-icon {
    width: 14px;
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
}
.stat-label {
    color: var(--text-secondary);
}
.stat-value {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ========== Features ========== */
.features {
    padding: 100px 0;
}
.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}
.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 56px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.feature-icon {
    font-size: 28px;
    margin-bottom: 14px;
}
.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== How it works ========== */
.how-it-works {
    padding: 80px 0 100px;
}
.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
}
.step {
    flex: 1;
    max-width: 260px;
    text-align: center;
}
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 20px var(--accent-glow);
}
.step h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}
.step p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.step-arrow {
    font-size: 24px;
    color: var(--text-secondary);
    padding-top: 10px;
}

/* ========== Characters ========== */
.characters {
    padding: 100px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
}
.character-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}
.character-card:hover {
    border-color: var(--accent);
    transform: scale(1.03);
}
.character-stage {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.character-stage .sprite-anim {
    width: 64px;
    height: 64px;
}
.character-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========== Download ========== */
.download {
    padding: 100px 0;
}
.download-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.download-pet {
    margin-bottom: 8px;
}
.download h2 {
    font-size: 36px;
    font-weight: 800;
}
.download p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 8px;
}
.download-version {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== Footer ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.footer a:hover { color: var(--text); }

/* ========== Sprite Animation ========== */
.sprite-anim {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-repeat: no-repeat;
    width: 32px;
    height: 32px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hero { padding: 100px 0 60px; min-height: auto; }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .hero h1 { font-size: 32px; }
    .hero-desc { margin: 0 auto 28px; }
    .hero-actions { justify-content: center; }
    .features-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .steps { flex-direction: column; align-items: center; }
    .step-arrow { transform: rotate(90deg); }
    .character-grid { grid-template-columns: repeat(2, 1fr); }
    .menubar-mockup { width: 300px; }
    .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 768px) {
    .hero-inner-centered h1 { font-size: 34px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 26px; }
    .hero-inner-centered h1 { font-size: 28px; }
    .character-grid { grid-template-columns: repeat(2, 1fr); }
    .section-title { font-size: 28px; }
}
