/* ============================================================
   Adaptext Landing Page — Main Stylesheet
   Theme: Indigo (#6366F1)
   ============================================================ */

/* ============================================================
   1. CSS Custom Properties
   ============================================================ */
:root {
    --primary:        #6366F1;
    --primary-light:  #818CF8;
    --primary-dark:   #4F46E5;
    --primary-bg:     #EEF2FF;
    --text:           #1F2937;
    --text-secondary: #6B7280;
    --text-light:     #9CA3AF;
    --bg:             #FFFFFF;
    --bg-alt:         #F9FAFB;
    --border:         #E5E7EB;
    --radius:         16px;
    --radius-sm:      8px;
    --radius-full:    9999px;
    --shadow:         0 1px 3px rgba(0, 0, 0, 0.1),  0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl:      0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --max-width:      1200px;
    --transition:     0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ============================================================
   3. Layout Utilities
   ============================================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section--alt {
    background: var(--bg-alt);
}

/* Section headings */
.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
}

/* ============================================================
   4. Visually Hidden Utility
   ============================================================ */
.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;
}

/* ============================================================
   5. Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                box-shadow var(--transition), transform var(--transition),
                border-color var(--transition);
    text-decoration: none;
    border: 2px solid transparent;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.btn--primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn--ghost:hover {
    background: var(--primary-bg);
}

.btn--large {
    padding: 16px 40px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 10px 24px;
    font-size: 0.875rem;
}

/* ============================================================
   6. Header & Navigation
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: border-color var(--transition), box-shadow var(--transition);
    border-bottom: 1px solid transparent;
}

.site-header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow);
}

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

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition);
}

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

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* Open state — animate hamburger to X */
.nav-toggle.open .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu — slide-down dropdown */
.mobile-menu {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: max-height var(--transition);
}

.mobile-menu.open {
    display: block;
}

.mobile-nav-list {
    list-style: none;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-nav-link {
    display: block;
    padding: 12px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    transition: color var(--transition);
}

.mobile-nav-link:last-of-type {
    border-bottom: none;
}

.mobile-nav-link:hover {
    color: var(--primary);
}

.mobile-nav-link--cta {
    color: var(--primary);
    font-weight: 700;
    border-bottom: none;
    margin-top: 8px;
}

/* ============================================================
   7. Hero Section
   ============================================================ */
.hero {
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text);
    letter-spacing: -0.03em;
}

.hero-title .highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   8. Phone Mockup
   ============================================================ */
.phone-mockup {
    display: flex;
    justify-content: center;
}

