/* ── Index / Landing Page ── */

/* ── Animations ── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(108,92,231,0.4); }
    50% { box-shadow: 0 4px 40px rgba(108,92,231,0.7), 0 0 60px rgba(108,92,231,0.2); }
}
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes dash {
    to { stroke-dashoffset: -20; }
}

/* ── Hero Section ── */
.hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108,92,231,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-visual {
    margin-bottom: 1.5rem;
    animation: fadeInScale 0.8s ease-out;
}
.hero-visual img {
    width: 220px;
    height: auto;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(108,92,231,0.3));
}

.hero h1 {
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.6rem;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    background: linear-gradient(135deg, #fff 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero .tagline {
    color: #a29bfe;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
    animation: fadeInUp 0.6s ease-out 0.35s both;
}
.hero .description {
    color: #a0a0cc;
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto;
    font-size: 0.95rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.hero-cta {
    margin-top: 1.8rem;
    animation: fadeInUp 0.6s ease-out 0.65s both;
}
.hero-cta .btn-primary {
    animation: pulse-glow 3s ease-in-out infinite;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

/* ── Floating particles behind hero ── */
.hero-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFade 4s ease-in-out infinite;
}
@keyframes particleFade {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 1; transform: translateY(-30px) scale(1); }
}
.particle:nth-child(1) { width: 6px; height: 6px; background: #6C5CE7; top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 4px; height: 4px; background: #E17055; top: 60%; left: 85%; animation-delay: 1s; }
.particle:nth-child(3) { width: 5px; height: 5px; background: #00B894; top: 40%; left: 5%; animation-delay: 2s; }
.particle:nth-child(4) { width: 3px; height: 3px; background: #FDCB6E; top: 15%; left: 90%; animation-delay: 0.5s; }
.particle:nth-child(5) { width: 5px; height: 5px; background: #a29bfe; top: 75%; left: 15%; animation-delay: 1.5s; }
.particle:nth-child(6) { width: 4px; height: 4px; background: #E84393; top: 30%; left: 75%; animation-delay: 2.5s; }

/* ── How It Works ── */
.how-it-works {
    padding: 3rem 0;
    position: relative;
}
.how-it-works h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #eee;
}
.how-it-works .section-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.steps { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.step {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 1.8rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.step::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--step-color, #6C5CE7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.step:hover {
    transform: translateY(-4px);
    border-color: rgba(108,92,231,0.3);
    box-shadow: 0 8px 30px rgba(108,92,231,0.15);
}
.step:hover::before { opacity: 1; }

.step:nth-child(1) { --step-color: #6C5CE7; }
.step:nth-child(2) { --step-color: #00B894; }
.step:nth-child(3) { --step-color: #E17055; }

.step-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}
.step-icon img { width: 100%; height: 100%; }

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(108,92,231,0.15);
    border: 2px solid var(--step-color, rgba(108,92,231,0.4));
    font-size: 0.9rem;
    font-weight: 800;
    color: #a29bfe;
    margin-bottom: 0.8rem;
}
.step:nth-child(2) .step-badge { color: #55efc4; }
.step:nth-child(3) .step-badge { color: #fab1a0; }

.step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step p { color: #a0a0cc; font-size: 0.85rem; line-height: 1.6; }

/* ── Step connector arrows (desktop) ── */
.step-connector {
    display: none;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.2rem;
}

/* ── Card Preview Banner ── */
.card-preview {
    position: relative;
    overflow: hidden;
}
.card-preview-sticky {
    padding: 2.5rem 0;
}
.card-preview::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 300px;
    background: radial-gradient(ellipse, rgba(108,92,231,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.card-preview h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #eee;
}
.card-preview .section-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.preview-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 1rem;
    scrollbar-width: none;
}
.preview-scroll::-webkit-scrollbar { display: none; }

/* Touch devices: enable native horizontal swipe */
@media (pointer: coarse) {
    .preview-scroll {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
}

.preview-card {
    flex: 0 0 220px;
    scroll-snap-align: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.4rem 1.2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}
.preview-card-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}
.preview-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.18);
}
.preview-card-icon { font-size: 2.4rem; margin-bottom: 0.6rem; }
.preview-card-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; color: #f0f0f0; }
.preview-card-cat {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
}
.preview-card-teaser {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.5;
    text-align: left;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.7rem;
    margin-top: 0.2rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding-top 0.4s ease;
    padding-top: 0;
}
.preview-card:focus-within .preview-card-teaser,
.preview-card.active .preview-card-teaser {
    max-height: 80px;
    opacity: 1;
    padding-top: 0.7rem;
}
.preview-card-hint {
    font-size: 0.6rem;
    color: #555;
    margin-top: 0.4rem;
    transition: opacity 0.3s ease;
}
.preview-card:focus-within .preview-card-hint,
.preview-card.active .preview-card-hint {
    opacity: 0;
}

/* ── Scroll progress indicator ── */
.scroll-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
}
.scroll-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: background 0.3s ease, transform 0.3s ease;
}
.scroll-dot.active {
    background: #6C5CE7;
    transform: scale(1.3);
}
.preview-card-badge {
    position: absolute;
    top: 12px; right: 12px;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700; color: #fff;
    opacity: 0.7;
}

/* ── Action Cards ── */
.actions-section { padding: 2.5rem 0; }
.actions-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #eee;
}
.actions-section .section-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.action-cards { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.action-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.action-card:hover {
    border-color: rgba(108,92,231,0.3);
    box-shadow: 0 4px 20px rgba(108,92,231,0.1);
}
.action-card-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.action-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.action-card > p { color: #a0a0cc; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1.2rem; }

.join-form { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.code-input {
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    width: 160px;
    letter-spacing: 3px;
    font-weight: 700;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.code-input::placeholder { color: #555; font-weight: 400; letter-spacing: 1px; font-size: 0.9rem; }
.code-input:focus {
    border-color: #6C5CE7;
    box-shadow: 0 0 20px rgba(108,92,231,0.2);
}

.create-result { margin-top: 1rem; animation: fadeInUp 0.4s ease; }
.success-box {
    background: rgba(0,184,148,0.1);
    border: 1px solid rgba(0,184,148,0.3);
    border-radius: 16px;
    padding: 1.2rem;
}
.code-display { font-size: 2.2rem; font-weight: 800; letter-spacing: 6px; color: #55efc4; margin-bottom: 0.5rem; }
.success-box p { color: #a0a0cc; font-size: 0.85rem; margin-bottom: 0.5rem; }
.error-box {
    background: rgba(225,112,85,0.1);
    border: 1px solid rgba(225,112,85,0.3);
    border-radius: 16px;
    padding: 1.2rem;
}
.error-box p { color: #fab1a0; margin-bottom: 0.3rem; }

/* ── Features Grid ── */
.features { padding: 2.5rem 0 3rem; }
.features h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #eee;
}
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feature {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #a0a0cc;
    line-height: 1.5;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.feature:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.12);
}
.feature-emoji { font-size: 1.8rem; margin-bottom: 0.5rem; }
.feature strong { display: block; color: #ddd; margin-bottom: 0.3rem; font-size: 0.85rem; }

/* ── Responsive ── */
@media (min-width: 600px) {
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 3rem; }
    .hero .tagline { font-size: 1.25rem; }
    .hero-visual img { width: 280px; }

    .steps { grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.8rem; }
    .step-connector { display: flex; }

    .action-cards { grid-template-columns: 1fr 1fr; }
    .feature-grid { grid-template-columns: repeat(4, 1fr); }

    .preview-card { flex: 0 0 240px; }
}

@media (min-width: 900px) {
    .hero h1 { font-size: 3.4rem; }
    .hero-visual img { width: 300px; }
    .hero .description { font-size: 1.05rem; }
}
