:root {
    --primary: #0866ff;
    --primary-hover: #0759df;
    --dark: #1c1e21;
    --light: #f0f2f5;
    --white: #ffffff;
    --gray: #65676b;
    --border: #dfe3eb;
    --shadow: 0 18px 50px rgba(20, 55, 105, 0.12);
    --shadow-soft: 0 10px 30px rgba(20, 55, 105, 0.09);
    --border-radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.65;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; top: 10px; left: 10px; z-index: 10000;
    transform: translateY(-150%); background: var(--dark); color: white;
    padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.header {
    position: sticky; top: 0; z-index: 1000;
    padding: 14px 0; border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
}
.nav { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { font-size: 23px; font-weight: 800; text-decoration: none; color: var(--dark); white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.02em; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; position: relative; overflow: hidden; background: linear-gradient(145deg, #0866ff, #1877f2); color: #fff !important; font: 800 25px/1 Arial, sans-serif; box-shadow: 0 7px 16px rgba(8,102,255,.22); }
.brand-icon > span { position: absolute; right: 3px; bottom: 1px; color: #fff !important; font: 800 11px/1 Arial, sans-serif; }
.brand-word { color: #8f8f8f !important; }
.brand-word > span { color: var(--primary) !important; }
.nav-menu { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-link {
    color: #363636; text-decoration: none; font-size: .93rem; font-weight: 700;
    padding: 9px 11px; border-radius: 10px; transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: #e7f3ff; color: var(--primary); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); background: white; border-radius: 10px; cursor: pointer; padding: 9px; }
.nav-toggle span { display: block; height: 2px; background: var(--dark); margin: 4px 0; border-radius: 99px; }
.language-menu { position: relative; margin-left: 4px; }
.language-menu[open] { z-index: 1200; }
.language-menu summary {
    list-style: none; display: flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: .9rem; font-weight: 700; border: 1px solid var(--border); border-radius: 10px;
    padding: 8px 10px; background: white; user-select: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { content: '▾'; font-size: .72rem; color: var(--gray); }
.language-menu[open] summary::after { transform: rotate(180deg); }
.language-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: min(440px, calc(100vw - 32px)); min-width: 300px;
    max-height: min(68vh, 540px); max-height: min(68dvh, 540px); padding: 8px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
    background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-soft);
    z-index: 1201;
}
.language-option {
    display: block; min-width: 0; padding: 9px 10px; border-radius: 8px;
    text-decoration: none; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere;
}
.language-option:hover, .language-option.active { background: var(--light); color: var(--primary); font-weight: 700; }

/* Hero */
.hero {
    background: radial-gradient(circle at 82% 10%, #dfeeff 0, #f5f9ff 26%, #ffffff 64%);
    padding: 68px 0 88px; text-align: center;
}
.breadcrumbs { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--gray); font-size: .9rem; }
.breadcrumbs a { color: var(--primary); text-decoration: none; font-weight: 700; }
h1 { font-size: clamp(2.35rem, 5vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.035em; margin-bottom: 20px; }
h1 span { color: var(--primary); }
.subheading { max-width: 820px; margin: 0 auto 34px; font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--gray); }
.downloader-card {
    max-width: 820px; margin: 0 auto; background: var(--white); padding: 8px; border-radius: 24px;
    box-shadow: var(--shadow); display: flex; gap: 10px; border: 1px solid rgba(0,0,0,.025);
}
.input-wrapper { flex: 1; position: relative; display: flex; min-width: 0; }
input[type="url"], input[type="text"] {
    width: 100%; min-width: 0; padding: 18px 112px 18px 20px; border: 2px solid #f0f0f0;
    border-radius: var(--border-radius); font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(8,102,255,.12); }
.btn-paste {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%); background: #f3f3f3; border: 0;
    padding: 8px 12px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 700;
}
.btn-paste:hover { background: #eaeaea; }
.btn-main {
    background: linear-gradient(135deg, #0866ff, #1877f2); color: white; border: none; padding: 17px 28px; border-radius: var(--border-radius);
    font-size: 1rem; font-weight: 800; cursor: pointer; min-width: 190px;
    display: flex; justify-content: center; align-items: center; transition: transform .2s, background .2s, opacity .2s;
}
.btn-main:hover:not(:disabled) { background: linear-gradient(135deg, #0759df, #0866ff); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(8,102,255,.22); }
.btn-main:disabled { cursor: wait; opacity: .72; }
.tool-hint { margin: 14px auto 0; max-width: 760px; color: #777; font-size: .84rem; }
.trust-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; color: #555; font-size: .88rem; font-weight: 600; }
.trust-badges span::first-letter { color: var(--primary); }
.loader { width: 24px; height: 24px; border: 3px solid rgba(255,255,255,.35); border-radius: 50%; border-top-color: white; animation: spin .8s infinite linear; }
@keyframes spin { to { transform: rotate(360deg); } }


.platform-eyebrow {
    width: fit-content; max-width: 100%; margin: 0 auto 18px; padding: 7px 12px 7px 8px;
    border: 1px solid #d6e7ff; border-radius: 999px; background: rgba(255,255,255,.82);
    display: flex; align-items: center; gap: 8px; color: #385898; font-size: .82rem; font-weight: 800;
    box-shadow: 0 8px 22px rgba(8,102,255,.07);
}
.platform-mark { background: var(--primary); color: white; border-radius: 50%; display: inline-grid; place-items: center; font: 800 16px/1 Arial,sans-serif; }
.platform-mark-small { width: 25px; height: 25px; }
.hero::before, .hero::after {
    content: ""; position: absolute; pointer-events: none; border-radius: 50%; filter: blur(2px); opacity: .5;
}
.hero { position: relative; overflow: hidden; }
.hero::before { width: 220px; height: 220px; right: -90px; top: 40px; background: rgba(8,102,255,.10); }
.hero::after { width: 160px; height: 160px; left: -70px; bottom: 18px; background: rgba(24,119,242,.08); }
.hero .container { position: relative; z-index: 1; }
.downloader-card { border-color: #dce8f8; }
.btn-paste { color: #385898; background: #edf4ff; }
.btn-paste:hover { background: #e2edff; }
.trust-badges span { padding: 7px 10px; border-radius: 999px; background: #f5f9ff; border: 1px solid #e1ecfb; }
.feature-card { background: linear-gradient(180deg, #f8fbff, #f0f2f5); border-color: #e6edf7; }
.tool-card { background: #f7f9fc; border: 1px solid #e5eaf2; }
.tool-card:hover { border-color: #c9dcfb; }
.footer { border-top-color: #dfe7f2; background: #f7f9fc; }

/* Sections */
.section-block { padding: 82px 0; }
.features { background: white; }
.section-title { text-align: center; font-size: clamp(1.85rem, 4vw, 2.35rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 44px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.feature-card, .tool-card { padding: 34px; border-radius: 20px; background: var(--light); border: 1px solid transparent; }
.feature-card { transition: transform .25s, box-shadow .25s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.feature-card .icon { width: 50px; height: 50px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 15px; background: #e7f3ff; color: var(--primary); }
.feature-card .icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.feature-card h3, .tool-card h3 { margin-bottom: 8px; font-size: 1.12rem; }
.feature-card p, .tool-card p { color: #565656; }
.how-to { background: #fcfcfc; }
.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 34px; }
.step { text-align: center; }
.step-num { width: 50px; height: 50px; background: var(--primary); color: white; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; font-weight: 800; box-shadow: 0 8px 18px rgba(255,0,51,.18); }
.step h3 { margin-bottom: 8px; font-size: 1.08rem; }
.step p { color: #5a5a5a; }
.seo-content { padding-top: 82px; padding-bottom: 22px; max-width: 850px; }
.seo-content h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); line-height: 1.25; margin-bottom: 16px; }
.seo-content h3 { font-size: 1.35rem; margin: 32px 0 10px; }
.seo-content p { margin-bottom: 16px; color: #444; }
.article-lead { font-size: 1.08rem; }
.faq { max-width: 850px; }
.accordion details { background: var(--light); margin-bottom: 12px; border-radius: 14px; border: 1px solid #efefef; overflow: hidden; }
.accordion summary { font-weight: 750; cursor: pointer; list-style: none; padding: 18px 20px; position: relative; padding-right: 48px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; position: absolute; right: 20px; top: 14px; font-size: 1.45rem; color: var(--primary); }
.accordion details[open] summary::after { content: '−'; }
.accordion .content { padding: 0 20px 18px; color: #555; }
.related-tools { padding-top: 35px; }
.tool-card { display: block; text-decoration: none; transition: transform .2s, border-color .2s, background .2s; }
.tool-card:hover { transform: translateY(-3px); border-color: #ffd2da; background: #fff8f9; }
.tool-link { display: inline-block; margin-top: 14px; color: var(--primary); font-weight: 800; font-size: .92rem; }

/* Download results */
.result-container { margin: 30px auto 0; max-width: 720px; }
.result-card { background: white; border-radius: 18px; box-shadow: var(--shadow); display: flex; padding: 18px; gap: 20px; text-align: left; animation: fadeIn .35s ease-out; border: 1px solid #f1f1f1; }
.video-preview { position: relative; flex: 0 0 150px; }
.video-preview video, .video-preview img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; background: #111; display: block; }
.duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.76); color: white; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.video-details { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.video-title { font-size: 1.15rem; line-height: 1.35; margin-bottom: 5px; word-break: break-word; }
.author { color: #666; font-size: .9rem; margin-bottom: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; font-size: .85rem; color: #444; }
.download-actions { display: grid; gap: 9px; }
.btn-download-now, .btn-download-server {
    display: inline-block; background: var(--primary); color: white; padding: 11px 16px; border-radius: 9px;
    text-decoration: none; font-weight: 750; text-align: center; transition: background .2s, transform .2s;
}
.btn-download-now:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-download-server { background: var(--dark); }
.result-error { margin: 24px auto 0; max-width: 700px; background: #fff4f6; border: 1px solid #ffd7df; color: #a31532; padding: 14px 16px; border-radius: 12px; font-weight: 650; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Notifications */
.notification-container { position: fixed; top: 82px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.notification-toast { pointer-events: auto; min-width: 280px; max-width: 400px; background: #111; color: white; border-left: 4px solid var(--primary); padding: 14px 15px; border-radius: 9px; box-shadow: 0 10px 20px rgba(0,0,0,.22); display: flex; justify-content: space-between; align-items: center; gap: 12px; animation: slideIn .25s ease-out forwards; }
.notification-content { font-size: .9rem; font-weight: 600; }
.notification-close { background: none; border: 0; color: #ff6583; font-size: 20px; cursor: pointer; line-height: 1; }
.fade-out { animation: fadeOut .22s ease-in forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { transform: translateX(20px); opacity: 0; } }

/* Footer */
.footer { background: var(--dark); color: white; padding: 58px 0 22px; margin-top: 72px; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.footer-logo { color: white; display: inline-block; margin-bottom: 8px; }
.footer-grid p { color: #aaa; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: #aaa; text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: white; }
.disclaimer { margin-top: 34px; font-size: .82rem; color: #777; border-top: 1px solid #303030; padding-top: 18px; }
.copyright { margin-top: 14px; color: #666; font-size: .8rem; }

:focus-visible { outline: 3px solid rgba(255,0,51,.35); outline-offset: 3px; }

@media (max-width: 860px) {
    .nav-toggle { display: block; margin-left: auto; }
    .nav-menu {
        display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; margin: 0;
        padding: 14px 20px 18px; background: white; border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0,0,0,.05);
        flex-direction: column; align-items: stretch; gap: 5px;
    }
    .nav-menu.open { display: flex; }
    .nav-link { padding: 11px 12px; }
    .language-menu { margin: 4px 0 0; }
    .language-menu summary { justify-content: space-between; }
    .language-dropdown {
        position: static; width: 100%; min-width: 0; max-height: min(52vh, 420px); max-height: min(52dvh, 420px);
        margin-top: 7px; overflow-y: auto; box-shadow: none; border-radius: 10px;
    }
    .grid, .steps-grid { grid-template-columns: 1fr; }
    .section-block { padding: 64px 0; }
    .feature-card { padding: 28px; }
}

@media (max-width: 680px) {
    .hero { padding: 50px 0 68px; }
    .downloader-card { flex-direction: column; padding: 10px; border-radius: 20px; }
    .btn-main { width: 100%; min-width: 0; }
    .trust-badges { gap: 8px 14px; }
    .result-card { flex-direction: column; }
    .video-preview { flex: none; }
    .video-preview video, .video-preview img { height: 280px; }
    .footer-grid { flex-direction: column; }
    .footer-links { flex-direction: column; gap: 9px; }
}

@media (max-width: 420px) {
    .container { padding-left: 16px; padding-right: 16px; }
    h1 { font-size: 2.25rem; }
    .btn-paste span { display: none; }
    input[type="url"], input[type="text"] { padding-right: 58px; }
    .notification-container { left: 12px; right: 12px; top: 74px; }
    .notification-toast { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Legal and trust pages */
.legal-hero { padding: 64px 0 36px; background: linear-gradient(180deg, #fff8fa 0%, #fff 100%); border-bottom: 1px solid var(--border); }
.legal-shell { max-width: 860px; }
.legal-eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin: 20px 0 8px; }
.legal-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; margin-bottom: 18px; }
.legal-intro { font-size: 1.08rem; color: #555; max-width: 760px; }
.legal-updated { margin-top: 18px; color: #747474; font-size: .9rem; }
.legal-content { padding-top: 42px; padding-bottom: 18px; }
.legal-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.legal-section:first-child { padding-top: 0; }
.legal-section h2 { font-size: 1.45rem; margin-bottom: 12px; }
.legal-section p { color: #4f4f4f; margin-top: 10px; }
.legal-contact-card { margin-top: 30px; padding: 24px; border: 1px solid #ffd9e0; background: #fff7f9; border-radius: 16px; }
.legal-contact-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.legal-contact-card a { color: var(--primary); font-weight: 800; overflow-wrap: anywhere; }
.legal-contact-note { color: #666; font-size: .92rem; }

/* Cloudflare Turnstile is public-client verification only; secrets remain server-side. */
.turnstile-container {
  width: 100%;
  min-height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.75rem;
}

.turnstile-container:empty {
  min-height: 0;
  margin-top: 0;
}

/* Shared creator-tools and guides dropdowns: rendered on every page type. */
.tools-menu .tools-dropdown { min-width: 280px; max-height: 70vh; overflow-y: auto; }
.tools-menu summary span { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guides-menu .guides-dropdown { min-width: 320px; }
.related-guides .grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.guide-card-link { display: block; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; border: 1px solid #efefef; }
.guide-card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: #ffd3dc; }

@media (max-width: 1040px) and (min-width: 861px) {
  .nav { gap: 12px; }
  .nav-menu { gap: 4px; }
  .nav-link { padding-left: 8px; padding-right: 8px; font-size: .88rem; }
  .language-menu summary { padding-left: 8px; padding-right: 8px; font-size: .86rem; }
  .tools-menu summary span { max-width: 130px; }
}

@media (max-width: 860px) {
  .nav-menu { max-height: calc(100vh - 76px); overflow-y: auto; }
  .tools-menu .tools-dropdown, .guides-menu .guides-dropdown { min-width: 0; max-height: none; overflow: visible; }
  .tools-menu summary span { max-width: none; }
}

/* Multilingual/RTL hardening */
.language-dropdown-locales {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
[dir="rtl"] .nav-menu { margin-left: 0; margin-right: auto; }
[dir="rtl"] .language-menu { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .language-dropdown { right: auto; left: 0; text-align: right; }
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="text"] { padding: 18px 20px 18px 112px; text-align: right; }
[dir="rtl"] .btn-paste { right: auto; left: 9px; }
[dir="rtl"] .accordion summary { padding-right: 20px; padding-left: 48px; }
[dir="rtl"] .accordion summary::after { right: auto; left: 20px; }
[dir="rtl"] .result-card,
[dir="rtl"] .media-demo-card { text-align: right; }
[dir="rtl"] .demo-card-label { left: auto; right: 12px; }
[dir="rtl"] .demo-play { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .notification-container { right: auto; left: 20px; }
[dir="rtl"] .notification-toast { border-left: 0; border-right: 4px solid var(--primary); }

@media (max-width: 860px) {
    [dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }
    [dir="rtl"] .language-menu { margin: 4px 0 0; }
    [dir="rtl"] .language-dropdown { text-align: right; }
}

@media (max-width: 680px) {
    .language-dropdown-locales { max-height: min(50vh, 380px); max-height: min(50dvh, 380px); }
}

@media (max-width: 520px) {
    .language-dropdown { grid-template-columns: 1fr; }
}

.video-placeholder { width:100%; height:200px; border-radius:12px; display:grid; place-items:center; background:#111; color:#fff; font-size:3rem; }
.processing-state { margin:24px auto 0; color:#555; font-weight:650; }

[dir="rtl"] .logo { flex-direction: row-reverse; }
[dir="rtl"] .platform-eyebrow { direction: rtl; }
.result-card { border-color: #dce8f8 !important; }
.btn-download-now { background: linear-gradient(135deg, #0866ff, #1877f2) !important; }
.notification-toast { border-left-color: #0866ff !important; }
@media (max-width: 680px) {
    .brand-word { font-size: 20px; }
    .brand-icon { width: 31px; height: 31px; border-radius: 9px; }
    .platform-eyebrow { font-size: .75rem; }
}
