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

/* ─── Tokens ────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --card: #ffffff;
  --border: #e0e0e8;
  --border-hover: #c0c0cc;
  --text: #111118;
  --muted: #72728a;
  --accent: #5b4ef8;
  --accent-light: #ede9ff;
  --accent-mid: #c4bbff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #86efac;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }

.section-inner { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }

/* ─── Header ────────────────────────── */
header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; height: 58px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.15s; }
nav a:hover { color: var(--text); }
nav .nav-cta { background: var(--accent); color: white !important; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; transition: background 0.15s, transform 0.15s; box-shadow: 0 2px 8px rgba(91,78,248,0.25); }
nav .nav-cta:hover { background: #4a3de6; transform: translateY(-1px); }

/* ─── Hero ──────────────────────────── */
.hero { padding: 5rem 1.5rem 4rem; text-align: center; background: linear-gradient(180deg, #faf9ff 0%, #ffffff 100%); border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-badge { display: inline-block; font-size: 12px; font-weight: 500; background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-mid); padding: 4px 14px; border-radius: 20px; margin-bottom: 1.5rem; }
.hero h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 1rem; }
.hero-sub { font-size: 1.05rem; color: var(--muted); max-width: 480px; margin: 0 auto 2rem; line-height: 1.65; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: white; font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; padding: 13px 28px; border-radius: 30px; box-shadow: 0 4px 16px rgba(91,78,248,0.3); transition: all 0.15s; }
.hero-btn:hover { background: #4a3de6; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(91,78,248,0.35); color: white; }

/* ─── Platforms ─────────────────────── */
.platforms { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 0.5rem; }
.platform-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; transition: border-color 0.15s, box-shadow 0.15s; }
.platform-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.platform-card.plus { background: var(--accent-light); border-color: var(--accent-mid); }
.platform-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.platform-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.platform-detail { font-size: 11.5px; color: var(--muted); }

/* ─── How ───────────────────────────── */
.how { padding: 4rem 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.steps { display: flex; align-items: flex-start; margin-top: 0.5rem; }
.step { flex: 1; display: flex; gap: 1rem; align-items: flex-start; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: white; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(91,78,248,0.25); }
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 0.3rem; }
.step-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.step-divider { width: 40px; height: 1px; background: var(--border); margin-top: 16px; flex-shrink: 0; }

/* ─── Downloader ────────────────────── */
.downloader-section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.downloader-section h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.5rem; }

.input-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); transition: border-color 0.2s, box-shadow 0.2s; }
.input-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,78,248,0.1); }
.input-row { display: flex; gap: 8px; align-items: center; }
.url-input { flex: 1; background: transparent; border: none; outline: none; font-size: 0.95rem; color: var(--text); font-family: 'Inter', sans-serif; min-width: 0; }
.url-input::placeholder { color: var(--muted); }
.paste-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 500; padding: 5px 10px; cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: 'Inter', sans-serif; }
.paste-btn:hover { color: var(--text); border-color: var(--border-hover); background: #ececf0; }

.options-row { margin-top: 0.85rem; display: flex; gap: 8px; flex-wrap: wrap; }
.select-wrap { position: relative; flex: 1; min-width: 130px; }
.select-wrap select { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; padding: 7px 26px 7px 10px; appearance: none; cursor: pointer; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.15s; }
.select-wrap select:hover { border-color: var(--border-hover); }
.select-wrap select:focus { border-color: var(--accent); }
.select-arrow { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); font-size: 10px; }

.toggle-wrap { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; cursor: pointer; user-select: none; transition: all 0.15s; font-size: 13px; color: var(--muted); white-space: nowrap; }
.toggle-wrap:hover { border-color: var(--border-hover); color: var(--text); }
.toggle-wrap.active { background: var(--accent-light); border-color: var(--accent-mid); color: var(--accent); }
.toggle-switch { width: 28px; height: 16px; background: #d0d0dd; border-radius: 20px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-switch.on { background: var(--accent); }
.toggle-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: white; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toggle-switch.on .toggle-knob { transform: translateX(12px); }

.download-btn { width: 100%; background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; padding: 12px; cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 0.85rem; box-shadow: 0 2px 8px rgba(91,78,248,0.25); }
.download-btn:hover:not(:disabled) { background: #4a3de6; box-shadow: 0 4px 12px rgba(91,78,248,0.3); transform: translateY(-1px); }
.download-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ─── Result ────────────────────────── */
.result-card { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; display: none; margin-top: 0.85rem; box-shadow: var(--shadow); }
.result-card.show { display: block; }
.result-card.success { border-color: var(--success-border); }
.result-card.error { border-color: var(--danger-border); }
.result-header { padding: 0.65rem 1.1rem; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.result-card.success .result-header { background: var(--success-bg); color: var(--success); }
.result-card.error .result-header { background: var(--danger-bg); color: var(--danger); }
.result-body { padding: 1rem 1.1rem; background: var(--card); }
.result-title { font-size: 0.88rem; margin-bottom: 0.3rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta { font-size: 12px; color: var(--muted); margin-bottom: 0.85rem; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: var(--radius-sm); transition: all 0.15s; font-family: 'Inter', sans-serif; cursor: pointer; border: none; }
.action-btn.primary { background: var(--accent); color: white; }
.action-btn.primary:hover { background: #4a3de6; }
.action-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.action-btn.secondary:hover { border-color: var(--border-hover); background: #ececf0; }
.error-msg { font-size: 0.9rem; color: var(--danger); line-height: 1.5; }
.error-hint { font-size: 12px; color: var(--muted); margin-top: 0.5rem; }
.error-hint a, .error-hint code { color: var(--accent); }

/* ─── History ───────────────────────── */
.history-section { margin-top: 1.75rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.history-list { display: flex; flex-direction: column; gap: 5px; }
.clear-btn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif; transition: color 0.15s; }
.clear-btn:hover { color: var(--danger); }
.history-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; transition: border-color 0.15s; text-decoration: none; box-shadow: var(--shadow); }
.history-item:hover { border-color: var(--border-hover); }
.history-icon { width: 26px; height: 26px; border-radius: 6px; background: var(--accent-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.history-info { flex: 1; min-width: 0; }
.history-url { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ─── Spinner ───────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.35); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }

/* ─── Features ──────────────────────── */
.features { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 0.5rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem; transition: border-color 0.15s, box-shadow 0.15s; }
.feature-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature-title { font-size: 14px; font-weight: 600; margin-bottom: 0.3rem; }
.feature-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ─── Footer ────────────────────────── */
footer { padding: 2.5rem 1.5rem; background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.footer-logo span { color: var(--accent); }
.footer-links { display: flex; gap: 1.25rem; font-size: 13px; }
.footer-links a { color: var(--muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }
.footer-note { font-size: 12px; color: var(--muted); max-width: 420px; line-height: 1.5; }

/* ─── Responsive ────────────────────── */
@media (max-width: 600px) {
  .steps { flex-direction: column; gap: 1.5rem; }
  .step-divider { width: 1px; height: 24px; margin: 0 0 0 15px; }
  nav a:not(.nav-cta) { display: none; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}
