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

:root,
[data-theme="dark"] {
  --bg: #080810;
  --surface: #10101c;
  --border: #1e1e30;
  --accent-violet: #7c3aed;
  --accent-violet-hover: #6d28d9;
  --accent-cyan: #06b6d4;
  --text: #f1f5f9;
  --text-muted: #64748b;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius-card: 12px;
  --radius-btn: 8px;
  /* premium dark tokens */
  --surface-glass: rgba(16,16,28,0.72);
  --border-glow: rgba(124,58,237,0.35);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 24px rgba(124,58,237,0.28);
  --orb-1: rgba(124,58,237,0.18);
  --orb-2: rgba(6,182,212,0.12);
  --orb-3: rgba(124,58,237,0.08);
  --navbar-bg: rgba(8,8,16,0.85);
  --navbar-bg-scrolled: rgba(8,8,16,0.97);
  --gradient-brand: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  --btn-shimmer-grad: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  --tag-gray-bg: #1e1e30;
  --toast-shadow: 0 8px 32px rgba(0,0,0,0.5);
  --input-bg: #080810;
}

[data-theme="light"] {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --border: #dde3f0;
  --accent-violet: #7c3aed;
  --accent-violet-hover: #6d28d9;
  --accent-cyan: #0891b2;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  --radius-card: 12px;
  --radius-btn: 8px;
  --surface-glass: rgba(255,255,255,0.82);
  --border-glow: rgba(124,58,237,0.22);
  --shadow-card: 0 4px 24px rgba(99,102,241,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-glow: 0 4px 16px rgba(124,58,237,0.18);
  --orb-1: rgba(167,139,250,0.12);
  --orb-2: rgba(14,165,233,0.09);
  --orb-3: rgba(124,58,237,0.06);
  --navbar-bg: rgba(240,244,255,0.90);
  --navbar-bg-scrolled: rgba(240,244,255,0.98);
  --gradient-brand: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
  --btn-shimmer-grad: linear-gradient(90deg, transparent, rgba(255,255,255,0.30), transparent);
  --tag-gray-bg: #eef2ff;
  --toast-shadow: 0 8px 32px rgba(99,102,241,0.14);
  --input-bg: #f8faff;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px 80px;
}

/* ── Layout ── */
.container { max-width: 820px; margin: 0 auto; }

/* ── Header ── */
header {
  text-align: center;
  padding: 48px 0 32px;
}
.logo { font-size: 2.8rem; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.logo span { color: var(--accent-violet); }
.tagline { color: var(--text-muted); margin-top: 8px; font-size: 1rem; }
.platform-pills {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-top: 20px;
}
.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px; font-size: 0.82rem; color: var(--text-muted);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 16px;
}

/* ── URL Input ── */
.input-row {
  display: flex; gap: 12px; align-items: stretch;
}
.input-wrap {
  flex: 1; position: relative;
}
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
#urlInput {
  width: 100%; height: 52px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-btn);
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  padding: 0 14px 0 42px; outline: none; transition: border-color 0.2s;
}
#urlInput:focus { border-color: var(--accent-violet); }
#urlInput:disabled { opacity: 0.5; }
#platformBadge {
  display: none; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 0.82rem; color: var(--text-muted);
  animation: fadeIn 0.3s ease;
}
#platformBadge.show { display: flex; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; }

.btn {
  height: 52px; padding: 0 24px;
  background: var(--accent-violet); color: #fff;
  border: none; border-radius: var(--radius-btn);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background 0.2s, transform 0.1s; white-space: nowrap; flex-shrink: 0;
}
.btn:hover:not(:disabled) { background: var(--accent-violet-hover); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

/* ── Info Card ── */
#infoCard {
  display: none;
  animation: slideDown 0.35s ease;
}
#infoCard.show { display: block; }
.info-inner { display: flex; gap: 20px; align-items: flex-start; }
#videoThumb {
  width: 200px; min-width: 200px; height: 112px;
  object-fit: cover; border-radius: 8px;
  background: var(--border);
}
.info-meta { flex: 1; min-width: 0; }
.info-platform-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; margin-bottom: 10px;
}
.video-title {
  font-size: 1.05rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 10px;
}
.meta-row { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; }
.duration-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; color: var(--text-muted);
}

/* ── Download Options ── */
#downloadOptions { display: none; }
#downloadOptions.show { display: block; }

