:root {
  --bg: #07101f;
  --bg-2: #0c1830;
  --panel: rgba(17, 28, 53, 0.7);
  --panel-strong: rgba(26, 39, 71, 0.88);
  --text: #f5f8ff;
  --muted: #9fb2d7;
  --primary: #6d8cff;
  --secondary: #8e5bff;
  --accent: #38d8b2;
  --border: rgba(255,255,255,.12);
  --shadow: 0 28px 80px rgba(0,0,0,.35);
  --surface: rgba(255,255,255,.04);
  --surface-2: rgba(255,255,255,.07);
  --success: #27d17c;
  --danger: #ff6780;
}

html[data-theme='light'] {
  --bg: #f4f7ff;
  --bg-2: #eaf0ff;
  --panel: rgba(255,255,255,.86);
  --panel-strong: rgba(255,255,255,.95);
  --text: #12203c;
  --muted: #5f7090;
  --primary: #426cff;
  --secondary: #7b57ff;
  --accent: #09b88d;
  --border: rgba(18,32,60,.1);
  --shadow: 0 28px 80px rgba(72,92,138,.18);
  --surface: rgba(255,255,255,.8);
  --surface-2: rgba(255,255,255,.92);
  --success: #10a867;
  --danger: #e14a65;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109,140,255,.2), transparent 25%),
    radial-gradient(circle at top right, rgba(142,91,255,.18), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  transition: background .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button { border: 0; }
main { padding-bottom: 110px; }
.container { width: min(1220px, calc(100% - 28px)); margin: 0 auto; }
.hidden { display: none !important; }
.mt-24 { margin-top: 24px; }
.wrap { word-break: break-word; }

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: .45;
}

.ambient-one {
  top: -120px;
  left: -110px;
  background: rgba(109,140,255,.24);
}

.ambient-two {
  right: -120px;
  top: 140px;
  background: rgba(142,91,255,.22);
}

.site-shell,
.site-header,
.site-footer,
main {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand small {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 16px;
  padding: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  position: relative;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 2px;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
}

.nav a.active::after,
.nav a:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* theme toggle improved */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.theme-toggle-track {
  width: 80px;
  height: 44px;
  border-radius: 999px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 10px 24px rgba(0,0,0,.22);
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 8px 18px rgba(85,105,255,.34);
  transition: transform .26s ease;
}

html[data-theme='light'] .theme-toggle-thumb {
  transform: translateX(36px);
}

.theme-icon {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.88);
}

html[data-theme='light'] .theme-icon {
  color: rgba(18,32,60,.78);
}

.theme-icon svg {
  width: 16px;
  height: 16px;
}

/* buttons */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 18px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 18px 36px rgba(85,105,255,.28);
}

.btn-ghost {
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--text);
}

.btn-sm {
  min-height: 46px;
  padding: 10px 16px;
}

.btn.disabled,
.btn[disabled] {
  opacity: .55;
  pointer-events: none;
}

.ripple {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  transform: scale(0);
  animation: ripple .6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.7);
    opacity: 0;
  }
}

.section { padding: 84px 0; }
.section-soft { padding-top: 0; }

.hero-grid,
.upload-layout,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, .94fr);
  gap: 24px;
}

.hero-copy h1,
.section h1,
.upload-main-card h2 {
  margin: 14px 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}

.upload-main-card h2 { font-size: clamp(2rem, 4vw, 3rem); }

.hero-copy p,
.section p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.02rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(109,140,255,.14);
  border: 1px solid rgba(109,140,255,.22);
  color: color-mix(in srgb, var(--text) 88%, var(--primary));
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .76rem;
  font-weight: 800;
}

.card {
  border-radius: 28px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  box-shadow: var(--shadow);
  padding: 28px;
}

.glass {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 96%, transparent),
    color-mix(in srgb, var(--panel-strong) 92%, transparent)
  );
  backdrop-filter: blur(18px);
}

.hero-actions,
.actions-row,
.actions-column {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-actions { margin-top: 28px; }

.hero-metrics,
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.hero-metrics { margin-top: 28px; }

.metric-card,
.soft-card {
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
}

.metric-card strong,
.soft-card h3,
.price-card h3 {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.metric-card span,
.soft-card p { color: var(--muted); }

.hero-visual-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.visual-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(56,216,178,.14);
  color: #76f1cf;
  border: 1px solid rgba(56,216,178,.22);
}

.visual-panel {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.visual-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  border: 1px solid var(--border);
}

.visual-row span { color: var(--muted); }

.visual-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  bottom: -70px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(109,140,255,.34), rgba(109,140,255,0));
}

.compact-layout { align-items: stretch; }
.upload-main-card > p { margin-top: 0; }

