/* ============================================================
   YouTube Downloader — download site (v2)
   CapCut-inspired: Plus Jakarta Sans display, Inter body,
   violet accent, rounded cards, light/dark via data-theme
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f7f9;
  --bg-alt: #efeff3;
  --card: #ffffff;
  --border: #e9e9ee;
  --border-strong: #dcdce4;
  --text: #17171b;
  --muted: #63636e;
  --accent: #6c4df6;
  --accent-2: #9b6cff;
  --accent-text: #4a31c9;
  --accent-soft: rgba(108, 77, 246, 0.1);
  --on-accent: #ffffff;
  --success: #179a6a;
  --success-soft: rgba(23, 154, 106, 0.12);
  --header-bg: rgba(247, 247, 249, 0.82);
  --hero-glow: radial-gradient(60% 50% at 75% 0%, rgba(108, 77, 246, 0.16), transparent 70%);
  --grid-line: rgba(20, 16, 60, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0c0c0f;
  --bg-alt: #111116;
  --card: #17171c;
  --border: #26262d;
  --border-strong: #34343d;
  --text: #f4f4f6;
  --muted: #9d9da8;
  --accent: #8b6ffb;
  --accent-2: #a98dff;
  --accent-text: #c2adff;
  --accent-soft: rgba(139, 111, 251, 0.16);
  --on-accent: #ffffff;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --header-bg: rgba(12, 12, 15, 0.8);
  --hero-glow: radial-gradient(55% 45% at 72% 0%, rgba(139, 111, 251, 0.22), transparent 70%);
  --grid-line: rgba(255, 255, 255, 0.045);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.025em;
}
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-size: 0.9em;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0.12em 0.42em;
  border-radius: 7px;
}
img { max-width: 100%; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

section[id] { scroll-margin-top: 84px; }

/* Lucide icons inherit currentColor and size from context */
.lucide { width: 1.15em; height: 1.15em; stroke-width: 2; vertical-align: -0.18em; }
i.lucide, .btn .lucide, .footer-nav .lucide { pointer-events: none; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

.btn-download { min-width: 158px; }

/* ---------- Icon button (borderless, clean) ---------- */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.icon-btn .lucide { width: 18px; height: 18px; }
.icon-btn .icon-github { width: 17px; height: 17px; }

/* Theme toggle: show the sun icon in dark mode (click → light), moon in light mode */
[data-theme="dark"] .icon-sun { display: inline-flex; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline-flex; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 60px; }

.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none !important; }
.brand-name {
  font-family: "Space Grotesk", var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand-accent { color: var(--accent); }

.header-nav { display: flex; gap: 26px; margin-left: 12px; }
.header-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
  padding: 4px 0;
}
.header-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-actions .btn { margin-left: 8px; }

