/* Fonts load via <link> + preconnect in each page head (faster first paint). */

:root {
    --primary: #0F766E;
    --primary-soft: #14B8A6;
    --primary-dark: #064E3B;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #0F172A;
    --muted: #64748B;
    --border: rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* RTL Typography */
[dir="rtl"], [dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

/* NAV */
.navbar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar a {
    margin-inline-start: 20px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
}

.navbar a:hover {
    color: var(--primary);
    background: rgba(15, 118, 110, 0.05);
}

.navbar a.active {
    color: var(--primary);
    font-weight: 700;
    background: rgba(15, 118, 110, 0.08);
}

/* HERO */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 120px 24px;
    background:
        radial-gradient(circle at 20% 30%, rgba(20, 184, 166, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(15, 118, 110, 0.2) 0%, transparent 50%),
        var(--primary-dark);
    color: white;
    border-radius: 0 0 60px 60px;
    margin-bottom: 80px;
    overflow: hidden;
}

/* Hero Background Pattern */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 550px;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero .tagline {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-weight: 400;
}

.hero-mockup {
    position: relative;
    z-index: 2;
    width: 280px;
    height: 560px;
    background: #111;
    border-radius: 44px;
    padding: 10px;
    border: 8px solid #1e293b;
    box-shadow:
        0 50px 100px -20px rgba(0, 0, 0, 0.5),
        0 30px 60px -30px rgba(0, 0, 0, 0.3),
        inset 0 -2px 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    animation: float 6s ease-in-out infinite, fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-control {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: white;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    opacity: 0.55;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.screenshot-carousel:hover .carousel-control,
.screenshot-carousel:focus-within .carousel-control {
    opacity: 1;
}

.carousel-control:hover,
.carousel-control:focus-visible {
    background: var(--primary);
}

.carousel-control.previous { left: 14px; }
.carousel-control.next { right: 14px; }

/* RTL: sides stay fixed by design (previous left, next right); only the
   chevrons mirror so they point along the reading direction. */
[dir="rtl"] .carousel-control {
    transform: translateY(-50%) scaleX(-1);
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    inset-inline-start: 50%;
    display: flex;
    gap: 7px;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.55);
    padding: 7px 10px;
    border-radius: 999px;
}

/* RTL: inset-inline-start maps to `right` here, so translateX(50%) re-centers. */
[dir="rtl"] .carousel-dots {
    transform: translateX(50%);
}

.carousel-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid white;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.carousel-dot.active,
.carousel-dot:hover,
.carousel-dot:focus-visible {
    background: white;
}

@keyframes float {
    0%, 100% { transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(0px); }
    50% { transform: perspective(1000px) rotateY(-3deg) rotateX(1deg) translateY(-20px); }
}

/* CONTAINER */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 24px 80px;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* SECTION HEADERS */
.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
}

/* CARD SYSTEM */
.card {
    background: var(--card);
    border-radius: 32px;
    padding: 48px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(15, 118, 110, 0.2);
}

/* FEATURE ICONS */
.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.1) 0%, rgba(20, 184, 166, 0.05) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2px;
}

/* FEATURE GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.grid .card {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

/* BUTTONS */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 18px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 15px -3px rgba(15, 118, 110, 0.3);
    border: none;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(15, 118, 110, 0.4);
    background: var(--primary-soft);
}

.button:active {
    transform: translateY(-1px);
}

.button.secondary {
    background: #F1F5F9;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.button.secondary:hover {
    background: #E2E8F0;
    box-shadow: var(--shadow-md);
}

/* STORE BADGES */
.store-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.badge-placeholder {
    width: 180px;
    height: 54px;
    background: #000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #333;
    transition: opacity 0.2s;
}

/* FOOTER */
.footer {
    text-align: center;
    color: var(--muted);
    padding: 80px 24px;
    font-size: 0.95rem;
    background: white;
    border-top: 1px solid var(--border);
}

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

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* SKIP LINK */
.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -48px;
    z-index: 2000;
    background: var(--primary-dark);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: top 0.2s ease;
}

.skip-link:focus-visible {
    top: 12px;
}

/* NOTICE BANNER (shown when config/i18n fetch fails) */
.notice-banner {
    background: #FEF3C7;
    color: #92400E;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* TEXT STYLES */
h2 {
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-size: 2rem;
}

p.small {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* LANGUAGE TOGGLE */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 12px;
    background: #F1F5F9;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-btn.active {
    color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

/* FAQ STYLES */
.faq-list {
    margin-top: 32px;
}

.faq-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 700;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accessibility: stop auto-motion for users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .hero-text,
    .container,
    .hero-mockup {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hero {
        gap: 40px;
    }
    .hero h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 80px 24px;
        border-radius: 0 0 40px 40px;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .navbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 16px;
    }

    .navbar div:nth-child(2) {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .navbar a {
        margin: 0;
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .card {
        padding: 32px;
    }
}
