/* ===========================================================
   TokSave — TikTok downloader landing page
   Palette mirrors the blue/cyan scheme of the reference site.
   =========================================================== */

:root {
  /* Brand */
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-300: #93c5fd;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;

  /* Hero gradient stops */
  --hero-1: #195fd7;
  --hero-2: #1e6fe8;
  --hero-3: #2563eb;

  /* Neutrals */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white: #ffffff;

  --red-500: #ef4444;
  --green-600: #16a34a;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 15px -3px rgba(16, 24, 40, .1), 0 4px 6px -4px rgba(16, 24, 40, .1);
  --shadow-xl: 0 20px 25px -5px rgba(16, 24, 40, .12), 0 8px 10px -6px rgba(16, 24, 40, .1);

  --maxw: 1152px;
}

*, *::before, *::after { box-sizing: border-box; }

/* the `hidden` attribute must win over the display rules below */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.container.narrow { max-width: 820px; }
.center { text-align: center; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  color: var(--white);
  box-shadow: 0 4px 10px rgba(37, 99, 235, .3);
}
.logo-mark svg { width: 19px; height: 19px; }
.logo-text { font-weight: 800; font-size: 19px; letter-spacing: -.03em; color: var(--gray-900); }
.logo-text span { color: var(--blue-600); }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--gray-600); transition: color .15s; }
.nav a:hover { color: var(--blue-600); }
.nav .nav-cta {
  padding: 9px 18px; border-radius: 10px; color: var(--white); font-weight: 600;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-500));
  box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
}
.nav .nav-cta:hover { color: var(--white); filter: brightness(1.06); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 42px; height: 42px; padding: 0 10px;
  background: none; border: 1px solid var(--gray-200); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--gray-700); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 64px;
  background: linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 50%, var(--hero-3) 100%);
}
.hero-decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; }
.orb-1 { top: -80px; left: -80px; width: 288px; height: 288px; background: rgba(255,255,255,.10); filter: blur(64px); }
.orb-2 { bottom: -128px; right: -80px; width: 384px; height: 384px; background: rgba(34, 211, 238, .22); filter: blur(64px); }
.orb-3 { top: 22%; left: 50%; width: 200px; height: 200px; transform: translateX(-50%); background: rgba(147, 197, 253, .14); filter: blur(48px); }
.hero-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 78%);
}
.hero-inner { position: relative; text-align: center; }

.hero h1 {
  font-size: clamp(28px, 5.2vw, 56px);
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.hero-sub {
  margin: 14px auto 0; max-width: 620px;
  font-size: clamp(15px, 2vw, 20px);
  color: var(--blue-100);
}

/* Download form */
.dl-form {
  display: flex; gap: 12px;
  max-width: 720px; margin: 30px auto 0;
}
.field { position: relative; flex: 1; }
.field input {
  width: 100%; height: 56px;
  padding: 0 44px 0 20px;
  font-size: 16px; font-family: inherit; color: var(--gray-900);
  background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--gray-400); }
.field input:focus { border-color: var(--blue-500); box-shadow: var(--shadow-lg), 0 0 0 4px rgba(59, 130, 246, .35); }
.clear-btn {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: grid; place-items: center; width: 26px; height: 26px;
  color: var(--gray-400); background: var(--gray-100);
  border: 0; border-radius: 50%; cursor: pointer;
}
.clear-btn svg { width: 15px; height: 15px; }
.clear-btn:hover { color: var(--gray-700); background: var(--gray-200); }

.btn-paste {
  display: inline-flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 20px;
  font: 600 15px/1 inherit; color: var(--white);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius);
  cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn-paste svg { width: 18px; height: 18px; }
.btn-paste:hover { background: rgba(255,255,255,.24); }

.btn-primary {
  height: 56px; padding: 0 34px;
  font: 700 16px/1 inherit; color: var(--white);
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-500));
  border: 0; border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(6, 182, 212, .28);
  cursor: pointer; transition: transform .12s, filter .15s;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .7; cursor: progress; }

.form-msg { min-height: 22px; margin-top: 12px; font-size: 14px; color: #fecaca; }
.form-msg.ok { color: var(--blue-100); }

.trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px;
  margin: 22px 0 0; padding: 0; list-style: none;
}
.trust li { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--blue-100); }
.trust svg { width: 17px; height: 17px; color: var(--cyan-400); }

