/* ============================================
   App Showcase — Apple-like minimalist design
   ============================================ */

/* --- CSS Variables / Theming --- */
:root,
[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: #d2d2d7;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --card-hover-shadow: 0 8px 30px rgba(0,0,0,0.12);
    --header-bg: rgba(255,255,255,0.72);
    --footer-bg: #f5f5f7;
    --error: #e74c3c;
    --success: #27ae60;
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-secondary: #1d1d1f;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --border: #424245;
    --accent: #2997ff;
    --accent-hover: #419cff;
    --card-bg: #1d1d1f;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.3);
    --card-hover-shadow: 0 8px 30px rgba(0,0,0,0.5);
    --header-bg: rgba(0,0,0,0.72);
    --footer-bg: #1d1d1f;
    --error: #ff6b6b;
    --success: #51cf66;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.47059;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* --- Container --- */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.logo {
    font-size: 21px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo:hover {
    color: var(--text);
    opacity: 0.8;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.header-nav a {
    color: var(--text);
    opacity: 0.8;
}

.header-nav a:hover {
    opacity: 1;
    color: var(--accent);
}

.lang-switch {
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-secondary);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* --- Alerts --- */
.alert {
    padding: 12px 20px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: color-mix(in srgb, var(--success) 15%, var(--bg));
    color: var(--success);
}

.alert-error {
    background: color-mix(in srgb, var(--error) 15%, var(--bg));
    color: var(--error);
}

/* --- Hero Home --- */
.hero-home {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-home h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.07;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 21px;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Apps Grid --- */
.apps-grid {
    padding: 0 0 100px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 32px 40px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text);
    text-decoration: none;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
    color: var(--text);
}

.app-card-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.app-card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 22.5%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.icon-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 22.5%;
    background: linear-gradient(135deg, var(--hero-color), color-mix(in srgb, var(--hero-color) 60%, #000));
}

.app-card-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.app-card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    padding: 60px 0;
}

/* --- Hero App Detail --- */
.hero-app {
    padding: 80px 0 36px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--hero-color) 12%, var(--bg)) 0%, var(--bg) 100%);
}

.hero-app-inner {
    text-align: center;
}

.hero-app-icon {
    width: 128px;
    height: 128px;
    border-radius: 22.5%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    margin: 0 auto 24px;
}

.hero-app h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-app-subtitle {
    font-size: 21px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.hero-app-promo {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 28px;
}

.hero-app-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary,
.btn-appstore {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover,
.btn-appstore:hover {
    background: var(--accent-hover);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
}

/* --- Sections --- */
.section-description,
.section-videos {
    padding: 60px 0;
}

.section-screenshots {
    padding: 20px 0;
}

.section-screenshots + .section-description {
    padding-top: 20px;
}

.section-screenshots + .section-videos,
.section-description + .section-videos {
    padding-top: 0;
}

.section-description .description-text {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    text-align: justify;
}

.section-description .description-text p {
    text-indent: 1.5em;
    margin-bottom: 0.8em;
}

h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 40px;
}

/* --- Screenshot Carousel --- */
.screenshot-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0 20px;
    scrollbar-width: none;
}

.screenshot-carousel::-webkit-scrollbar {
    display: none;
}

.screenshot-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    text-align: center;
}

.screenshot-item.device-iphone {
    width: 240px;
}

.screenshot-item.device-ipad {
    width: 400px;
}

.device-frame {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 28px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.device-frame-iphone {
    border-radius: 36px;
    padding: 14px;
}

.device-frame-ipad {
    border-radius: 20px;
    padding: 16px;
}

.device-frame img {
    width: 100%;
    border-radius: 16px;
}

.screenshot-caption {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* --- Videos --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.video-item video {
    width: 100%;
    border-radius: 16px;
    background: #000;
}

.video-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
}

/* --- Legal --- */
.section-legal {
    padding: 40px 0 80px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb .sep {
    margin: 0 6px;
    opacity: 0.5;
}

.section-legal h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.prose {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 720px;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--text);
    margin: 1.5em 0 0.5em;
}

.prose h2 { font-size: 24px; }
.prose h3 { font-size: 20px; }

.prose p {
    margin-bottom: 1em;
}

.prose ul, .prose ol {
    margin: 0.5em 0 1em 1.5em;
}

.prose li {
    margin-bottom: 0.3em;
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
}

/* --- Contact --- */
.section-contact {
    padding: 60px 0 100px;
}

.section-contact h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 12px;
}

.contact-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 40px;
}

.contact-form {
    max-width: 560px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-errors {
    background: color-mix(in srgb, var(--error) 10%, var(--bg));
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.form-errors .error {
    color: var(--error);
    font-size: 14px;
}

.field-error {
    display: block;
    color: var(--error);
    font-size: 13px;
    margin-top: 4px;
}

.contact-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

/* --- Footer --- */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 20px 0;
}

.footer-inner {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-home h1 {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .hero-app h1 {
        font-size: 32px;
    }

    .hero-app-subtitle {
        font-size: 17px;
    }

    h2 {
        font-size: 24px;
    }

    .section-legal h1,
    .section-contact h1 {
        font-size: 28px;
    }

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

    .screenshot-item.device-iphone {
        width: 200px;
    }

    .screenshot-item.device-ipad {
        width: 300px;
    }

    .hero-app-links {
        flex-direction: column;
        align-items: center;
    }

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

@media (max-width: 480px) {
    .hero-home {
        padding: 48px 0 36px;
    }

    .hero-home h1 {
        font-size: 28px;
    }

    .hero-app {
        padding: 48px 0 36px;
    }

    .hero-app-icon {
        width: 88px;
        height: 88px;
    }

    .app-card {
        padding: 32px 20px;
    }

    .app-card-icon {
        width: 80px;
        height: 80px;
    }
}