.section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.formats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) {
  .formats-grid { grid-template-columns: 1fr; }
  .info-inner { flex-direction: column; }
  #videoThumb { width: 100%; min-width: 0; height: 180px; }
  .input-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

.format-col {}
.format-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-bottom: 8px;
}
.format-card.video:hover {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 1px var(--accent-violet)22;
  transform: scale(1.02);
}
.format-card.audio:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan)22;
  transform: scale(1.02);
}
.format-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
}
.tag-violet { background: #7c3aed22; color: var(--accent-violet); border: 1px solid #7c3aed44; }
.tag-gray { background: #1e1e30; color: var(--text-muted); border: 1px solid var(--border); }
.tag-cyan { background: #06b6d422; color: var(--accent-cyan); border: 1px solid #06b6d444; }
.tag-amber { background: #f59e0b22; color: var(--warning); border: 1px solid #f59e0b44; }
.tag-star { background: #10b98122; color: var(--success); border: 1px solid #10b98144; }

.format-size { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.dl-btn {
  width: 100%; height: 36px; border-radius: 6px;
  font-size: 0.82rem; font-weight: 600;
  border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity 0.2s, transform 0.1s;
}
.dl-btn.video { background: var(--accent-violet); color: #fff; }
.dl-btn.audio { background: var(--accent-cyan); color: #080810; }
.dl-btn:hover:not(:disabled) { opacity: 0.88; }
.dl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dl-spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: none;
}
.dl-btn.audio .dl-spinner { border-color: rgba(8,8,16,0.3); border-top-color: #080810; }

/* ── Toast — download progress ── */
#progressToast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px 20px;
  width: 320px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(120px); opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}
#progressToast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.toast-filename {
  font-size: 0.83rem; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.toast-pct {
  font-size: 0.83rem; font-weight: 700; color: var(--accent-violet);
  flex-shrink: 0; min-width: 38px; text-align: right;
}
.toast-msg { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-track {
  height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-bottom: 6px;
}
.progress-fill {
  height: 100%; border-radius: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
  transition: width 0.15s ease;
}
.progress-fill.indeterminate {
  width: 40%;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan), var(--accent-violet));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.toast-stats { font-size: 0.72rem; color: var(--text-muted); }

/* ── Error Toast ── */
#errorToast {
  position: fixed; top: 24px; right: 24px; z-index: 101;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-card); padding: 14px 16px;
  width: 340px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: translateX(380px); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
#errorToast.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.error-inner { display: flex; align-items: flex-start; gap: 10px; }
.error-icon { color: var(--error); flex-shrink: 0; margin-top: 1px; }
.error-text { flex: 1; font-size: 0.85rem; line-height: 1.4; }
.error-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: 0; margin-left: 8px;
  flex-shrink: 0; line-height: 1;
}

/* ── History ── */
#historySection { display: none; }
#historySection.show { display: block; }
.history-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.history-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; }
.clear-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted);
  font-family: inherit; font-size: 0.78rem; padding: 5px 12px;
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.clear-btn:hover { border-color: var(--error); color: var(--error); }
.history-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 0.9rem; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.hist-thumb {
  width: 56px; height: 32px; object-fit: cover; border-radius: 4px;
  background: var(--border); flex-shrink: 0;
}
.hist-info { flex: 1; min-width: 0; }
.hist-title {
  font-size: 0.83rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.hist-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.hist-redl-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-family: inherit; font-size: 0.75rem; padding: 4px 10px;
  cursor: pointer; flex-shrink: 0; transition: border-color 0.2s, color 0.2s;
}
.hist-redl-btn:hover { border-color: var(--accent-violet); color: var(--accent-violet); }
@media (max-width: 540px) {
  .history-item { flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
  .hist-redl-btn {
    flex: 0 0 calc(100% - 68px); /* 56px thumb + 12px gap */
    margin-left: 68px;
    text-align: center;
    padding: 6px 10px;
  }
}

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,16,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 -16px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo .logo-light { display: block; }
.nav-logo .logo-dark { display: none; }
[data-theme="dark"] .nav-logo .logo-light { display: none; }
[data-theme="dark"] .nav-logo .logo-dark { display: block; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 0.85rem; color: var(--text-muted); text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── How-To Section ── */
.how-to-section { padding: 64px 0 48px; }
.section-title { font-size: 1.7rem; font-weight: 700; text-align: center; letter-spacing: -0.4px; }
.section-sub { font-size: 0.95rem; color: var(--text-muted); text-align: center; margin-top: 8px; }
.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-top: 40px;
}
@media (max-width: 700px) { .steps-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px 20px; text-align: center;
}
.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-violet); color: #fff;
  font-size: 0.85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.step-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.step-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* ── Features Section ── */
.features-section { padding: 0 0 64px; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 40px;
}
@media (max-width: 700px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px 20px;
}
.feature-icon { font-size: 1.5rem; margin-bottom: 12px; }
.feature-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.feature-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* ── FAQ Section ── */
.faq-section { padding: 0 0 64px; }
.faq-list { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); overflow: hidden;
}
.faq-q {
  width: 100%; background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 0.95rem; font-weight: 500;
  text-align: left; padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; gap: 16px;
}
.faq-q:hover { color: var(--accent-violet); }
.faq-chevron {
  width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.25s;
  color: var(--text-muted);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.65;
  padding: 0 20px; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-a { max-height: 200px; padding: 0 20px 18px; }

/* ── SEO Content Section ── */
.seo-section { padding: 0 0 64px; }
.seo-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 32px;
}
@media (max-width: 600px) { .seo-grid { grid-template-columns: 1fr; } }
.seo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px;
}
.seo-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 10px; color: var(--accent-violet); }
.seo-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.65; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px; text-align: center;
}
.footer-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.footer-logo .logo-light { display: block; }
.footer-logo .logo-dark { display: none; }
[data-theme="dark"] .footer-logo .logo-light { display: none; }
[data-theme="dark"] .footer-logo .logo-dark { display: block; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin: 14px 0; flex-wrap: wrap; }
.footer-links a { font-size: 0.8rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; }
.footer-disclaimer { font-size: 0.73rem; color: var(--text-muted); opacity: 0.6; max-width: 680px; margin: 0 auto; line-height: 1.6; }

