:root {
    --color-primary: #004cd9;
    --color-primary-light: #6d9aed;
    --color-primary-dark: #003399;
    --color-bg: #ffffff;
    --color-bg-alt: #f4f7fc;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-white: #ffffff;
    --color-border: rgba(0, 76, 217, 0.08);
    --color-card-bg: #ffffff;
    --color-header-bg: rgba(255,255,255,0.92);
    --color-header-border: rgba(0,76,217,0.08);
    --color-mobile-menu-bg: rgba(255,255,255,0.97);
    --color-on-primary: #ffffff;
    --color-tab-active-bg: var(--color-primary);
    --color-tab-active-text: var(--color-on-primary);
    --color-tab-inactive-bg: var(--color-bg-alt);
    --color-tab-inactive-text: var(--color-text);
    --color-code-bg: #f1f5f9;
    --color-step-num-bg: var(--color-primary);
    --header-height: 64px;
    --max-width: 1140px;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 76, 217, 0.08);
    --shadow-featured: 0 4px 32px rgba(0, 76, 217, 0.15);
}

[data-theme="dark"] {
    --color-primary: #6d9aed;
    --color-primary-light: #93b5f5;
    --color-primary-dark: #4a7de0;
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-on-primary: #ffffff;
    --color-border: rgba(100, 116, 139, 0.25);
    --color-card-bg: #1e293b;
    --color-header-bg: rgba(15,23,42,0.92);
    --color-header-border: rgba(100,116,139,0.25);
    --color-mobile-menu-bg: rgba(15,23,42,0.97);
    --color-tab-inactive-bg: #334155;
    --color-tab-inactive-text: #cbd5e1;
    --color-code-bg: #334155;
    --color-step-num-bg: var(--color-primary);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-featured: 0 4px 32px rgba(109, 154, 237, 0.2);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--color-primary); }

/* ── Header ── */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-header-border);
    z-index: 1000;
    transition: background 0.3s, border-color 0.3s;
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.header__logo img {
    height: 36px;
    width: 36px;
}

.header__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header__nav {
    display: flex;
    gap: 4px;
}

.header__nav a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.header__nav a:hover,
.header__nav a.active {
    background: rgba(0,76,217,0.08);
    color: var(--color-primary);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s, border-color 0.2s;
    color: var(--color-text);
}

.theme-toggle:hover {
    background: rgba(0,76,217,0.08);
    border-color: var(--color-primary);
}

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: var(--color-mobile-menu-bg);
    backdrop-filter: blur(12px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    gap: 8px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu a:hover { background: rgba(0,76,217,0.08); color: var(--color-primary); }

@media (max-width: 768px) {
    .header__nav { display: none; }
    .theme-toggle { display: none; }
    .burger { display: flex; }
}

/* ── Sections common ── */
.section {
    padding: 100px 24px;
}

.section__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text);
}

.section__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}

.section--alt { background: var(--color-bg-alt); transition: background 0.3s; }

/* ── Hero ── */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
}

.hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero__content { flex: 1; }

.hero__badge {
    display: inline-block;
    background: rgba(0,76,217,0.08);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.hero__title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero__title span { color: var(--color-primary); }

.hero__desc {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 520px;
    margin-bottom: 32px;
}

.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: 0 4px 16px rgba(0,76,217,0.3);
}

.btn--primary:hover { background: var(--color-primary-dark); }

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn--outline:hover { background: rgba(0,76,217,0.06); }

.hero__visual {
    flex: 0 0 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__visual img {
    width: 240px;
    height: 240px;
}

@media (max-width: 768px) {
    .hero__inner { flex-direction: column; text-align: center; gap: 32px; }
    .hero__title { font-size: 2.2rem; }
    .hero__desc { margin-left: auto; margin-right: auto; }
    .hero__actions { justify-content: center; }
    .hero__visual { flex: 0 0 auto; }
    .hero__visual img { width: 160px; height: 160px; }
}

/* ── Features grid ── */
.features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.features-grid > * {
    flex: 0 0 260px;
}

.feature-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow 0.2s, background 0.3s, border-color 0.3s;
}

.feature-card:hover { box-shadow: var(--shadow); }

.feature-card__icon {
    width: 48px; height: 48px;
    background: rgba(0,76,217,0.08);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    font-size: 1.4rem;
}

.feature-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card__text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* ── Instruction tabs ── */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s;
    background: var(--color-tab-inactive-bg);
    color: var(--color-tab-inactive-text);
}

.tabs__btn:hover { opacity: 0.85; }

.tabs__btn.active {
    background: var(--color-tab-active-bg);
    color: var(--color-tab-active-text);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.instruction-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.instruction-step__num {
    flex: 0 0 40px;
    height: 40px;
    background: var(--color-step-num-bg);
    color: var(--color-on-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.instruction-step__content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.instruction-step__content p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.instruction-step__content a {
    color: var(--color-primary);
    font-weight: 500;
}

.instruction-step__content code {
    display: inline-block;
    background: var(--color-code-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    word-break: break-all;
    transition: background 0.3s;
}

/* ── APK Download (instruction section) ── */
.apk-download {
    margin-top: 40px;
    padding: 32px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
}

.apk-download__text {
    font-size: 1.05rem;
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 500;
}

.apk-download__btn {
    display: inline-block;
    transition: transform 0.2s, opacity 0.2s;
}

.apk-download__btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.apk-download__btn img {
    width: 200px;
    height: auto;
}

/* ── Footer APK button ── */
.footer__apk-btn {
    display: inline-block;
    margin-top: 16px;
    transition: transform 0.2s, opacity 0.2s;
}

.footer__apk-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.footer__apk-btn img {
    width: 120px;
    height: auto;
}

/* ── Steps (old, kept for reference) ── */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 640px;
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-item__num {
    flex: 0 0 48px;
    height: 48px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-item__content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-item__content p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* ── Pricing ── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.pricing-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s, background 0.3s, border-color 0.3s;
}

.pricing-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.pricing-card--featured {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-featured);
}

.pricing-card__label {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.pricing-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-card__price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.pricing-card__period {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.pricing-card__features {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
}

.pricing-card__features li {
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.pricing-card__features li::before {
    content: '✓ ';
    color: var(--color-primary);
    font-weight: 700;
}

.pricing-card .btn { width: 100%; }

/* ── Footer ── */
.footer {
    background: var(--color-bg-alt);
    padding: 40px 24px;
    text-align: center;
    transition: background 0.3s;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer__copy {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ── Scroll to top ── */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 76, 217, 0.3);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 900;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top:hover {
    background: var(--color-primary-dark);
}

/* ── Mobile theme toggle in menu ── */
.mobile-theme-toggle {
    margin-top: 24px;
    background: var(--color-tab-inactive-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text);
    font-weight: 500;
}
