:root {
    --ink: #eff6ff;
    --muted: #94a3b8;
    --panel: rgba(15, 27, 45, .72);
    --panel-strong: #111f33;
    --line: rgba(148, 163, 184, .16);
    --blue: #28a8ff;
    --violet: #7067ff;
    --pink: #e75fcb;
    --bg: #07101d;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    background: radial-gradient(circle at 50% -15%, #142b49 0, var(--bg) 39rem);
    font-family: "DM Sans", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.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; }
[hidden] { display: none !important; }

.page-glow { position: fixed; z-index: -1; width: 28rem; height: 28rem; border-radius: 50%; filter: blur(110px); opacity: .1; pointer-events: none; }
.page-glow--one { top: 28%; left: -14rem; background: var(--blue); }
.page-glow--two { right: -13rem; bottom: 4%; background: var(--violet); }

.site-header, .site-footer, .main-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 84px; overflow: hidden; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-family: Manrope, sans-serif; font-weight: 800; font-size: 21px; text-decoration: none; letter-spacing: -.5px; }
.brand > span:last-child span { color: var(--blue); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 10px 30px rgba(40, 168, 255, .24); }
.brand-mark svg { width: 23px; }
.brand-logo { display: block; width: auto; max-width: min(220px, 55vw); height: 42px; max-height: 42px; object-fit: contain; object-position: left center; }
.header-pill { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: #cbd5e1; background: rgba(15, 27, 45, .45); font-size: 12px; }
.header-pill span { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 8px #3ddc97; vertical-align: 1px; }

.main-shell { padding: 82px 0 64px; }
.hero { width: min(850px, 100%); margin: 0 auto; text-align: center; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; margin-bottom: 18px; color: #62c1ff; font-size: 11px; font-weight: 700; letter-spacing: 2.1px; }
.eyebrow span { font-size: 8px; text-shadow: 0 0 9px var(--blue); }
.hero h1 { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(42px, 6.2vw, 70px); line-height: 1.06; letter-spacing: -3.5px; }
.hero h1 em { color: transparent; background: linear-gradient(90deg, #35b7ff, #8c72ff 55%, #f07bd6); -webkit-background-clip: text; background-clip: text; font-style: normal; }
.hero-copy { width: min(610px, 100%); margin: 20px auto 34px; color: var(--muted); font-size: 16px; line-height: 1.7; }

.search-card { position: relative; padding: 14px 14px 11px; border: 1px solid rgba(91, 163, 223, .3); border-radius: 18px; background: rgba(13, 25, 42, .86); box-shadow: 0 24px 80px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .03); backdrop-filter: blur(18px); }
.search-row { display: flex; gap: 10px; }
.url-field { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 13, 24, .75); transition: border .2s, box-shadow .2s; }
.url-field:focus-within { border-color: rgba(40, 168, 255, .65); box-shadow: 0 0 0 3px rgba(40, 168, 255, .1); }
.url-field svg { flex: 0 0 21px; color: #63758d; }
.url-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: white; background: transparent; font-size: 15px; }
.url-field input::placeholder { color: #607087; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 172px; border: 0; border-radius: 12px; color: white; background: linear-gradient(135deg, #219cf2, #596eee); font-weight: 700; box-shadow: 0 12px 25px rgba(48, 120, 237, .2); transition: transform .2s, filter .2s; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-button:disabled { cursor: wait; opacity: .75; }
.primary-button svg { width: 18px; }
.primary-button.is-loading svg { animation: nudge 1s infinite; }
.trust-row { display: flex; justify-content: center; gap: 28px; padding-top: 11px; color: #75869d; font-size: 10px; }
.trust-row span { display: flex; align-items: center; gap: 5px; }
.trust-row svg { width: 13px; }
.form-message { min-height: 0; color: var(--muted); font-size: 13px; text-align: left; transition: .2s; }
.form-message:not(:empty) { padding: 10px 8px 0; }
.form-message.is-error { color: #ff8fa3; }

.result-card { display: grid; grid-template-columns: 320px 1fr; width: min(850px, 100%); margin: 32px auto 0; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 25px 70px rgba(0,0,0,.28); animation: reveal .35s ease-out; }
.video-preview { position: relative; min-height: 230px; overflow: hidden; border-radius: 13px; background: #050b13; }
.video-preview img { width: 100%; height: 100%; object-fit: cover; }
.duration { position: absolute; right: 10px; bottom: 10px; padding: 4px 7px; border-radius: 6px; background: rgba(0,0,0,.78); font-size: 11px; font-weight: 700; }
.video-content { min-width: 0; padding: 6px 8px 2px 22px; }
.video-heading { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.video-heading p { margin: 0 0 5px; color: #54baff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.video-heading h2 { max-width: 400px; margin: 0; overflow: hidden; font-family: Manrope, sans-serif; font-size: 17px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { flex: 0 0 34px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; }
.icon-button:hover { color: white; border-color: rgba(40,168,255,.5); }
.icon-button svg { width: 16px; }
.format-tabs { display: flex; gap: 4px; margin: 17px 0 8px; padding: 3px; border-radius: 9px; background: rgba(3,9,17,.65); }
.format-tab { flex: 1; padding: 7px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.format-tab.is-active { color: white; background: #1b304b; }
.format-list { max-height: 280px; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #294766 transparent; }
.format-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.format-row > div { display: flex; align-items: center; gap: 9px; }
.format-row strong { font-size: 13px; }
.format-row span { padding: 3px 6px; border-radius: 5px; color: #8293aa; background: rgba(148,163,184,.08); font-size: 9px; }
.format-row button { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid rgba(40,168,255,.3); border-radius: 8px; color: #6ac6ff; background: rgba(40,168,255,.08); font-size: 11px; font-weight: 700; }
.format-row button:hover { color: white; background: rgba(40,168,255,.2); }
.format-row button:disabled { cursor: wait; opacity: .65; }
.format-row button svg { width: 13px; }
.rights-note, .empty-format { margin: 9px 0 0; color: #617087; font-size: 9px; }
.download-message { min-height: 0; margin-top: 0; font-size: 10px; font-weight: 600; }
.download-message:not(:empty) { margin-top: 8px; }
.download-message.is-working { color: #7bc9ff; }
.download-message.is-success { color: #63dfa8; }
.download-message.is-error { color: #ff8fa3; }
.download-frame { position: fixed; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; width: min(900px, 100%); margin: 86px auto 0; }
.features article { padding: 25px 24px; border: 1px solid var(--line); border-radius: 17px; background: rgba(13, 25, 42, .43); transition: transform .2s, border-color .2s; }
.features article:hover { transform: translateY(-3px); border-color: rgba(91, 163, 223, .3); }
.feature-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 16px; border-radius: 11px; }
.feature-icon svg { width: 20px; }
.feature-icon--blue { color: #4bc0ff; background: rgba(40, 168, 255, .1); }
.feature-icon--violet { color: #938cff; background: rgba(112, 103, 255, .11); }
.feature-icon--pink { color: #ed7dd8; background: rgba(231, 95, 203, .1); }
.features h2 { margin: 0 0 8px; font-family: Manrope, sans-serif; font-size: 15px; }
.features p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.site-footer { display: flex; justify-content: space-between; padding: 24px 0 32px; border-top: 1px solid var(--line); color: #627288; font-size: 11px; }
.is-embedded .main-shell { padding-top: 48px; }

@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }
@keyframes nudge { 50% { transform: translateX(3px); } }

@media (max-width: 720px) {
    .site-header, .site-footer, .main-shell { width: min(100% - 24px, 1120px); }
    .site-header { height: 70px; }
    .header-pill { display: none; }
    .brand-logo { max-width: 180px; height: 38px; }
    .main-shell { padding-top: 55px; }
    .hero h1 { letter-spacing: -2px; }
    .search-row { flex-direction: column; }
    .primary-button { min-height: 52px; }
    .trust-row { gap: 12px; flex-wrap: wrap; }
    .result-card { grid-template-columns: 1fr; }
    .video-preview { min-height: 190px; aspect-ratio: 16 / 9; }
    .video-content { padding: 18px 4px 4px; }
    .features { grid-template-columns: 1fr; margin-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
