:root {
  --bg: #ffffff;
  --text: #0b0f19;
  --muted: #64748b;
  --border: #e5e7eb;
  --surface: #f8fafc;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef0fe;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.14);
  --container: 1120px;
}

body.theme-youtube { --accent: #ff0000; --accent-dark: #cc0000; --accent-soft: #ffe6e6; }
body.theme-tiktok { --accent: #000000; --accent-dark: #262626; --accent-soft: #f0f0f0; }
body.theme-instagram { --accent: #f34279; --accent-dark: #d22e63; --accent-soft: #fde5ed; }
body.theme-facebook { --accent: #0a66ff; --accent-dark: #084fc7; --accent-soft: #e6efff; }

* { box-sizing: border-box; }

/* The hidden attribute must always win over any display set by a class
   (e.g. .loading-state{display:flex}), otherwise elements toggled via
   el.hidden = true/false stay visible. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo:hover { text-decoration: none; }

.logo-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
}

span.logo-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 24px 44px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 420px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}

h1 {
  font-size: 46px;
  line-height: 1.12;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero p.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 620px;
  margin: 0 auto 36px;
}

/* ---------- Minimal link bar ---------- */
.link-form {
  max-width: 620px;
  margin: 0 auto;
}

.link-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 22px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.link-bar-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.link-bar input[type="url"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-size: 16px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.link-bar input[type="url"]::placeholder { color: #9aa1b1; }

select {
  padding: 15px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

select:focus { border-color: var(--accent); background: #fff; }

button {
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

button:hover:not(:disabled) { background: var(--accent-dark); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* ---------- Result modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 34px 28px 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.2s ease;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal .loading-state,
.modal .result-card,
.modal .progress-wrap,
.modal .status {
  margin-top: 0;
  max-width: none;
}

.modal .loading-state { padding: 30px 0; }

@media (max-width: 600px) {
  .modal { max-width: 94vw; padding: 30px 22px 22px; border-radius: 20px; }
}

/* ---------- Loading state ---------- */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.status {
  margin: 20px auto 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  max-width: 500px;
}

.status.error {
  color: #d92d20;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
}

/* ---------- Result card (minimal) ---------- */
.result-card {
  max-width: 480px;
  margin: 36px auto 0;
  text-align: center;
  animation: rise 0.35s ease;
}

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

.result-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  margin: 0 auto 22px;
}

.result-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-card p.meta {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.result-actions select { flex: 1; max-width: 190px; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Progress bar ---------- */
.progress-wrap {
  max-width: 480px;
  margin: 20px auto 0;
  text-align: left;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: 9px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

/* ---------- Sections ---------- */
.section {
  padding: 68px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: 22px;
  text-align: left;
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--text);
}

.section p.section-sub {
  text-align: left;
  color: #374151;
  max-width: none;
  margin: 0 0 20px;
  font-size: 14.5px;
}

.steps, .features {
  max-width: 760px;
}

.step, .feature {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child, .feature:last-child { border-bottom: none; }


.step h3, .feature h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--text); }
.step p, .feature p { margin: 0; color: #374151; font-size: 14.5px; }

.feature .icon { display: none; }

.faq {
  max-width: 760px;
  margin: 0;
}

.faq-item {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 0;
  margin-bottom: 0;
  background: none;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: 'Q: ';
}

.faq-item p {
  margin: 8px 0 0;
  color: #374151;
  font-size: 14.5px;
}

.faq-item p::before {
  content: 'A: ';
}

/* ---------- Platform menu (home page) ---------- */
.platform-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.platform-card {
  flex: 1;
  min-width: 220px;
  max-width: 250px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  color: var(--text);
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.platform-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  text-decoration: none;
}

.platform-card .icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: block;
  object-fit: contain;
}

.platform-card h3 { margin: 0 0 6px; font-size: 16px; }
.platform-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- Blog / articles (plain text) ---------- */
.breadcrumb {
  font-size: 13px;
  color: #374151;
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.breadcrumb a { color: #374151; }

.article-hero {
  padding: 16px 24px 4px;
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}

.article-hero h1 { font-size: 26px; text-align: left; margin: 10px 0 8px; font-weight: 700; }
.article-hero .lead { text-align: left; margin: 0; max-width: none; color: #374151; font-size: 15px; }

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 24px 12px;
}

.prose h2 { font-size: 18px; margin: 28px 0 10px; font-weight: 700; color: var(--text); }
.prose h3 { font-size: 15.5px; margin: 18px 0 6px; font-weight: 700; }
.prose p { margin: 0 0 14px; color: #1f2937; font-size: 15px; line-height: 1.7; }
.prose ol, .prose ul { margin: 0 0 14px; padding-left: 22px; color: #1f2937; font-size: 15px; line-height: 1.7; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }

.tip-box {
  background: none;
  border: none;
  padding: 0;
  margin: 14px 0;
}

.tip-box p:last-child { margin-bottom: 0; }
.tip-box strong { display: inline; }
.tip-box strong::after { content: ' '; }

.article-cta {
  max-width: 720px;
  margin: 24px auto;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 20px 24px;
  text-align: left;
}

.article-cta h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.article-cta p { color: #374151; margin: 0 0 12px; font-size: 14px; }

.related-guides {
  max-width: 720px;
  margin: 0;
  display: block;
}

.related-card {
  display: block;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 0;
  color: var(--text);
  background: none;
}

.related-card .tag { display: none; }

.related-card h4 { margin: 0; font-size: 14.5px; font-weight: 400; line-height: 1.4; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  color: #374151;
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #374151; }
.footer-col a:hover { color: var(--text); }

.footer-brand p {
  color: #374151;
  margin: 12px 0 0;
  max-width: 260px;
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  font-size: 12.5px;
  color: #6b7280;
}

.footer-bottom a { color: #6b7280; }

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .steps, .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  h1 { font-size: 32px; }
  .hero { padding: 44px 20px 32px; }
  .section { padding: 48px 0; }
  .section h2 { font-size: 24px; }
  .download-box { padding: 18px; border-radius: var(--radius); }
  .row { flex-direction: column; }
  .row button, .row select { width: 100%; }
  .steps, .features { grid-template-columns: 1fr; }
  .result { flex-direction: column; }
  .result img { width: 100%; height: 190px; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }

  .platform-card { max-width: none; min-width: 0; flex: 1 1 calc(50% - 8px); }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .platform-card { flex: 1 1 100%; }
}
