:root {
  --bg: #061024;
  --bg2: #0a1730;
  --panel: #0d1c38;
  --panel2: #0f2140;
  --panel-line: rgba(76, 194, 255, 0.14);
  --text: #c6d4ec;
  --heading: #eaf2ff;
  --muted: #8095b8;
  --cyan: #4cc2ff;
  --blue: #2e7dff;
  --gold: #f6d66b;
  --good: #34d399;
  --warn: #f6b26b;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 15% -5%, rgba(46, 125, 255, 0.22), transparent 60%),
    radial-gradient(50vw 35vh at 95% 0%, rgba(76, 194, 255, 0.16), transparent 60%),
    radial-gradient(40vw 30vh at 60% 100%, rgba(246, 214, 107, 0.06), transparent 60%);
}
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 5vw, 56px);
  backdrop-filter: blur(10px);
  background: rgba(6, 16, 36, 0.7);
  border-bottom: 1px solid var(--panel-line);
  position: sticky; top: 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; letter-spacing: .5px;
  color: #05203f; background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 6px 18px rgba(76, 194, 255, 0.35);
}
.brand-logo { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; box-shadow: 0 6px 18px rgba(76, 194, 255, 0.3); }
.brand-name { display: flex; flex-direction: column; color: var(--heading); font-weight: 800; font-size: 16px; line-height: 1.1; }
.brand-name small { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .5px; }
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; transition: .2s;
}
.site-nav a:hover { background: rgba(76, 194, 255, 0.08); color: var(--heading); }
.site-nav a.active { color: #05203f; background: linear-gradient(135deg, var(--cyan), var(--blue)); }

/* ---------- Hero ---------- */
main { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 5vw, 40px) 64px; }
.hero { text-align: center; margin-bottom: 32px; }
.hero-tag {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--cyan);
  background: rgba(76, 194, 255, 0.1); border: 1px solid var(--panel-line);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { color: var(--heading); font-size: clamp(30px, 6vw, 52px); line-height: 1.08; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.5px; }