/* ── Theme transitions ─────────────────────────────────────────────────────── */
html { transition: background-color 0.35s ease, color 0.35s ease; }
body { transition: background-color 0.35s ease; }

/* ── Background orbs ───────────────────────────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: orbFloat 22s ease-in-out infinite alternate; }
.orb-1 { width: 600px; height: 600px; top: -200px; left: -200px; background: radial-gradient(circle, var(--orb-1), transparent 70%); animation-duration: 22s; }
.orb-2 { width: 500px; height: 500px; bottom: -150px; right: -150px; background: radial-gradient(circle, var(--orb-2), transparent 70%); animation-duration: 18s; animation-delay: -7s; }
.orb-3 { width: 400px; height: 400px; top: 40%; left: 50%; margin-left: -200px; background: radial-gradient(circle, var(--orb-3), transparent 70%); animation-duration: 26s; animation-delay: -12s; }
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40px, -30px) scale(1.05); }
  66%  { transform: translate(-20px, 50px) scale(0.97); }
  100% { transform: translate(30px, 20px) scale(1.03); }
}

/* ── Glassmorphism cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card);
  position: relative; z-index: 1;
}
[data-theme="light"] .card { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ── Gradient brand logo ───────────────────────────────────────────────────── */
.logo-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Shimmer button ────────────────────────────────────────────────────────── */
.btn-shimmer { position: relative; overflow: hidden; }
.btn-shimmer::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--btn-shimmer-grad);
  background-size: 200% 100%;
  transform: translateX(-100%);
}
.btn-shimmer:hover:not(:disabled)::after { animation: btnShimmer 0.55s ease forwards; }
@keyframes btnShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── Input focus glow ─────────────────────────────────────────────────────── */
#urlInput { background: var(--input-bg); }
#urlInput:focus { border-color: var(--accent-violet); box-shadow: 0 0 0 3px rgba(124,58,237,0.18); outline: none; }
[data-theme="light"] #urlInput:focus { box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }

/* ── Format card hover glow ───────────────────────────────────────────────── */
.format-card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.format-card.video:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 0 20px rgba(124,58,237,0.22), var(--shadow-card); border-color: var(--accent-violet); }
.format-card.audio:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 0 20px rgba(6,182,212,0.20), var(--shadow-card); border-color: var(--accent-cyan); }

/* ── Pill hover ───────────────────────────────────────────────────────────── */
.pill { transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s; cursor: pointer; text-decoration: none; color: var(--text-muted); }
.pill:hover { border-color: var(--accent-violet); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.18); }

