/* ===== CSS Variables ===== */
:root {
    /* The app icon's gradient: #3BC7FD at the top to #2587FC at the bottom */
    --color-primary: #2587FC;
    --color-primary-hover: #1B74E4;
    --color-primary-soft: #6FD3FF;
    --color-accent: #3BC7FD;

    --gradient-brand: linear-gradient(180deg, #3BC7FD 0%, #2587FC 100%);
    --gradient-text: linear-gradient(90deg, #2587FC 0%, #3BC7FD 50%, #2587FC 100%);

    --color-bg-white: #ffffff;
    --color-bg-gray: #f5f9fd;
    --color-bg-dark: #0f1b2d;
    --color-bg-dark-2: #1c2d47;

    --color-text: #111a26;
    --color-text-secondary: #5f6b7a;
    --color-text-muted: #98a3b3;

    --color-border: #e4ecf5;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --transition: 200ms ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-white);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ===== Utilities ===== */
.text-primary {
    color: var(--color-primary);
}

.text-primary-light {
    color: var(--color-primary-soft);
}

.text-bold {
    font-weight: 700;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-sm) 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-right {
    display: flex;
    align-items: center;
}

.lang-dropdown {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.lang-current:hover {
    color: var(--color-text);
}

.lang-icon {
    width: 18px;
    height: 18px;
}

.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(15, 35, 70, 0.1);
    min-width: 140px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.lang-option:hover {
    background: var(--color-bg-gray);
    color: var(--color-text);
}

.lang-option.active {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.875rem 2rem;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 8px 24px rgba(37, 135, 252, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 135, 252, 0.38);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.0625rem;
}

/* ===== Section Titles ===== */
.section-title-left {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    margin-bottom: var(--space-xl);
}

/* ===== Hero Section ===== */
.hero {
    padding-top: 160px;
    padding-bottom: var(--space-2xl);
    background:
        radial-gradient(600px 300px at 15% 20%, rgba(59, 199, 253, 0.12), transparent 70%),
        radial-gradient(700px 360px at 85% 30%, rgba(37, 135, 252, 0.10), transparent 70%),
        var(--color-bg-white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    will-change: transform, opacity;
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

@media (max-width: 1200px) {
    .hero-title {
        font-size: clamp(2.25rem, 8vw, 3rem);
    }
}

/* Phones: smaller type, and the script switches to the short words (see SHORT_WORDS_QUERY) */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
    }
}

.hero-gradient {
    display: block;
    font-size: 1.1em;
    line-height: 1.2;
    padding-bottom: 0.1em;
    min-height: 1.3em; /* Keeps the line when the typed word is empty */
    white-space: nowrap; /* A typed word never wraps, so the page below doesn't jump */
    background: var(--gradient-text);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@media (max-width: 1200px) {
    .hero-gradient {
        margin-top: 0.1em;
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.typing-text::after {
    content: '|';
    position: absolute;
    -webkit-text-fill-color: var(--color-primary);
    font-weight: 400;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Getting Started Section ===== */
.getting-started {
    padding: var(--space-2xl) 0;
    background: var(--color-bg-gray);
    position: relative;
    z-index: 2;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1000px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .showcase-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
}

.showcase-card {
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.showcase-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.showcase-card-brand {
    background: var(--gradient-brand);
    color: white;
}

.showcase-card-light {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    padding-top: 0;
    padding-bottom: var(--space-lg);
}

.showcase-card-dark {
    background: linear-gradient(180deg, var(--color-bg-dark-2) 0%, var(--color-bg-dark) 100%);
    color: white;
}

.showcase-text {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    padding: var(--space-xs) 0;
}

.showcase-text-light {
    color: rgba(255, 255, 255, 0.95);
}

/* Phone Mockup */
.phone-mockup {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.phone-mockup-bottom {
    align-items: flex-end;
    margin-top: var(--space-md);
}

.phone-mockup-top {
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.phone-frame {
    position: relative;
    width: 92%;
    background: #111a26;
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(15, 35, 70, 0.28);
}

.phone-mockup-bottom .phone-frame {
    margin-bottom: -100px;
}

.phone-mockup-top .phone-frame {
    margin-top: -100px;
}

.phone-screen {
    background: white;
    border-radius: 30px;
    overflow: hidden;
}

.phone-screen img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 390 / 844;
}

/* ===== Telegram chat mockup (the "share to a chat" card) ===== */
/* Laid out for a 390px-wide screen and scaled with it, like the screenshots next to it. */
.phone-screen {
    container-type: inline-size;
}

.tg-chat {
    font-size: 5cqw;
    aspect-ratio: 390 / 844;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.35) 0 0.154em, transparent 0.231em) 0 0 / 2.923em 2.923em,
        linear-gradient(160deg, #d5e6c3 0%, #b9d6a8 55%, #cfe3b8 100%);
    line-height: 1.35;
    color: #000;
    text-align: left;
}

.tg-header {
    display: flex;
    align-items: center;
    gap: 0.615em;
    padding: 2.615em 0.923em 0.615em;
    background: #fff;
    border-bottom: 0.077em solid #e3e3e3;
}

.tg-back {
    width: 1.231em;
    height: 1.231em;
    color: #3390ec;
    flex-shrink: 0;
}

.tg-avatar {
    width: 2.333em;
    height: 2.333em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.923em;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.tg-title {
    font-weight: 600;
    font-size: 0.923em;
}

.tg-subtitle {
    color: #8a8a8a;
    font-size: 0.769em;
}

.tg-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.462em;
    padding: 0.769em 0.615em 0.923em;
}

.tg-row {
    display: flex;
    align-items: flex-end;
    gap: 0.385em;
}

.tg-row-out {
    justify-content: flex-end;
}

.tg-row .tg-avatar {
    width: 2.444em;
    height: 2.444em;
    font-size: 0.692em;
}

.tg-bubble {
    max-width: 78%;
    padding: 0.385em 0.615em 0.462em;
    border-radius: 0.923em;
    background: #fff;
    box-shadow: 0 0.077em 0.077em rgba(0, 0, 0, 0.08);
}

.tg-row-in .tg-bubble {
    border-bottom-left-radius: 0.308em;
}

.tg-row-out .tg-bubble {
    background: #effedd;
    border-bottom-right-radius: 0.308em;
}

.tg-name {
    font-weight: 600;
    font-size: 0.808em;
    margin-bottom: 0.077em;
}

.tg-time {
    float: right;
    margin: 0.444em 0 -0.333em 0.889em;
    font-size: 0.692em;
    color: #8a9a86;
}

.tg-row-in .tg-time {
    color: #a0a0a0;
}

.tg-share {
    max-width: 82%;
}

.tg-share .tg-bubble {
    max-width: none;
    border-bottom-right-radius: 0.923em;
}

.tg-share-button {
    margin-top: 0.286em;
    padding: 0.571em;
    border-radius: 0.952em;
    background: rgba(90, 130, 70, 0.35);
    color: white;
    font-weight: 600;
    font-size: 0.808em;
    text-align: center;
}

.tg-input {
    margin: 0 0.615em 0.923em;
    padding: 0.538em 0.923em;
    border-radius: 1.231em;
    background: #fff;
    color: #9a9a9a;
}

/* ===== Features Section ===== */
.features {
    padding: var(--space-2xl) 0;
    background: var(--color-bg-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    padding: var(--space-lg);
    background: var(--color-bg-gray);
    border-radius: var(--radius-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.feature-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(15, 35, 70, 0.06);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(37, 135, 252, 0.1);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.feature-card h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.feature-card p {
    font-size: 1.0625rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.feature-card code {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.9375rem;
    color: var(--color-text);
}

/* ===== Feature Spotlight Sections ===== */
.feature-spotlight {
    padding: var(--space-2xl) 0;
    overflow: hidden;
}

.feature-spotlight-gray {
    background: var(--color-bg-gray);
}

.feature-spotlight-dark {
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-dark-2) 100%);
}

.feature-spotlight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

@media (max-width: 900px) {
    .feature-spotlight-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .feature-spotlight-grid-reverse .feature-spotlight-visual {
        order: 2;
    }
}

.feature-spotlight-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.feature-spotlight-gray .feature-spotlight-title {
    color: var(--color-text);
}

.feature-spotlight-dark .feature-spotlight-title {
    color: white;
}

.feature-spotlight-desc {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 480px;
}

.feature-spotlight-gray .feature-spotlight-desc {
    color: var(--color-text-secondary);
}

.feature-spotlight-dark .feature-spotlight-desc {
    color: rgba(255, 255, 255, 0.68);
}

.feature-spotlight-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spotlight-phone {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.spotlight-phone.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.spotlight-phone .phone-frame {
    width: 260px;
    box-shadow: 0 32px 80px rgba(15, 35, 70, 0.22);
}

.feature-spotlight-dark .spotlight-phone .phone-frame {
    box-shadow: 0 32px 80px rgba(37, 135, 252, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
    .spotlight-phone .phone-frame {
        width: 220px;
    }
}

/* ===== FAQ Section ===== */
.faq {
    padding: var(--space-2xl) 0;
    background: var(--color-bg-white);
}

.faq-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (max-width: 900px) {
    .faq-layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

.faq-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    position: sticky;
    top: 100px;
    margin-top: 0.5rem;
}

@media (max-width: 900px) {
    .faq-title {
        position: static;
    }
}

.faq-list {
    display: flex;
    flex-direction: column;
}

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

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: var(--color-primary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.faq-icon::before {
    width: 16px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-icon::after {
    width: 2px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-item.open .faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.faq-item.open .faq-question {
    color: var(--color-primary);
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.faq-item.open .faq-answer {
    grid-template-rows: 1fr;
    opacity: 1;
}

.faq-answer-inner {
    overflow: hidden;
    padding-bottom: 0;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    transition: padding 0.3s ease;
}

.faq-item.open .faq-answer-inner {
    padding-bottom: var(--space-lg);
}

.faq-support {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-lg);
    padding: var(--space-sm) 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: all var(--transition);
}

.faq-support:hover {
    gap: 10px;
}

.faq-support svg {
    width: 20px;
    height: 20px;
}

/* ===== Footer ===== */
.footer {
    padding: var(--space-lg) 0;
    background: var(--color-bg-gray);
    border-top: 1px solid var(--color-border);
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.25rem;
    font-weight: 600;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color var(--transition);
}

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

@media (max-width: 600px) {
    .footer-main,
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .showcase-card,
    .feature-card,
    .spotlight-phone {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-gradient {
        animation: none;
    }
}

/* ===== Legal Pages ===== */
.legal {
    max-width: 800px;
    margin: 140px auto var(--space-2xl);
    padding: 0 var(--space-md);
}

.legal-section + .legal-section {
    margin-top: var(--space-xl);
}

.legal h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.legal h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.legal h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

.legal p {
    font-size: 0.9875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.legal ul {
    padding-left: 1.25rem;
    margin: 0 0 var(--space-sm);
    color: var(--color-text-secondary);
    font-size: 0.9875rem;
}

.legal li + li {
    margin-top: 0.35rem;
}

.legal strong {
    color: var(--color-text);
}

.legal a {
    color: var(--color-primary);
}

.legal a:hover {
    text-decoration: underline;
}

.legal code {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.875rem;
    background: var(--color-bg-gray);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}