.grad { background: linear-gradient(100deg, var(--cyan), var(--blue) 60%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 640px; margin: 0 auto; color: var(--text); font-size: clamp(15px, 2.2vw, 17px); }
.hero-sub b { color: var(--heading); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed rgba(76, 194, 255, 0.35);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 28, 56, 0.7), rgba(10, 23, 48, 0.4));
  padding: clamp(32px, 6vw, 60px); text-align: center; cursor: pointer;
  transition: .25s; box-shadow: var(--shadow);
}
.dropzone:hover, .dropzone.drag { border-color: var(--cyan); background: linear-gradient(180deg, rgba(46, 125, 255, 0.14), rgba(10, 23, 48, 0.5)); transform: translateY(-2px); }
.dz-icon {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px; color: #05203f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 30px rgba(76, 194, 255, 0.4); animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-7px); } }
.dz-title { font-size: 20px; font-weight: 700; color: var(--heading); }
.dz-or { margin: 6px 0; color: var(--muted); }
.dz-browse { background: none; border: none; color: var(--cyan); font-weight: 700; cursor: pointer; font-size: 15px; text-decoration: underline; }
.dz-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 14px; flex-wrap: wrap; }
.stats { color: var(--text); font-size: 14px; }
.stats b { color: var(--cyan); }
.toolbar-actions { display: flex; gap: 10px; }
.btn { border: 1px solid var(--panel-line); border-radius: 11px; padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer; transition: .2s; }
.btn-primary { color: #05203f; background: linear-gradient(135deg, var(--cyan), var(--blue)); border: none; box-shadow: 0 8px 22px rgba(76, 194, 255, 0.32); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: rgba(76, 194, 255, 0.06); color: var(--text); }
.btn-ghost:hover { background: rgba(76, 194, 255, 0.12); color: var(--heading); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card-thumb { position: relative; aspect-ratio: 1; background: #05122a url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="10" height="10" fill="%230a1a34"/><rect x="10" y="10" width="10" height="10" fill="%230a1a34"/></svg>'); display: grid; place-items: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge-good { background: rgba(52, 211, 153, 0.16); color: var(--good); border: 1px solid rgba(52, 211, 153, 0.4); }
.badge-warn { background: rgba(246, 178, 107, 0.16); color: var(--warn); border: 1px solid rgba(246, 178, 107, 0.4); }
.badge-run { background: rgba(76, 194, 255, 0.16); color: var(--cyan); border: 1px solid var(--panel-line); }
.card-compare { position: absolute; bottom: 8px; right: 8px; font-size: 11px; font-weight: 700; background: rgba(6, 16, 36, 0.78); color: var(--heading); border: 1px solid var(--panel-line); border-radius: 8px; padding: 5px 9px; cursor: pointer; }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 8px; }
.card-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-dl { font-size: 12px; font-weight: 700; color: var(--cyan); background: none; border: none; cursor: pointer; white-space: nowrap; }
.card-dl:hover { text-decoration: underline; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(76, 194, 255, 0.25); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Disclaimer / footer ---------- */
.disclaimer { margin-top: 34px; font-size: 12.5px; color: var(--muted); background: rgba(13, 28, 56, 0.5); border: 1px solid var(--panel-line); border-radius: 12px; padding: 14px 16px; }
.disclaimer b { color: var(--warn); }
.site-footer { border-top: 1px solid var(--panel-line); padding: 22px clamp(16px, 5vw, 56px); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }

/* ---------- Modal compare ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 8, 20, 0.82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-body { position: relative; max-width: 92vw; max-height: 88vh; }
.modal-close { position: absolute; top: -14px; right: -14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--panel); color: var(--heading); font-size: 16px; cursor: pointer; border: 1px solid var(--panel-line); }
.compare { position: relative; max-width: 92vw; max-height: 82vh; overflow: hidden; border-radius: 14px; user-select: none; }
.compare img { display: block; max-width: 92vw; max-height: 82vh; }
.cmp-before-wrap { position: absolute; inset: 0; width: 50%; overflow: hidden; border-right: 2px solid var(--cyan); }
.cmp-before-wrap img { max-width: none; height: 100%; }
.cmp-range { position: absolute; bottom: 14px; left: 10%; width: 80%; z-index: 4; accent-color: var(--cyan); }
.cmp-label { position: absolute; top: 12px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(6, 16, 36, 0.8); color: var(--heading); }
.cmp-label-l { left: 12px; } .cmp-label-r { right: 12px; }

/* grain overlay */
.grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="140" height="140" filter="url(%23n)"/></svg>'); }

/* trust chips */
.trust { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.trust-chip { font-size: 13px; font-weight: 600; color: var(--text); background: rgba(13,28,56,.6); border: 1px solid var(--panel-line); padding: 8px 14px; border-radius: 999px; }

/* mode segmented */
.modebar { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 26px 0 20px; flex-wrap: wrap; }
.modebar-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.autodetect { font-size: 13.5px; font-weight: 600; color: var(--cyan); background: rgba(76,194,255,.1); border: 1px solid var(--panel-line); padding: 9px 18px; border-radius: 999px; }
.autodetect b { color: var(--heading); }
.segmented { display: inline-flex; background: rgba(13,28,56,.7); border: 1px solid var(--panel-line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg { border: none; background: transparent; color: var(--text); font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 9px; cursor: pointer; transition: .2s; display: flex; align-items: center; gap: 6px; }
.seg em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--gold); background: rgba(246,214,107,.14); padding: 2px 6px; border-radius: 6px; }
.seg:hover { color: var(--heading); }
.seg.active { color: #05203f; background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 6px 16px rgba(76,194,255,.3); }
.seg.active em { color: #05203f; background: rgba(5,32,63,.18); }

/* section titles */
.section-title { text-align: center; color: var(--heading); font-size: clamp(20px,3.5vw,26px); font-weight: 800; margin: 48px 0 22px; }

/* steps */
.steps-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 22px; text-align: center; }
.step-n { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 800; color: #05203f; background: linear-gradient(135deg,var(--cyan),var(--blue)); margin-bottom: 12px; }
.step b { display: block; color: var(--heading); margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 13px; margin: 0; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--heading); padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--cyan); margin-right: 10px; font-weight: 800; }
.faq details[open] summary::before { content: "－"; }
.faq details p { color: var(--text); margin: 0 0 12px; font-size: 14px; }

/* video card */
.card-video .card-thumb { aspect-ratio: 16/10; }
.card-pre { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.card-video .card-thumb .spinner { display: none; }
.vprogress { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 8px; background: rgba(6,16,36,.7); border-radius: 999px; overflow: hidden; border: 1px solid var(--panel-line); }
.vprogress-bar { height: 100%; width: 0%; background: linear-gradient(90deg,var(--cyan),var(--blue)); transition: width .3s; }
.card-err { color: var(--warn); font-size: 12px; padding: 12px; text-align: center; }

/* Before/After slider (kéo trái phải) */
.ba { position: relative; overflow: hidden; border-radius: 12px; user-select: none; touch-action: none; cursor: ew-resize; background: #05122a; }
.ba img { display: block; width: 100%; height: auto; pointer-events: none; }
.ba-before { position: absolute; top: 0; left: 0; height: 100%; width: 50%; overflow: hidden; }
.ba-before img { position: absolute; top: 0; left: 0; height: 100%; width: var(--baw, 100%); max-width: none; object-fit: cover; }
.ba-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--cyan); box-shadow: 0 0 12px rgba(76,194,255,.7); transform: translateX(-1px); }
.ba-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,var(--cyan),var(--blue)); color: #05203f; display: grid; place-items: center; font-weight: 800; font-size: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.ba-tag { position: absolute; top: 10px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(6,16,36,.82); color: var(--heading); pointer-events: none; }
.ba-tag-l { left: 10px; } .ba-tag-r { right: 10px; color: var(--cyan); }

.card-thumb.thumb-ba { display: block; }
.card-thumb.thumb-ba .ba { width: 100%; height: 100%; border-radius: 0; }
.card-thumb.thumb-ba .ba-after, .card-thumb.thumb-ba .ba-before img { height: 100%; object-fit: cover; }

/* Demo showcase */
.demo { margin: 8px 0 8px; }
.demo-wrap { max-width: 720px; margin: 0 auto; border: 1px solid var(--panel-line); border-radius: 16px; padding: 10px; background: var(--panel); box-shadow: var(--shadow); }
.demo-cap { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }

/* Closing CTA */
.cta { margin: 56px auto 0; max-width: 860px; text-align: center; background: linear-gradient(135deg, rgba(46,125,255,.16), rgba(76,194,255,.10)); border: 1px solid var(--panel-line); border-radius: 22px; padding: 40px 24px; }
.cta h2 { color: var(--heading); font-size: clamp(22px,4vw,30px); font-weight: 800; margin: 0 0 10px; }
.cta p { color: var(--text); max-width: 560px; margin: 0 auto 22px; }
.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta .btn { padding: 12px 24px; font-size: 15px; }

@media (max-width: 560px) {
  .site-nav a:not(.active) { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .steps-row { grid-template-columns: 1fr; }
  .ba-handle { width: 34px; height: 34px; }
}
