:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e8f0ff;
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #e7f8ee;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e3eaf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px -12px rgba(37, 99, 235, 0.28);
  --shadow-lg: 0 28px 60px -24px rgba(15, 23, 42, 0.28);
  --radius: 18px;
  --gradient: linear-gradient(120deg, #2563eb 0%, #1e88e5 45%, #16a34a 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(45% 55% at 18% 20%, rgba(37, 99, 235, 0.18), transparent 70%),
    radial-gradient(40% 50% at 82% 12%, rgba(22, 163, 74, 0.16), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(244, 248, 255, 0.75);
  border-bottom: 1px solid rgba(227, 234, 245, 0.7);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow-md);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-name {
  font-size: 1.15rem;
}

.brand-name span {
  color: var(--blue);
}

.brand.small .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.brand.small .brand-mark svg {
  width: 15px;
  height: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--blue);
}

.nav-cta {
  padding: 9px 18px;
  border-radius: 999px;
  color: #fff !important;
  background: var(--gradient);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 74px 24px 40px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.hero h1 {
  margin: 22px 0 14px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  max-width: 580px;
  margin: 0 auto 34px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Search bar ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.search:focus-within {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1), var(--shadow-lg);
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}

.search-icon svg {
  width: 19px;
  height: 19px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  padding: 12px 4px;
}

.search input::placeholder {
  color: #9aa8bd;
}

/* ---------- Buttons ---------- */
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
}

.primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  background-size: 160% 160%;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-position 0.5s var(--ease);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background-position: 100% 50%;
  box-shadow: var(--shadow-lg);
}

.primary:active:not(:disabled) {
  transform: translateY(0);
}

.primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.primary.wide {
  width: 100%;
  padding: 15px 26px;
  font-size: 1rem;
}

.ghost {
  padding: 11px 18px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.ghost:hover {
  background: #d9e6ff;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.primary.loading .spinner {
  display: inline-block;
}

.primary.loading .btn-label {
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Errors ---------- */
.error {
  margin: 18px auto 0;
  max-width: 620px;
  padding: 12px 18px;
  font-size: 0.92rem;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd4d0;
  border-radius: 12px;
}

/* ---------- Platforms ---------- */
.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 34px;
}

.chip-static {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.platform svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: var(--brand, var(--blue));
}

.platform:hover {
  transform: translateY(-2px);
  border-color: var(--brand, var(--blue));
  box-shadow: var(--shadow-md);
}

.p-tiktok { --brand: #010101; }
.p-youtube { --brand: #ff0000; }
.p-facebook { --brand: #0866ff; }
.p-x { --brand: #000000; }
.p-instagram { --brand: #e4405f; }
.p-twitter { --brand: #1da1f2; }
.p-vimeo { --brand: #1ab7ea; }

/* ---------- Result card ---------- */
.result {
  max-width: 900px;
  margin: 14px auto 0;
  padding: 0 24px;
  animation: rise 0.5s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.result-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 22px;
}

.thumb {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-soft), var(--green-soft));
  aspect-ratio: 16 / 10;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  border-radius: 7px;
  backdrop-filter: blur(4px);
}

.meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.meta h2 {
  margin: 2px 0 6px;
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.qualities {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.chip {
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  background: #f6f9ff;
  border: 1.5px solid var(--border);
  transition: all 0.18s var(--ease);
}

.chip:hover {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.chip.active {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.actions {
  margin-top: auto;
}

/* ---------- Progress ---------- */
.progress {
  margin-top: 18px;
}

.bar {
  height: 9px;
  border-radius: 999px;
  background: #eaf1fd;
  overflow: hidden;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.35s var(--ease);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 0.84rem;
  color: var(--muted);
}

#percentText {
  font-weight: 600;
  color: var(--green-dark);
}

/* ---------- Sections ---------- */
.section-title {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: -0.025em;
  margin: 0 0 34px;
}

.how,
.features {
  max-width: 1000px;
  margin: 0 auto;
  padding: 88px 24px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  position: relative;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  font-weight: 700;
  color: #fff;
  border-radius: 12px;
  background: var(--gradient);
}

.step h3,
.feature h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.step p,
.feature p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 40px;
}

.feature {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.feature-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 64px;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 560px;
}

.footer .copyright {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .result-card {
    grid-template-columns: 1fr;
  }

  .thumb {
    aspect-ratio: 16 / 9;
  }

  .steps,
  .features {
    grid-template-columns: 1fr;
  }

  .how,
  .features {
    padding-top: 64px;
  }
}

@media (max-width: 620px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding-top: 48px;
  }

  .search {
    flex-wrap: wrap;
    border-radius: 22px;
    padding: 14px;
  }

  .search-icon {
    display: none;
  }

  .search input {
    flex: 1 1 100%;
    padding: 8px 6px;
  }

  .search .ghost,
  .search .primary {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
