/* ╔══════════════════════════════════════════╗
   ║           MEOWASTIC – STYLES             ║
   ╚══════════════════════════════════════════╝ */

/* ── Reset ─────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Themes (CSS Custom Properties) ────────── */
:root,
[data-theme="rose"] {
    --bg: #f8c8cc;
    --bg-secondary: #f3b0b5;
    --bg-card: #fde4e680;
    --bg-card-hover: #fde4e6cc;
    --text: #153a5c;
    --text-muted: #a06a70;
    --heading: #5a2d32;
    --accent: #e8929a;
    --accent-hover: #d67880;
    --accent-text: #ffffff;
    --border: #f0b0b6;
    --shadow-card: 0 4px 24px rgba(107, 58, 63, .10);
    --shadow-hover: 0 12px 40px rgba(107, 58, 63, .18);
    --glass-blur: blur(12px);
    --badge-bg: #e8929a22;
    --badge-text: #d67880;
    --footer-bg: #f3b0b5;
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #25253e99;
    --bg-card-hover: #25253ecc;
    --text: #e0d0d4;
    --text-muted: #9a8a8e;
    --heading: #f0e0e4;
    --accent: #e8929a;
    --accent-hover: #d67880;
    --accent-text: #1a1a2e;
    --border: #3a3a5e;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, .25);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, .40);
    --glass-blur: blur(14px);
    --badge-bg: #e8929a18;
    --badge-text: #e8929a;
    --footer-bg: #16213e;
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-secondary: #f0f0f0;
    --bg-card: #ffffff99;
    --bg-card-hover: #ffffffcc;
    --text: #333333;
    --text-muted: #777777;
    --heading: #222222;
    --accent: #e8929a;
    --accent-hover: #d67880;
    --accent-text: #ffffff;
    --border: #e0e0e0;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, .06);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, .12);
    --glass-blur: blur(10px);
    --badge-bg: #e8929a15;
    --badge-text: #d67880;
    --footer-bg: #f0f0f0;
}

/* ── Base ──────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background .4s ease, color .4s ease;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--heading);
    transition: color .4s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ── Header ────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    transition: background .4s ease, border-color .4s ease;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.brand-icon {
    font-size: 2rem;
    line-height: 1;
}

.brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: .8rem;
    color: var(--text-muted);
    transition: color .4s ease;
}

/* ── Theme Switcher ────────────────────────── */
.theme-switcher {
    display: flex;
    gap: .5rem;
    background: var(--bg);
    padding: .35rem .5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: background .4s ease, border-color .4s ease;
}

.theme-btn {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.theme-btn:hover {
    transform: scale(1.15);
}

.theme-btn.active .theme-dot {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: outline-color .3s ease;
}

.rose-dot {
    background: #f8c8cc;
    border: 1px solid #e8929a;
}

.dark-dot {
    background: #1a1a2e;
    border: 1px solid #3a3a5e;
}

.light-dot {
    background: #fafafa;
    border: 1px solid #d0d0d0;
}

/* ── Hero ──────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 1.5rem 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto;
    transition: color .4s ease;
}

/* ── App Grid ──────────────────────────────── */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem 3rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding-top: 1.5rem;
}

/* ── App Card ──────────────────────────────── */
.app-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    transition:
        transform .3s cubic-bezier(.4, 0, .2, 1),
        box-shadow .3s cubic-bezier(.4, 0, .2, 1),
        background .4s ease,
        border-color .4s ease;
    opacity: 0;
    transform: translateY(24px);
}

.app-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .5s cubic-bezier(.4, 0, .2, 1),
        transform .5s cubic-bezier(.4, 0, .2, 1),
        box-shadow .3s cubic-bezier(.4, 0, .2, 1),
        background .4s ease,
        border-color .4s ease;
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    background: var(--bg-card-hover);
}

.app-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .15rem;
}

.app-category {
    font-size: .75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    transition: color .4s ease;
}

.app-desc {
    font-size: .92rem;
    color: var(--text-muted);
    line-height: 1.55;
    transition: color .4s ease;
}

/* ── Store Badges ──────────────────────────── */
.store-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: auto;
    padding-top: .5rem;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--badge-bg);
    color: var(--badge-text);
    border: 1px solid var(--border);
    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease;
    text-decoration: none;
}

.store-badge:hover {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.store-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Section Title ─────────────────────────── */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .25rem;
    padding-top: 1.5rem;
}

/* ── Carousel ──────────────────────────────── */
.carousel-section {
    margin-bottom: 2rem;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
}

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    border-radius: 1.5rem;
}

.carousel-track {
    display: flex;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

/* ── Carousel Slide ────────────────────────── */
.carousel-slide {
    min-width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: background .4s ease, border-color .4s ease;
}

.slide-info {
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.slide-icon {
    width: 72px;
    height: 72px;
    border-radius: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.slide-name {
    font-size: 1.5rem;
    font-weight: 800;
}

.slide-category {
    font-size: .75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    transition: color .4s ease;
}

.slide-desc {
    font-size: .95rem;
    color: var(--text-muted);
    line-height: 1.6;
    transition: color .4s ease;
}

.slide-stores {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

/* ── Slide Screenshot Gallery ──────────────── */
.slide-gallery {
    display: flex;
    gap: .75rem;
    padding: 1.5rem 1.5rem 1.5rem 0;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.slide-gallery::-webkit-scrollbar {
    display: none;
}

.slide-screenshot {
    flex-shrink: 0;
    width: 160px;
    height: 280px;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    transition: transform .3s ease, box-shadow .3s ease;
    background: var(--bg-secondary);
    cursor: zoom-in;
}

.slide-screenshot:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
}

/* ── Screenshot Placeholder (SVG) ──────────── */
.screenshot-placeholder {
    flex-shrink: 0;
    width: 160px;
    height: 280px;
    border-radius: 1rem;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 500;
    background: var(--bg-secondary);
    transition: background .4s ease, border-color .4s ease, color .4s ease;
}

.screenshot-placeholder svg {
    opacity: .4;
}

/* ── Carousel Arrows ───────────────────────── */
.carousel-arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease;
    box-shadow: var(--shadow-card);
}

.carousel-arrow:hover {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    transform: scale(1.08);
}

/* ── Carousel Dots ─────────────────────────── */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
    padding: 0;
}

.carousel-dot:hover {
    transform: scale(1.25);
}

.carousel-dot.active {
    background: var(--accent);
    transform: scale(1.15);
}

/* ── Footer ────────────────────────────────── */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    transition: background .4s ease, border-color .4s ease;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--heading);
    transition: color .4s ease;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    color: var(--text-muted);
    transition: color .25s ease, transform .25s ease;
    display: flex;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.footer-copy {
    font-size: .8rem;
    color: var(--text-muted);
    transition: color .4s ease;
}

/* ── Lightbox Modal ────────────────────────── */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    transform: scale(0.92);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    transition: all .2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 700px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
    }

    .brand {
        justify-content: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    .carousel-slide {
        grid-template-columns: 1fr;
    }

    .slide-gallery {
        padding: 0 1.25rem 1.25rem;
    }

    .carousel-arrow {
        display: none;
    }

    .slide-screenshot,
    .screenshot-placeholder {
        width: 130px;
        height: 230px;
    }
}

@media (min-width: 1000px) {
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}