.phone-frame {
    width: 280px;
    height: 560px;
    background: var(--text);
    border-radius: 40px;
    padding: 12px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.phone-notch {
    width: 120px;
    height: 28px;
    background: var(--text);
    border-radius: 0 0 16px 16px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 32px;
    overflow: hidden;
    padding: 48px 16px 16px;
    display: flex;
    flex-direction: column;
}

.mock-header {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 16px;
}

.mock-search {
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.mock-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.mock-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

.mock-definition {
    font-size: 0.75rem;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.mock-analogy {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.mock-keyword {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   9. Problem Section
   ============================================================ */
.problem-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.problem-card {
    text-align: center;
    padding: 32px 24px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.problem-card__icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.problem-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.problem-card__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================================
   10. Features Grid
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color var(--transition), box-shadow var(--transition),
                transform var(--transition);
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-card--soon {
    opacity: 0.75;
}

.feature-card__icon {
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-card__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Badge — "Скоро" */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.badge--soon {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ============================================================
   11. How It Works — Steps
   ============================================================ */
.steps {
    display: flex;
    justify-content: center;
    gap: 32px;
    position: relative;
    list-style: none;
}

.step {
    text-align: center;
    flex: 1;
    max-width: 320px;
    position: relative;
}

/* Connecting line between steps */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 28px;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    height: 2px;
    background: var(--border);
}

.step__number {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 16px;
    position: relative;
    z-index: 1;
}

.step__content {
    /* wrapper — no extra styles needed */
}

.step__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.step__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================
   12. Example Cards
   ============================================================ */
.example-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.example-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition);
    padding: 24px;
}

.example-card:hover {
    box-shadow: var(--shadow-lg);
}

.example-card__header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.example-card__badge {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.example-card__badge--football {
    background: #FEF3C7;
    color: #92400E;
}

.example-card__badge--anime {
    background: #FCE7F3;
    color: #9D174D;
}

.example-card__word {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.example-card__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.example-card__keyword {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.keyword-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.keyword-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}

/* ============================================================
   13. Audience Cards
   ============================================================ */
.audience-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.audience-card {
    padding: 32px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.audience-card__icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.audience-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.audience-card__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   14. Waitlist & Feedback Sections
   ============================================================ */
.waitlist-inner,
.feedback-inner {
    text-align: center;
}

.waitlist-form,
.feedback-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 0;
}

/* Inline row: email input + submit button */
.form-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    align-items: stretch;
}

.form-row .form-input {
    flex: 1;
    max-width: none;
}

/* Individual form field wrapper */
.form-group {
    width: 100%;
    max-width: 480px;
}

.form-input {
    width: 100%;
    max-width: 480px;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

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

.waitlist-form .btn,
.feedback-form .btn {
    width: auto;
    min-width: 160px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-success {
    padding: 16px 24px;
    background: #ECFDF5;
    color: #065F46;
    border-radius: var(--radius-sm);
    font-weight: 500;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* hidden attribute hides it natively; this ensures display when shown */
.form-success[hidden] {
    display: none;
}

/* ============================================================
   15. Footer
   ============================================================ */
.site-footer {
    background: var(--text);
    color: #fff;
    padding: 48px 0;
}

.footer-inner {
    text-align: center;
}

.site-footer .logo {
    color: #fff;
    font-size: 1.5rem;
    display: inline-block;
    margin-bottom: 8px;
}

.footer-brand {
    margin-bottom: 16px;
}

.footer-tagline {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

.footer-copy {
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ============================================================
   16. Scroll Animations
   ============================================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for child elements */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* ============================================================
   17. Responsive — Tablet (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .example-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Last card spans full width on 2-col grid */
    .example-cards .example-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        max-width: calc(50% - 12px);
        margin: 0 auto;
    }
}

/* ============================================================
   18. Responsive — Mobile (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* --- Typography --- */
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* --- Sections --- */
    .section {
        padding: 48px 0;
    }

    /* --- Hero --- */
    .hero {
        padding-top: 96px;
        min-height: auto;
        padding-bottom: 48px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .hero-actions {
        justify-content: center;
    }

    /* Phone mockup — order below text */
    .hero-visual {
        order: 1;
    }

    .phone-frame {
        width: 220px;
        height: 440px;
    }

    .phone-notch {
        width: 96px;
        height: 22px;
    }

    /* --- Navigation --- */
    .nav-toggle {
        display: flex;
    }

    .nav {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    /* --- All multi-column grids → single column --- */
    .problem-cards,
    .features-grid,
    .example-cards,
    .audience-cards {
        grid-template-columns: 1fr;
    }

    /* Reset last-card override from tablet */
    .example-cards .example-card:last-child:nth-child(odd) {
        grid-column: auto;
        max-width: 100%;
        margin: 0;
    }

    /* --- Steps — vertical layout, hide connecting lines --- */
    .steps {
        flex-direction: column;
        align-items: center;
    }

    .step {
        max-width: 100%;
        width: 100%;
    }

    .step:not(:last-child)::after {
        display: none;
    }

    /* --- Forms --- */
    .form-row {
        flex-direction: column;
    }

    .form-input,
    .form-success {
        max-width: 100%;
    }

    .form-group {
        max-width: 100%;
    }
}