.dropzone {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 24px 0 22px;
  border-radius: 28px;
  border: 1.5px dashed rgba(109,140,255,.35);
  background: linear-gradient(180deg, rgba(109,140,255,.12), rgba(142,91,255,.08));
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone.dragging,
.dropzone.has-file {
  border-color: rgba(56,216,178,.7);
  background: linear-gradient(180deg, rgba(56,216,178,.18), rgba(109,140,255,.1));
}

.dropzone-content {
  display: grid;
  gap: 10px;
  max-width: 360px;
}

.dropzone-content strong { font-size: 1.16rem; }
.dropzone-content span,
.muted-note { color: var(--muted); }

.label {
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 700;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preset {
  position: relative;
  overflow: hidden;
  text-align: left;
  min-height: 116px;
  border-radius: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.preset strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.preset span {
  color: var(--muted);
  line-height: 1.6;
}

.preset.active {
  border-color: rgba(109,140,255,.62);
  box-shadow: inset 0 0 0 1px rgba(109,140,255,.42), 0 18px 32px rgba(109,140,255,.16);
}

.progress-box {
  margin-top: 22px;
  border-radius: 22px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  border: 1px solid var(--border);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-head span { font-weight: 700; }

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .2s ease;
}

.result-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(56,216,178,.14);
  border: 1px solid rgba(56,216,178,.24);
  color: #74efcc;
  font-weight: 800;
}

.preview-shell {
  border-radius: 26px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.preview-video {
  display: block;
  width: 100%;
  min-height: 230px;
  max-height: 350px;
  background: #000;
}

.result-status-list {
  display: grid;
  gap: 0;
  margin: 20px 0 24px;
}

.result-status-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.result-status-item span { color: var(--muted); }

.result-status-item strong {
  max-width: 58%;
  text-align: right;
  word-break: break-word;
}

.message {
  margin-top: 18px;
  border-radius: 18px;
  padding: 15px 16px;
  border: 1px solid transparent;
  line-height: 1.6;
}

.message.success {
  color: #ecfff5;
  background: rgba(39,209,124,.16);
  border-color: rgba(39,209,124,.24);
}

.message.error {
  color: #fff1f4;
  background: rgba(255,103,128,.16);
  border-color: rgba(255,103,128,.24);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full { grid-column: 1 / -1; }

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(109,140,255,.52);
  box-shadow: 0 0 0 4px rgba(109,140,255,.12);
}

.table-wrap { overflow: hidden; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-size: .84rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
}

.big-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin: 0;
}

.site-footer {
  padding: 28px 0 110px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.04);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 24px;
}

.site-footer p,
.site-footer a,
.site-footer h5 { color: var(--muted); }

.site-footer h4,
.site-footer h5 {
  margin-top: 0;
  color: var(--text);
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

/* bottom nav: desktop hidden by default */
.bottom-nav {
  display: none;
}

.bottom-nav a {
  position: relative;
  overflow: hidden;
}

/* responsive */
@media (max-width: 1080px) {
  .hero-grid,
  .upload-layout,
  .contact-grid,
  .footer-grid,
  .cards-3,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .desktop-nav {
    display: none;
  }

  .nav-wrap {
    min-height: 78px;
  }
}

@media (max-width: 760px) {
  .section { padding: 70px 0; }
  .container { width: min(100% - 18px, 1220px); }
  .card { padding: 22px; border-radius: 24px; }

  .preset-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .nav-actions {
    gap: 8px;
  }

  .brand small,
  .btn-sm {
    display: none;
  }

  .theme-toggle {
    min-height: 44px;
  }

  .theme-toggle-track {
    width: 74px;
    height: 40px;
    padding: 0 9px;
  }

  .theme-toggle-thumb {
    width: 30px;
    height: 30px;
    top: 4px;
    left: 4px;
  }

  html[data-theme='light'] .theme-toggle-thumb {
    transform: translateX(34px);
  }

  .brand strong {
    font-size: .95rem;
  }

  .result-status-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-status-item strong {
    max-width: 100%;
    text-align: left;
  }

  th,
  td {
    padding: 14px 10px;
    font-size: .92rem;
  }

  /* mobile only bottom nav */
  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-radius: 24px;
    background: #111827;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 18px 40px rgba(0,0,0,.30);
    z-index: 60;
    transform: none;
    width: auto;
    backdrop-filter: none;
  }

  html[data-theme='light'] .bottom-nav {
    background: #ffffff;
    border-color: rgba(18,32,60,.08);
    box-shadow: 0 16px 34px rgba(72,92,138,.18);
  }

  .bottom-nav a {
    min-height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f2937;
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,.06);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }

  html[data-theme='light'] .bottom-nav a {
    background: #f3f6ff;
    color: #12203c;
    border-color: rgba(18,32,60,.08);
  }

  .bottom-nav a:hover,
  .bottom-nav a.active,
  .bottom-nav-center {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 14px 26px rgba(109,140,255,.28);
  }
}

@media (max-width: 520px) {
  .hero-copy h1,
  .section h1,
  .upload-main-card h2 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .brand {
    max-width: 62%;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .btn,
  .bottom-nav a {
    border-radius: 16px;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px;
    gap: 8px;
  }

  .bottom-nav a {
    min-height: 52px;
    font-size: .88rem;
  }
}