/* ── Button press ─────────────────────────────────────────────────────────── */
.btn:active:not(:disabled) { transform: scale(0.97); }
.dl-btn:active:not(:disabled) { transform: scale(0.96); }

/* ── Step / feature card hover ────────────────────────────────────────────── */
.step-card, .feature-card, .seo-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative; z-index: 1;
}
.step-card:hover, .feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--border-glow); }

/* ── Theme toggle button ──────────────────────────────────────────────────── */
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.4);
  color: #a78bfa; cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.15s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: rgba(124,58,237,0.28); border-color: #7c3aed; color: #fff; transform: scale(1.04); }
[data-theme="light"] .theme-toggle-btn { background: rgba(124,58,237,0.10); border-color: rgba(124,58,237,0.35); color: #7c3aed; }
[data-theme="light"] .theme-toggle-btn:hover { background: rgba(124,58,237,0.20); color: #5b21b6; }
[data-theme="dark"]  .theme-icon-sun  { display: none; }
[data-theme="dark"]  .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun  { display: block; }

/* ── Navbar scroll state ──────────────────────────────────────────────────── */
.navbar { background: var(--navbar-bg); transition: background 0.3s ease, box-shadow 0.3s ease; }
.navbar.scrolled { background: var(--navbar-bg-scrolled); box-shadow: 0 1px 24px rgba(0,0,0,0.18); }
[data-theme="light"] .navbar.scrolled { box-shadow: 0 1px 24px rgba(99,102,241,0.12); }

/* ── Toast shadow token ───────────────────────────────────────────────────── */
#progressToast, #errorToast { box-shadow: var(--toast-shadow); }

/* ── Tag gray token ───────────────────────────────────────────────────────── */
.tag-gray { background: var(--tag-gray-bg); }

/* ── GSAP pre-animation state ─────────────────────────────────────────────── */
.gsap-hero-item { opacity: 0; }

/* ── Navbar dropdown ──────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  font-size: 0.85rem; color: var(--text-muted); text-decoration: none;
  cursor: pointer; background: none; border: none; font-family: inherit;
  padding: 0; display: flex; align-items: center; gap: 4px;
  transition: color 0.2s;
}
.nav-dropdown-toggle:hover, .nav-dropdown:hover .nav-dropdown-toggle { color: var(--text); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; padding-top: 16px; min-width: 220px;
  box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 200;
}
/* invisible bridge fills the gap so hover doesn't break mid-travel */
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--border); color: var(--text); }
.nav-dd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
/* hide anchor-only nav links on small screens */
@media (max-width: 600px) { .nav-anchor { display: none; } }

/* ── Blog guides section on homepage ─────────────────────────────────────── */
.blog-home-section { padding: 0 0 64px; }
.blog-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
@media (max-width: 600px) { .blog-home-grid { grid-template-columns: 1fr; } }
.blog-home-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative; z-index: 1;
}
.blog-home-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--border-glow); }
.blog-home-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(124,58,237,0.15); color: var(--accent-violet); border: 1px solid rgba(124,58,237,0.25);
  margin-bottom: 10px;
}
.blog-home-title { font-size: 0.9rem; font-weight: 600; line-height: 1.4; margin-bottom: 6px; color: var(--text); }
.blog-home-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.55; }
.blog-home-more { text-align: center; margin-top: 20px; font-size: 0.82rem; }
.blog-home-more a { color: var(--accent-violet); text-decoration: none; }
.blog-home-more a:hover { text-decoration: underline; }

/* ── Footer columns ───────────────────────────────────────────────────────── */
.footer-columns {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; max-width: 680px; margin: 24px auto 32px; text-align: left;
}
@media (max-width: 600px) { .footer-columns { grid-template-columns: 1fr 1fr; gap: 20px; } }
.footer-col-title { font-size: 0.75rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.footer-col a { display: block; font-size: 0.78rem; color: var(--text-muted); text-decoration: none; margin-bottom: 6px; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent-violet); }

/* ── SEO card as link ─────────────────────────────────────────────────────── */
a.seo-card { display: block; text-decoration: none; color: inherit; }
.seo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--border-glow); }

/* ── URL clear button ─────────────────────────────────────────────────────── */
.url-clear-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: 0 4px;
  line-height: 1; display: none; transition: color 0.2s;
}
.url-clear-btn:hover { color: var(--error); }
.url-clear-btn.visible { display: block; }
#urlInput { padding-right: 36px; }
