/* =============================================
   LOCAL FONTS (OPTIMIZED)
   ============================================= */

/* Libre Baskerville - Body */
@font-face {
    font-family: 'Libre Baskerville';
    src: url('../assets/fonts/libre-baskerville/LibreBaskerville-Variable.woff2') format('woff2'),
        url('../assets/fonts/libre-baskerville/LibreBaskerville-Variable.woff') format('woff');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Libre Franklin - Headings/UI */
@font-face {
    font-family: 'Libre Franklin';
    src: url('../assets/fonts/libre-franklin/LibreFranklin-Variable.woff2') format('woff2'),
        url('../assets/fonts/libre-franklin/LibreFranklin-Variable.woff') format('woff');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}


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

/* =============================================
   DESIGN SYSTEM — single source of truth
   ============================================= */
:root {
    --primary-color: #833AB4;
    --primary-dark: #6B2F93;
    --secondary-color: #10B981;
    --success-color: #10B981;
    --error-color: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-light: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --container-width: 1100px;
    --section-spacing: 72px;
    --radius: 10px;

    /* Typography */
    --font-heading: 'Libre Franklin', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
}

/* =============================================
   TYPOGRAPHY & BODY
   ============================================= */
body {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.2rem);
    /* min 18px */
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-primary);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.25;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(1.875rem, 1.4rem + 2.2vw, 3rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
    font-weight: 700;
    margin-bottom: 36px;
    text-align: center;
}

h3 {
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);
    font-weight: 700;
    margin-bottom: 8px;
}

p {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
    color: var(--text-secondary);
    line-height: 1.8;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.heading-m {
    font-family: 'Libre Franklin';
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);
    font-weight: 700;
}

/* =============================================
   SITENAME INLINE FIX
   ============================================= */
.site-name {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.page-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-light {
    background: var(--bg-light);
    padding: var(--section-spacing) 0;
}

.section-white {
    background: var(--bg-primary);
    padding: var(--section-spacing) 0;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none !important;
}

.site-nav {
    display: flex;
    gap: 24px;
}

.site-nav a {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.header-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: #fff !important;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(131, 58, 180, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-cta-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 18px rgba(131, 58, 180, 0.24);
    transform: translateY(-1px);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
    background: linear-gradient(150deg, #f5f0fb 0%, #ede9f8 100%);
    padding: 60px 0 48px;
    text-align: center;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.875rem, 1.4rem + 2.2vw, 3rem);
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.hero-sub {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
}

/* =============================================
   DOWNLOADER WIDGET (tool — all IDs preserved)
   ============================================= */
.downloader-widget {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(131, 58, 180, 0.12);
    width: 100%;
    max-width: 780px;
}

/* Download Form */
.download-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.url-input {
    width: 100%;
    padding: 14px 90px 14px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
}

.url-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.1);
}

.url-input::placeholder {
    color: #9CA3AF;
}

/* Paste + Clear — floating inside input on the right */
.input-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.paste-btn {
    background: #F3F4F6;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.paste-btn:hover {
    background: #E5E7EB;
    color: var(--text-primary);
}

.clear-btn {
    background: #F3F4F6;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.clear-btn:hover {
    background: #E5E7EB;
    color: var(--text-primary);
}

/* Download button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    min-width: 160px;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.download-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(131, 58, 180, 0.3);
}

.download-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Message */
.status-message {
    padding: 11px 16px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 10px;
}

.status-message.error {
    background: #FEE2E2;
    color: var(--error-color);
    border: 1px solid #FECACA;
}

.status-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

/* Retry Button */
.retry-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--error-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 14px;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #DC2626;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 18px;
}

.progress-bar {
    width: 100%;
    height: 7px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 7px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Result Card */
.result-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-top: 18px;
}

.result-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

.video-preview video {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    background: #000;
}

.result-info {
    flex: 1;
    text-align: center;
}

.result-icon {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.result-card h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.result-filename {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    word-break: break-all;
}

.result-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
}

.result-download-btn:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

/* =============================================
   TRUST BADGES
   ============================================= */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    list-style: none;
    justify-content: center;
    margin-top: 24px;
}

.trust-badges li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge-check {
    flex-shrink: 0;
    display: block;
}

/* =============================================
   HOW IT WORKS — STEPS
   ============================================= */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.step-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.step-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.step-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.step-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.step-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.step-card p {
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
}

.feature-card p {
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
}

/* =============================================
   FEATURES GRID
   ============================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f3ecfb;
    border-radius: 12px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 8px;
}

/* =============================================
   SEO CONTENT BLOCKS
   ============================================= */
.seo-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.seo-block--reverse {
    direction: rtl;
}

.seo-block--reverse>* {
    direction: ltr;
}

.seo-text h2 {
    font-family: var(--font-heading);
    text-align: left;
    font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
    margin-bottom: 16px;
}

.seo-text p {
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
    line-height: 1.8;
}

.seo-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
    border: 1px solid var(--border-color);
}

.section-sub {
    font-family: var(--font-body);
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(1.125rem, 1rem + 0.3vw, 1.2rem);
    margin-top: -24px;
    margin-bottom: 36px;
}

/* =============================================
   TESTIMONIALS
   ============================================= */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.testimonial-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.quote-icon {
    display: block;
    flex-shrink: 0;
}

.stars {
    color: #f59e0b;
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.testimonial-card p {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
    line-height: 1.75;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.testimonial-card footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.avatar-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.avatar-info cite {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: normal;
}

/* =============================================
   FAQ ACCORDION
   ============================================= */
.faq-container {
    max-width: 760px;
}

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

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.faq-item[open] {
    border-color: var(--primary-color);
}

.faq-item summary {
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    gap: 12px;
    transition: background 0.2s ease;
}

.faq-item summary:hover {
    background: var(--bg-light);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary .summary-text {
    flex: 1;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 400;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    line-height: 1;
    width: 20px;
    text-align: center;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-body {
    overflow: hidden;
    animation: faqOpen 0.3s ease;
}

@keyframes faqOpen {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-body p {
    padding: 0 20px 16px;
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.05rem + 0.2vw, 1.175rem);
    line-height: 1.7;
    margin: 0;
}

/* =============================================
   GLOBAL CARD HOVER TRANSITION
   ============================================= */
.step-card,
.feature-card,
.testimonial-card,
.faq-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.seo-image img {
    transition: box-shadow 0.3s ease;
}

.seo-image img:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    background: var(--text-primary);
    color: #9CA3AF;
    padding: 36px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.footer-copy {
    font-size: 0.82rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-nav a {
    font-size: 0.85rem;
    color: #9CA3AF;
}

.footer-nav a:hover {
    color: #fff;
    text-decoration: none;
}

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

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

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

    .step-card-image {
        aspect-ratio: 4 / 3;
    }

    .seo-block {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .seo-block--reverse {
        direction: ltr;
    }

    .seo-text h2 {
        font-size: 1.35rem;
    }
}

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

@media (max-width: 640px) {
    :root {
        --section-spacing: 48px;
    }

    .hero-section {
        padding: 40px 0 36px;
    }

    .hero-sub {
        font-size: 1.125rem;
    }

    .downloader-widget {
        padding: 22px 16px;
    }

    .download-form {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
    }

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

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

    h2 {
        font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem);
    }

    .result-content {
        display: flex;
        flex-direction: column-reverse;
    }

    .video-preview video {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 400px) {
    .trust-badges {
        flex-direction: column;
        align-items: center;
    }

    .url-input {
        padding-right: 70px;
    }
}