/* ===== Reset & base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

*, *::before, *::after {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

:root {
  --pink: #fe2c55;
  --cyan: #25f4ee;
  --dark: #0f0f10;
  --dark-soft: #171719;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #16161a;
  --text-secondary: #3f3f46;
  --muted: #6b7280;
  --border: #ecebee;
  --chip: #f2f2f4;
  --chip-hover: #e7e7ea;
  --placeholder: #a3a3ab;
  --img-placeholder: #eee;
  --header-bg: rgba(250, 250, 250, 0.85);
  --error-bg: #fff1f2;
  --error-border: #ffd6db;
  --error-text: #c81e3a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(22, 22, 26, 0.08);
  --shadow-lg: 0 20px 50px rgba(22, 22, 26, 0.14);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --dark: #2c2c31;
  --bg: #0b0b0c;
  --card: #18181b;
  --text: #f2f2f3;
  --text-secondary: #c7c7cc;
  --muted: #9a9aa2;
  --border: #2a2a2e;
  --chip: #232327;
  --chip-hover: #2c2c31;
  --placeholder: #6c6c74;
  --img-placeholder: #232327;
  --header-bg: rgba(11, 11, 12, 0.85);
  --error-bg: rgba(200, 30, 58, 0.16);
  --error-border: rgba(255, 107, 127, 0.35);
  --error-text: #ff8a99;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--pink), #ff6b8b 40%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg { width: 20px; height: 20px; }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.75;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a.active { opacity: 1; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.theme-toggle:hover { background: var(--chip-hover); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
}

.nav-toggle svg { width: 22px; height: 22px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 60px;
  text-align: center;
  scroll-margin-top: 88px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(circle at 30% 30%, rgba(254, 44, 85, 0.16), transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(37, 244, 238, 0.18), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin: 0 auto 18px;
  position: relative;
}

.hero p.subtitle {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 560px;
  margin: 0 auto 40px;
  position: relative;
}

/* ===== Downloader box ===== */
.downloader {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.input-row {
  display: flex;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}

.input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 18px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}

.input-row input::placeholder { color: var(--placeholder); }

.paste-btn {
  background: var(--chip);
  color: var(--text);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.paste-btn:hover { background: var(--chip-hover); }
.paste-btn svg { width: 19px; height: 19px; }

.download-btn {
  background: linear-gradient(90deg, var(--pink), #ff5c7d);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 20px rgba(254, 44, 85, 0.35);
}

.download-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(254, 44, 85, 0.42); }
.download-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

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

.download-btn.loading .spinner { display: inline-block; }
.download-btn.loading .btn-label { display: none; }

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

.hint {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.error-msg {
  margin-top: 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
  text-align: left;
}

.error-msg.show { display: block; }

/* ===== Result card ===== */
.result-card {
  display: none;
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  text-align: left;
}

.result-card.show { display: block; animation: fadeUp 0.35s ease; }

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

.result-top {
  display: flex;
  gap: 16px;
}

.result-cover {
  width: 96px;
  height: 128px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--img-placeholder);
  flex-shrink: 0;
}

.result-info { min-width: 0; flex: 1; }

.result-info h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.result-info .author {
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-stats {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.result-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: opacity 0.2s, transform 0.15s;
}

.action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.action-btn:hover { transform: translateY(-1px); }

.action-btn.primary {
  background: var(--dark);
  color: #fff;
  grid-column: 1 / -1;
}

.action-btn.secondary {
  background: var(--chip);
  color: var(--text);
}

/* ===== Steps ===== */
.section {
  padding: 76px 0;
  scroll-margin-top: 88px;
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.section-head .eyebrow {
  color: var(--pink);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-head p { color: var(--muted); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  position: relative;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 18px;
}

.step-card h3 { font-size: 1.05rem; margin-bottom: 8px; font-weight: 700; }
.step-card p { color: var(--muted); font-size: 0.92rem; }

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.12), rgba(37, 244, 238, 0.16));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg { width: 22px; height: 22px; color: var(--pink); }

.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 0.9rem; }

/* ===== FAQ ===== */
.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px;
  font-weight: 600;
  font-size: 0.98rem;
  text-align: left;
  color: var(--text);
}

.faq-question svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s;
  color: var(--muted);
}

.faq-item.open .faq-question svg { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-answer p {
  padding: 0 4px 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== About ===== */
.about-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.about-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 10px;
}

.about-body ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 16px;
}

.about-body ul li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.about-credit {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted) !important;
}

.about-credit strong { color: var(--text); }

/* ===== Footer ===== */
.site-footer {
  background: var(--dark-soft);
  color: rgba(255, 255, 255, 0.65);
  padding: 40px 0 28px;
}

.footer-disclaimer {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.65);
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-disclaimer strong { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand .logo-mark { background: #fff; }
.footer-brand .logo-mark svg { color: var(--dark); }
.footer-brand p { font-size: 0.88rem; max-width: 280px; }

.footer-col h4 {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  padding: 6px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== Legal pages ===== */
.legal-hero {
  padding: 64px 0 40px;
  text-align: center;
}

.legal-hero .eyebrow {
  color: var(--pink);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.legal-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.legal-hero p { color: var(--muted); }

.legal-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 90px;
}

.legal-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.legal-toc h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; color: var(--muted); }

.legal-toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; counter-reset: toc; padding-left: 0; }

.legal-toc a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.85;
}

.legal-toc a:hover { color: var(--pink); opacity: 1; }

.legal-section { padding-top: 34px; scroll-margin-top: 90px; }
.legal-section:first-of-type { padding-top: 0; }

.legal-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-section .num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legal-section p, .legal-section li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.legal-section ul { padding-left: 20px; list-style: disc; margin-bottom: 10px; }
.legal-section ul li { margin-bottom: 4px; }

.legal-section .updated {
  display: inline-block;
  background: var(--chip);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .steps-grid, .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc ol { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .input-row { flex-wrap: wrap; border-radius: 22px; }
  .input-row input { width: 100%; order: 1; padding: 10px 12px; }
  .paste-btn { order: 2; }
  .download-btn { order: 3; flex: 1; justify-content: center; padding: 14px; }
  .result-actions { grid-template-columns: 1fr; }
  .result-top { flex-direction: column; }
  .result-cover { width: 100%; height: 200px; }
}
