:root {
  --bg: #0b1120;
  --bg-2: #111a2e;
  --card: #172036;
  --card-2: #1f2a44;
  --line: #27334d;
  --text: #eef2ff;
  --muted: #9aa6c2;
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --accent: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59, 130, 246, 0.25), transparent 60%),
    radial-gradient(800px 500px at 100% 10%, rgba(34, 197, 94, 0.18), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-2); }

/* NAV */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(11, 17, 32, 0.7);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img.brand-icon { width: 32px; height: 32px; border-radius: 8px; }
.brand-icon { display: inline-flex; }
.site-links { display: flex; gap: 20px; align-items: center; font-size: 0.95rem; }
.site-links a { color: var(--muted); }
.site-links a:hover { color: var(--text); }
.site-links a.nav-cta {
  color: white;
  background: var(--brand);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.site-links a.nav-cta:hover { background: var(--brand-2); color: white; }
.lang-picker { display: inline-flex; align-items: center; }
.lang-picker select {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 150px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lang-picker select:hover { border-color: #3b4b73; }
.lang-picker select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.lang-picker option { background: var(--card); color: var(--text); }
@media (max-width: 600px) {
  .site-links a:not(.nav-cta) { display: none; }
  .lang-picker select { max-width: 110px; font-size: 0.82rem; }
}

/* RTL support */
html[dir="rtl"] .hero-inner { direction: rtl; }
html[dir="rtl"] .hero-sub { margin-right: 0; }
html[dir="rtl"] .site-nav { direction: rtl; }
html[dir="rtl"] .lang-picker select {
  padding: 6px 10px 6px 28px;
  background-position: 14px 50%, 9px 50%;
}

/* SECTION CONTAINER */
section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px;
}
section.hero { padding-top: 48px; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  text-align: center;
}
.section-title.sm { font-size: 1.25rem; margin-bottom: 0; text-align: left; }
.section-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
  line-height: 1.5;
}
.section-sub.center { text-align: center; }
.inline-link { color: var(--brand-2); font-weight: 600; white-space: nowrap; }

/* HERO */
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
}
.hero-icon {
  width: 86px; height: 86px; border-radius: 22px;
  box-shadow: 0 20px 50px rgba(59, 130, 246, 0.35);
  margin-bottom: 18px;
}
.hero-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--brand-2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero-title .gradient {
  background: linear-gradient(90deg, var(--brand-2), #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 540px;
}
@media (max-width: 860px) { .hero-sub { margin-left: auto; margin-right: auto; } }
.hero-ctas { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
@media (max-width: 860px) { .hero-ctas { justify-content: center; } }
.app-store-badge {
  display: inline-flex;
  transition: transform 0.12s ease, filter 0.15s ease;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
}
.app-store-badge:hover { transform: translateY(-2px); filter: drop-shadow(0 12px 24px rgba(0,0,0,0.5)); }
.secondary-cta {
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}
.secondary-cta:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.hero-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  color: var(--muted); font-size: 0.9rem;
}
@media (max-width: 860px) { .hero-meta { justify-content: center; } }
.meta-label { color: var(--text); font-weight: 600; }
.meta-sep { opacity: 0.4; }

/* PHONE MOCK */
.hero-visual { display: flex; justify-content: center; }
.phone-mock {
  width: 280px;
  aspect-ratio: 9 / 18;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 40px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  box-shadow:
    0 30px 80px rgba(2, 6, 23, 0.6),
    0 0 0 10px rgba(255,255,255,0.02),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.phone-mock::before {
  content: '';
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px;
  background: #000;
  border-radius: 20px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  padding: 40px 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  color: var(--text);
}
.mock-bar { display: flex; justify-content: center; gap: 4px; margin-bottom: 2px; }
.mock-bar span { width: 22px; height: 3px; background: rgba(255,255,255,0.25); border-radius: 2px; }
.mock-bar span:first-child { background: var(--brand); }
.mock-title { font-size: 1rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.mock-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e3a8a, #164e63);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.mock-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 0.7rem;
}
.mock-stats > div { background: rgba(255,255,255,0.06); padding: 8px; border-radius: 10px; }
.mock-stats .lbl { display: block; color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.mock-stats .val { font-weight: 700; font-size: 0.85rem; }
.mock-stats .hi { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.25); }
.mock-stats .hi .val { color: var(--accent); }
.mock-stats .arrow { background: transparent; padding: 0; text-align: center; color: var(--muted); font-weight: 700; }
.mock-bar-full { height: 6px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.mock-bar-fill { width: 85%; height: 100%; background: linear-gradient(90deg, var(--brand), #22c55e); border-radius: 99px; animation: mock-progress 3s ease-in-out infinite; }
@keyframes mock-progress {
  0%, 100% { width: 85%; }
  50% { width: 90%; }
}
.mock-chip {
  align-self: center;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-2);
}
@media (max-width: 860px) {
  .phone-mock { width: 240px; }
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  background: transparent;
  color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--brand); color: white; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: #3b4b73; background: rgba(255,255,255,0.04); }
.btn.wide { width: 100%; padding: 16px; font-size: 1.05rem; }
.btn.tiny { padding: 6px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* APP PANEL */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.demo-wrap .panel { max-width: 900px; margin: 0 auto; }
.demo-header { margin-bottom: 24px; }
.demo-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 18px auto 0;
  max-width: 640px;
}

.step.hidden { display: none; }
.step h2 { margin: 0 0 16px; font-size: 1.25rem; letter-spacing: -0.01em; }

/* DROPZONE */
.dropzone {
  display: block;
  border: 2px dashed #3b4b73;
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255,255,255,0.02);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: rgba(59, 130, 246, 0.08);
  color: var(--brand-2);
}
.dropzone-inner p { margin: 12px 0 4px; font-size: 1.05rem; }
.dropzone-inner small { color: var(--muted); }
.loader-status {
  margin-top: 16px; text-align: center; color: var(--muted); font-size: 0.85rem;
}

/* INPUT SUMMARY */
.input-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.input-summary video {
  width: 120px; height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}
.input-summary h3 { margin: 0 0 4px; font-size: 1rem; word-break: break-all; }
.input-summary p { margin: 0 0 8px; color: var(--muted); font-size: 0.88rem; }

/* PRESETS */
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 540px) { .preset-grid { grid-template-columns: 1fr; } }
.preset {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.preset:hover { border-color: #3b4b73; }
.preset.active { border-color: var(--brand); background: rgba(59, 130, 246, 0.12); }
.preset .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.preset .icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: rgba(59,130,246,0.2); border-radius: 8px; color: var(--brand-2); }
.preset .name { font-weight: 700; font-size: 1rem; }
.preset .desc { color: var(--muted); font-size: 0.85rem; margin: 0; }
.preset .tag { margin-top: 8px; font-size: 0.75rem; color: var(--brand-2); }

/* ADVANCED */
.advanced { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--card); margin-bottom: 20px; }
.advanced summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.advanced[open] summary { margin-bottom: 14px; }
.adv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.adv-grid label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.adv-grid label.full { grid-column: 1 / -1; }
.adv-grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.adv-grid select, .adv-grid input[type=range] {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 10px;
  font-family: inherit; font-size: 0.95rem;
}
.adv-grid input[type=range] { padding: 0; height: 36px; }
.estimate { margin: 12px 0 0; color: var(--muted); font-size: 0.88rem; }
@media (max-width: 540px) { .adv-grid { grid-template-columns: 1fr; } }

/* PROGRESS */
.progress { width: 100%; height: 14px; background: var(--card-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress .bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.2s ease; }
.progress-text { margin: 12px 0 20px; color: var(--muted); font-size: 0.92rem; }

/* RESULT */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.result-card.highlight { border-color: var(--accent); background: rgba(34,197,94,0.06); }
.result-card h4 { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.result-card .big { margin: 0 0 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.result-card small { color: var(--muted); }
.result-card.highlight small { color: var(--accent); font-weight: 600; }

.compare {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.compare video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare #newVideo { clip-path: inset(0 0 0 50%); }
.compare #compareSlider {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; z-index: 2;
  margin: 0;
}
.compare::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: var(--compare-x, 50%);
  width: 2px;
  background: white;
  transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
  pointer-events: none;
}

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.result-actions .btn { flex: 1; min-width: 140px; }

/* FEATURES */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature:hover { transform: translateY(-3px); border-color: #3b4b73; }
.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: inline-block;
}
.feature h3 { margin: 0 0 8px; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); line-height: 1.5; }

/* HOW IT WORKS */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .how-grid { grid-template-columns: 1fr; } }
.how-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.how-num {
  width: 42px; height: 42px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #22c55e);
  color: white; border-radius: 50%; font-weight: 800; font-size: 1.1rem;
}
.how-step h3 { margin: 0 0 8px; }
.how-step p { margin: 0; color: var(--muted); line-height: 1.5; }

/* CTA STRIP */
.cta-strip {
  max-width: none;
  padding: 0;
  margin-top: 40px;
}
.cta-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(34, 197, 94, 0.1));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 40px 24px;
  flex-wrap: wrap;
}
.cta-inner h2 { margin: 0 0 6px; font-size: 1.5rem; }
.cta-inner p { margin: 0; color: var(--muted); max-width: 500px; }
@media (max-width: 700px) { .cta-inner { text-align: center; justify-content: center; } }

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-brand strong { font-size: 1rem; }
.footer-sub { color: var(--muted); margin-top: 4px; font-size: 0.82rem; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
.footer-copy { text-align: right; font-size: 0.82rem; }
@media (max-width: 720px) { .footer-copy { text-align: center; } }

/* HISTORY */
.history-wrap { max-width: 900px; }
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.history-head h2 { margin: 0; }
.history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.history-item .thumb { width: 64px; height: 48px; border-radius: 8px; background: #000; object-fit: cover; }
.history-item .meta { min-width: 0; }
.history-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .sub { color: var(--muted); font-size: 0.85rem; }
.history-item .saved { color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.history-item button { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.history-item button:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.muted { color: var(--muted); }

.foot { margin-top: 60px; color: var(--muted); text-align: center; font-size: 0.88rem; }
.foot a { color: var(--brand-2); }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--card-2); color: var(--text);
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
  z-index: 100;
  max-width: 80vw;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }
