/**
 * Fastmate Landing Page CSS
 * Dark theme with episode showcase, carousel, genre filter
 */

/* ================================================
   CSS VARIABLES
   ================================================ */
:root {
    --landing-bg: #121212;
    --landing-surface: #1E1E1E;
    --landing-surface-hover: #2A2A2A;
    --landing-primary: #FF4D6A;
    --landing-primary-end: #FF8A65;
    --landing-accent: #10a37f;
    --landing-accent-dark: #0d8a6a;
    --landing-text: #FFFFFF;
    --landing-text-secondary: #B0B0B0;
    --landing-text-muted: #787878;
    --landing-tag-bg: rgba(255, 77, 106, 0.15);
    --landing-tag-text: #FF4D6A;
    --landing-border: rgba(255, 255, 255, 0.08);
    --landing-max-width: 480px;
}

/* ================================================
   RESET & BASE
   ================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--landing-bg);
    color: var(--landing-text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   STICKY HEADER (48px)
   ================================================ */
.landing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--landing-border);
    max-width: var(--landing-max-width);
    width: 100%;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.header-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.header-logo span {
    font-size: 15px;
    font-weight: 700;
    color: var(--landing-text);
    letter-spacing: -0.3px;
}

/* ================================================
   MAIN CONTAINER
   ================================================ */
.landing-main {
    max-width: var(--landing-max-width);
    width: 100%;
    margin: 0 auto;
}

/* ================================================
   HERO CAROUSEL
   ================================================ */
.hero-carousel {
    position: relative;
    width: calc(100% - 32px);
    margin: 12px 16px 0;
    aspect-ratio: 3 / 4;
    max-height: 360px;
    overflow: hidden;
    border-radius: 16px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(18, 18, 18, 0.5) 65%,
        rgba(18, 18, 18, 0.9) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 20px 24px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.hero-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--landing-tag-text);
    background: var(--landing-tag-bg);
    padding: 3px 8px;
    border-radius: 4px;
}

.hero-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--landing-text);
    line-height: 1.2;
    margin-bottom: 6px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin-bottom: 4px;
}

.hero-npc {
    font-size: 12px;
    color: var(--landing-text-secondary);
}

/* Carousel Dots */
.hero-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 4px;
}

.hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--landing-text-muted);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.hero-dot.active {
    width: 18px;
    border-radius: 3px;
    background: var(--landing-primary);
}

/* ================================================
   APP INSTALL CTA (after hero)
   ================================================ */
.app-cta {
    padding: 16px 16px 8px;
}

.app-cta-text {
    display: none;
}

.app-cta-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 12px 10px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.15s, opacity 0.15s;
}

.cta-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.cta-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cta-ios {
    background: #FFFFFF;
    color: #000000;
    border: none;
}

.cta-android {
    background: var(--landing-accent);
    color: #FFFFFF;
    border: none;
}

/* ================================================
   GENRE FILTER CHIPS
   ================================================ */
.genre-filter {
    padding: 20px 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.genre-filter-inner {
    display: inline-flex;
    gap: 8px;
    padding: 0 16px;
}

.genre-filter::-webkit-scrollbar {
    display: none;
}

.genre-chip {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--landing-text-secondary);
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.genre-chip.active {
    color: var(--landing-bg);
    background: var(--landing-text);
    border-color: var(--landing-text);
}

/* ================================================
   EPISODE GRID
   ================================================ */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 8px 16px 20px;
}

.episode-card {
    background: var(--landing-surface);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.episode-card:active {
    transform: scale(0.97);
}

.episode-card-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #2a2a2a;
    display: block;
}

.episode-card-info {
    padding: 10px 10px 12px;
}

.episode-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--landing-text);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.episode-card-tag {
    font-size: 10px;
    font-weight: 500;
    color: var(--landing-tag-text);
    background: var(--landing-tag-bg);
    padding: 2px 6px;
    border-radius: 3px;
}

.episode-card-desc {
    font-size: 12px;
    color: var(--landing-text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-card-npc {
    font-size: 11px;
    color: var(--landing-text-muted);
    margin-top: 4px;
}

.episode-card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 6px;
}

.badge-free {
    color: var(--landing-accent);
    background: rgba(16, 163, 127, 0.15);
}

.badge-paid {
    color: var(--landing-primary);
    background: var(--landing-tag-bg);
}

/* More Button */
.episode-more {
    display: flex;
    justify-content: center;
    padding: 0 16px 24px;
}

.episode-more-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--landing-text-secondary);
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    cursor: pointer;
    transition: background 0.2s;
}

.episode-more-btn:active {
    background: var(--landing-surface-hover);
}

/* ================================================
   FEATURES SECTION
   ================================================ */
.landing-features {
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-features-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--landing-text);
    margin-bottom: 4px;
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--landing-surface);
    border-radius: 14px;
    padding: 18px 16px;
}

.feature-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: var(--landing-tag-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--landing-primary);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--landing-text);
    margin-bottom: 3px;
}

.feature-text p {
    font-size: 13px;
    color: var(--landing-text-secondary);
    line-height: 1.45;
}

/* ================================================
   HERO TITLE & DESC (SEO)
   ================================================ */
.hero-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--landing-text);
    text-align: center;
    padding: 20px 16px 4px;
    line-height: 1.3;
}
.hero-desc {
    font-size: 13px;
    color: var(--landing-text-secondary);
    text-align: center;
    padding: 0 16px 12px;
    line-height: 1.5;
}

/* ================================================
   FAQ SECTION
   ================================================ */
.landing-faq {
    padding: 24px 16px;
    max-width: var(--landing-max-width);
    margin: 0 auto;
}
.landing-faq-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--landing-text);
    margin-bottom: 16px;
}
.faq-item {
    background: var(--landing-surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
}
.faq-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--landing-text);
    margin-bottom: 8px;
}
.faq-answer {
    font-size: 13px;
    color: var(--landing-text-secondary);
    line-height: 1.5;
}

/* ================================================
   BOTTOM CTA
   ================================================ */
.bottom-cta {
    background: var(--landing-surface);
    border-top: 1px solid var(--landing-border);
    padding: 32px 16px;
    text-align: center;
}

.bottom-cta-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--landing-primary), var(--landing-primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.bottom-cta-desc {
    font-size: 14px;
    color: var(--landing-text-secondary);
    margin-bottom: 20px;
}

.bottom-cta-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    max-width: var(--landing-max-width);
    margin: 0 auto;
}

/* ================================================
   FOOTER
   ================================================ */
.landing-footer {
    padding: 24px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    max-width: var(--landing-max-width);
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--landing-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--landing-text-secondary);
}

.footer-copy {
    font-size: 12px;
    color: var(--landing-text-muted);
}

/* ================================================
   LOADING SKELETON
   ================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--landing-surface) 25%, var(--landing-surface-hover) 50%, var(--landing-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    border-radius: 12px;
    overflow: hidden;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
}

.skeleton-text {
    height: 14px;
    margin: 10px;
    border-radius: 4px;
}

.skeleton-text-short {
    width: 60%;
    height: 12px;
    margin: 6px 10px 12px;
    border-radius: 4px;
}

/* ================================================
   TOUCH / SWIPE HINT
   ================================================ */
@media (hover: none) and (pointer: coarse) {
    .genre-filter {
        scroll-snap-type: x mandatory;
    }
    .genre-chip {
        scroll-snap-align: start;
    }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (min-width: 481px) {
    .landing-header,
    .landing-main,
    .landing-footer {
        max-width: var(--landing-max-width);
    }
}