/* Header Download CTA: neutral inverted button — dark on light, white on dark */
.btn-header-download {
  background: var(--text);
  color: var(--bg);
}
.btn-header-download:hover { opacity: 0.85; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 80px; text-align: center; overflow: hidden; }
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(60% 60% at 50% 20%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 20%, black, transparent 75%);
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
}
.badge-accent { color: var(--accent-text); border-color: transparent; background: var(--accent-soft); }
.badge-success { color: var(--success); border-color: transparent; background: var(--success-soft); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.hero-title {
  font-size: clamp(36px, 6.5vw, 62px);
  font-weight: 800;
  max-width: 780px;
  margin: 24px 0 18px;
  letter-spacing: -0.035em;
}
.grad-text { color: var(--accent); }
.hero-sub { font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); max-width: 580px; margin: 0 0 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-meta { margin-top: 28px; font-size: 13.5px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.section-sub { text-align: center; color: var(--muted); margin-bottom: 44px; }
/* Sections without a sub-title: keep the heading clearly separated from its cards */
.section-title + .features-grid,
.section-title + .steps,
.section-title + .faq-list { margin-top: 24px; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 0.18s ease;
}
.card:hover { border-color: var(--border-strong); }

.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; grid-auto-rows: 1fr; }

/* Per-card accent tokens: a top bar + tinted icon for each card */
.feature-accent-1 { --feature-accent: #6c4df6; --feature-soft: rgba(108, 77, 246, 0.12); }
.feature-accent-2 { --feature-accent: #0e9488; --feature-soft: rgba(14, 148, 136, 0.12); }
.feature-accent-3 { --feature-accent: #b45309; --feature-soft: rgba(180, 83, 9, 0.14); }
.feature-accent-4 { --feature-accent: #be123c; --feature-soft: rgba(190, 18, 60, 0.12); }
[data-theme="dark"] .feature-accent-1 { --feature-accent: #a78bfa; --feature-soft: rgba(167, 139, 250, 0.16); }
[data-theme="dark"] .feature-accent-2 { --feature-accent: #2dd4bf; --feature-soft: rgba(45, 212, 191, 0.14); }
[data-theme="dark"] .feature-accent-3 { --feature-accent: #fbbf24; --feature-soft: rgba(251, 191, 36, 0.14); }
[data-theme="dark"] .feature-accent-4 { --feature-accent: #fb7185; --feature-soft: rgba(251, 113, 133, 0.14); }

.feature {
  padding: 22px 24px 24px;
  border-top: 3px solid var(--feature-accent);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feature:hover { border-color: var(--border-strong); border-top-color: var(--feature-accent); }

.feature-head { display: flex; align-items: center; gap: 14px; }
.feature h3 { font-size: 16.5px; margin: 0; line-height: 1.3; }
.feature p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--feature-soft);
  color: var(--feature-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}
.feature-icon .lucide { width: 20px; height: 20px; }

/* ---------- Downloads ---------- */
.releases-list { display: flex; flex-direction: column; gap: 14px; max-width: 860px; margin: 0 auto; }

.release-card {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.release-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.release-version { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.release-date { color: var(--muted); font-size: 12.5px; }

.release-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.release-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}

/* CapCut-style flat action buttons: solid fill, small radius, no lift/gradient */
.release-actions .btn {
  min-width: 0;
  padding: 10px 18px;
  font-size: 13.5px;
  border-radius: 10px;
  box-shadow: none;
  transform: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.release-actions .btn:hover,
.release-actions .btn:active { transform: none; box-shadow: none; }
.release-actions .btn-primary {
  background: var(--accent);
  box-shadow: none;
}
.release-actions .btn-primary:hover { background: var(--accent-2); }
.release-actions .btn-ghost {
  background: var(--card);
  border-color: var(--border);
  box-shadow: none;
  color: var(--text);
}
.release-actions .btn-ghost:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}

.release-card.latest {
  border-color: var(--accent);
  background: var(--card);
}

/* ---------- Steps (horizontal timeline on desktop) ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
.step {
  position: relative;
  text-align: center;
  padding-top: 8px;
}
.step::before {
  /* connector line between the icon nodes */
  content: "";
  position: absolute;
  top: 40px;
  left: -20px;
  right: 50%;
  height: 2px;
  background: var(--border-strong);
}
.step:first-child::before { display: none; }
.step-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  box-shadow: none;
  border: 6px solid var(--bg);
  z-index: 1;
}
.step-num {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--card);
  border: 1px solid var(--accent);
}
.step-icon .lucide { width: 28px; height: 28px; }
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--muted); margin: 0; max-width: 260px; margin-inline: auto; }

@media (max-width: 768px) {
  /* vertical timeline: left rail + content */
  .steps {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 480px;
    margin: 0 auto;
  }
  .step {
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-areas:
      "icon title"
      "icon body";
    column-gap: 20px;
    text-align: left;
    padding: 0 0 36px;
    position: relative;
  }
  .step:last-child { padding-bottom: 0; }
  .step::before {
    top: 0;
    bottom: 0;
    left: 40px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .step:first-child::before { display: block; }
  .step-icon {
    grid-area: icon;
    margin: 0;
    width: 80px;
    height: 80px;
  }
  .step h3 { grid-area: title; align-self: end; margin: 0 0 6px; }
  .step p { grid-area: body; max-width: none; margin: 0; }
}

/* ---------- Settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 860px;
  margin: 24px auto 0;
}

.settings-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-title {
  font-size: 16.5px;
  margin: 0;
  line-height: 1.3;
}

.settings-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.settings-select {
  width: 100%;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14.5px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.settings-select:focus {
  border-color: var(--accent);
}

.settings-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.settings-status {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.settings-command-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-command {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow-x: auto;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.settings-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item[open] { border-color: var(--accent); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 19px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.faq-item[open] summary i { transform: rotate(180deg); color: var(--accent-text); }
.faq-item p { padding: 0 24px 20px; margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 22px; }
.footer-nav a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.footer-nav a:hover { color: var(--accent-text); }

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

@media (max-width: 768px) {
  .header-nav { display: none; }
  .hero { padding: 68px 0 60px; }
  .section { padding: 64px 0; }
}

@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .release-card { padding: 20px; }
  /* Header: keep the brand on one line, drop the redundant GitHub icon and
     shrink the Download CTA to an icon-only square so nothing clips */
  .header-inner { gap: 10px; }
  .brand-name { font-size: 15px; }
  .header-actions .icon-github { display: none; }
  .header-actions .btn { width: 36px; height: 36px; padding: 0; justify-content: center; margin-left: 4px; }
  .header-actions .btn .btn-label { display: none; }
  .header-actions .btn .lucide { margin: 0; }
  /* Hero: full-width CTAs, tighter type */
  .hero { padding: 56px 0 48px; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .hero-actions .btn { width: 100%; }
  .hero-meta { font-size: 12.5px; line-height: 1.5; }
  .section-title { font-size: 26px; }
  .section { padding: 52px 0; }
  /* Version cards: stack info above full-width buttons */
  .release-card { flex-direction: column; align-items: stretch; gap: 14px; }
  .release-head { justify-content: space-between; }
  .release-actions { margin-left: 0; width: 100%; flex-direction: column; flex-wrap: nowrap; }
  .release-actions .btn { width: 100%; flex: 0 0 auto; }
  .faq-item summary { padding: 16px 18px; font-size: 14.5px; }
  .faq-item p { padding: 0 18px 16px; font-size: 14px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
