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

:root {
    --accent: #FF9C16;
    --accent-glow: rgba(255, 156, 22, 0.3);
    --bg-dark: #1a0e2e;
    --text: #f0e8f8;
    --text-muted: #a89bb8;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.08);
}

html {
    scroll-behavior: smooth;
    background-color: #2E1556;
    background-image: linear-gradient(135deg, #2E1556 0%, #553417 100%);
    background-attachment: fixed;
    min-height: 100%;
}

body {
    font-family: ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: transparent;
    min-height: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.page-wrapper {
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* iOS Safari doesn't support background-attachment: fixed — disable it on mobile */
@media (max-width: 768px), (-webkit-touch-callout: none) {
    html {
        background-attachment: scroll;
    }
}

/* Parallax clouds */
.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
    z-index: 50;
    overflow: visible;
}

.cloud {
    position: absolute;
    width: 220px;
    height: auto;
    will-change: transform;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

@media (max-width: 768px) {
    .cloud {
        width: 140px;
    }
}

/* Floating particles */
.particles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    animation: float linear infinite;
}

@keyframes float {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Hero glow */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -60%);
    background: radial-gradient(circle, rgba(255, 156, 22, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0%   { opacity: 0.6; transform: translate(-50%, -60%) scale(0.9); }
    100% { opacity: 1;   transform: translate(-50%, -60%) scale(1.1); }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(26, 14, 46, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    transition: background 0.3s, padding 0.3s;
}

nav.scrolled {
    background: rgba(26, 14, 46, 0.92);
    padding: 0.6rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-brand span {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* Hero */
.hero {
    position: relative;
    padding: 10rem 2rem 6rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    z-index: 1;
}

.hero-icon {
    width: 180px;
    height: 180px;
    border-radius: 42px;
    box-shadow: 0 8px 40px rgba(255, 156, 22, 0.25), 0 2px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    animation: hero-entrance 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    animation: hero-entrance 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero h1 .accent { color: var(--accent); }

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: hero-entrance 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero .cta-button {
    animation: hero-entrance 1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

@keyframes hero-entrance {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #1a0e2e;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border-radius: 16px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 24px var(--accent-glow);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.cta-button::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: var(--accent);
    z-index: -1;
    animation: cta-pulse 2.5s ease-in-out infinite;
    opacity: 0;
}

@keyframes cta-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 0.3; transform: scale(1.08); }
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.cta-button svg { width: 20px; height: 20px; }

/* Screenshots */
.screenshots {
    padding: 4rem 0;
}

/* Device toggle */
.device-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    gap: 0;
    padding: 0 2rem;
}

.device-btn {
    padding: 0.55rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.device-btn:first-child {
    border-radius: 10px 0 0 10px;
    border-right: none;
}

.device-btn:last-child {
    border-radius: 0 10px 10px 0;
}

.device-btn.active {
    background: var(--accent);
    color: #1a0e2e;
    border-color: var(--accent);
}

.device-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.screenshots-track {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: 0 2rem;
}

.screenshots-track.hidden {
    display: none;
}

.screenshot-card {
    flex: 0 0 auto;
    width: 260px;
    scroll-snap-align: center;
    transition: transform 0.3s;
    cursor: pointer;
}

.screenshot-card.screenshot-ipad {
    width: 340px;
}

.screenshot-card:hover { transform: translateY(-8px); }

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    animation: lightbox-in 0.25s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* Features */
.features {
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.features .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 4rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 156, 22, 0.08);
    border-color: rgba(255, 156, 22, 0.2);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(-4deg);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Rarity Section */
.rarity {
    padding: 6rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.rarity h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.rarity .subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 3rem;
}

.rarity-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.rarity-badge {
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.rarity-badge:hover {
    transform: scale(1.1);
}

.rarity-badge.common { color: #9ca3af; border-color: #9ca3af40; }
.rarity-badge.common:hover { box-shadow: 0 0 20px #9ca3af30; border-color: #9ca3af80; }
.rarity-badge.uncommon { color: #34d399; border-color: #34d39940; }
.rarity-badge.uncommon:hover { box-shadow: 0 0 20px #34d39930; border-color: #34d39980; }
.rarity-badge.rare { color: #60a5fa; border-color: #60a5fa40; }
.rarity-badge.rare:hover { box-shadow: 0 0 20px #60a5fa30; border-color: #60a5fa80; }
.rarity-badge.epic { color: #a78bfa; border-color: #a78bfa40; }
.rarity-badge.epic:hover { box-shadow: 0 0 20px #a78bfa30; border-color: #a78bfa80; }
.rarity-badge.legendary { color: #f97316; border-color: #f9731640; }
.rarity-badge.legendary:hover { box-shadow: 0 0 24px #f9731640; border-color: #f97316; }

/* CTA Section */
.cta-section {
    padding: 6rem 2rem;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.price-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Footer */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--card-border);
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

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

.footer-links a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
    .hero { padding: 8rem 1.5rem 4rem; }
    .hero h1 { font-size: 2.25rem; }
    .hero p { font-size: 1.05rem; }
    .hero-glow { width: 300px; height: 300px; }

    .nav-links { display: none; }

    .screenshot-card {
        width: 220px;
    }

    .screenshot-card.screenshot-ipad {
        width: 280px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }

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

    .features h2, .rarity h2, .cta-section h2 {
        font-size: 2rem;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }

    /* Disable parallax on mobile for performance */
    .parallax {
        transform: none !important;
    }
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Slide from left */
.slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Section content layered above particles */
.features,
.screenshots,
.rarity,
.cta-section,
footer {
    position: relative;
    z-index: 1;
}

/* Parallax elements */
.parallax {
    will-change: transform;
}

/* Section separator glow */
.features::before,
.rarity::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

/* Tilt hover for screenshot cards */
.screenshot-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ff6b00);
    z-index: 200;
    transform-origin: left;
    transform: scaleX(0);
    width: 100%;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .parallax { transform: none !important; }
    .particle { display: none; }
}