/* Result panel */
.result {
  max-width: 720px; margin: 26px auto 0; padding: 20px;
  text-align: left;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.result-head { display: flex; gap: 16px; align-items: center; }
.result-thumb {
  flex: none; display: grid; place-items: center;
  width: 72px; height: 96px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-50), #ecfeff);
  color: var(--blue-600);
}
.result-thumb svg { width: 28px; height: 28px; }
.result-meta h4 { font-size: 16px; margin-bottom: 4px; }
.result-meta p { font-size: 14px; color: var(--gray-500); word-break: break-all; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-actions button {
  flex: 1 1 180px;
  height: 46px; padding: 0 18px;
  font: 600 14px/1 inherit; color: var(--white);
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-500));
  border: 0; border-radius: 10px; cursor: pointer;
}
.result-actions button.alt {
  color: var(--blue-700); background: var(--blue-50);
  border: 1px solid var(--blue-100);
}
.result-actions button:hover { filter: brightness(1.05); }
.result-note { margin-top: 14px; font-size: 13px; color: var(--gray-500); }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-tight { padding: 36px 0; }
.section-alt { background: var(--gray-50); }
.section-fade { background: linear-gradient(to bottom, var(--white), var(--gray-50)); }

.section h2 { font-size: clamp(22px, 3.4vw, 36px); }
.lead { margin-top: 14px; font-size: 17px; color: var(--gray-600); }
.center .lead { margin-inline: auto; max-width: 620px; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.chip {
  padding: 7px 15px; font-size: 14px; font-weight: 600; color: var(--blue-700);
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 999px;
}

/* App strip */
.app-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px 28px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(6, 182, 212, .08));
  border: 1px solid var(--blue-100); border-radius: var(--radius-lg);
}
.app-copy h3 { font-size: 20px; }
.app-copy p { margin-top: 6px; font-size: 15px; color: var(--gray-600); }
.app-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-solid, .btn-ghost {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px;
  font-size: 15px; font-weight: 600; border-radius: 10px;
}
.btn-solid {
  color: var(--white);
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-500));
  box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}
.btn-solid:hover { filter: brightness(1.06); }
.btn-ghost { color: var(--blue-700); background: var(--white); border: 1px solid var(--blue-100); }
.btn-ghost:hover { background: var(--blue-50); }

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin: 44px 0 0; padding: 0; list-style: none; counter-reset: none;
}
.step {
  position: relative; padding: 28px 24px 24px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.step:hover { border-color: var(--blue-300); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.step-num {
  display: grid; place-items: center;
  width: 42px; height: 42px; margin-bottom: 16px;
  font-size: 17px; font-weight: 800; color: var(--white);
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(37, 99, 235, .25);
}
.step h4 { font-size: 17px; }
.step p { margin-top: 8px; font-size: 15px; color: var(--gray-600); }
.step strong { color: var(--gray-900); font-weight: 600; }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.card {
  padding: 24px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.card:hover { border-color: var(--blue-300); box-shadow: var(--shadow-lg); background: rgba(239, 246, 255, .5); }
.card-icon {
  display: inline-flex; padding: 11px; margin-bottom: 14px;
  color: var(--blue-600);
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(6,182,212,.12));
  border-radius: 12px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h4 { font-size: 16px; }
.card p { margin-top: 7px; font-size: 15px; color: var(--gray-600); }

/* FAQ */
.faq { margin-top: 36px; display: grid; gap: 12px; }
.faq details {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq details[open] { border-color: var(--blue-300); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--gray-900);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none;
  width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--blue-600); border-bottom: 2px solid var(--blue-600);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary:hover { color: var(--blue-600); }
.faq-body { padding: 0 20px 18px; font-size: 15px; color: var(--gray-600); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px;
  padding-top: 48px; padding-bottom: 32px;
}
.footer-brand p { margin-top: 14px; max-width: 380px; font-size: 14px; color: var(--gray-500); }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-900); margin-bottom: 4px; }
.footer-col a { font-size: 14px; color: var(--gray-500); }
.footer-col a:hover { color: var(--blue-600); }
.footer-bottom { padding-block: 20px; border-top: 1px solid var(--gray-200); }
.footer-bottom p { font-size: 13px; color: var(--gray-500); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .steps, .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px 16px 18px;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; font-size: 16px; }
  .nav .nav-cta { text-align: center; margin-top: 6px; }
  .nav-toggle { display: flex; }

  .hero { padding: 36px 0 44px; }
  .dl-form { flex-wrap: wrap; }
  .field { flex: 1 1 100%; }
  .btn-paste { flex: 1 1 40%; justify-content: center; }
  .btn-primary { flex: 1 1 50%; }
  .section { padding: 52px 0; }
}

@media (max-width: 560px) {
  .steps, .cards { grid-template-columns: 1fr; }
  .field input, .btn-paste, .btn-primary { height: 50px; }
  .app-strip { padding: 22px; }
  .app-actions { width: 100%; }
  .btn-solid, .btn-ghost { flex: 1; justify-content: center; }
}

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