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

:root {
  --bg:        #07070f;
  --surface:   #0e1118;
  --surface2:  #161d2c;
  --border:    rgba(255 255 255 / 0.07);
  --text:      #eeeef8;
  --muted:     #6b7a9f;
  --accent:    #1877F2;
  --blue2:     #42b0ff;
  --green:     #22d3a0;
  --amber:     #f59e0b;
  --grad:      linear-gradient(135deg, #1877F2 0%, #42b0ff 100%);
  --grad-alt:  linear-gradient(135deg, #0052cc 0%, #1877F2 50%, #42b0ff 100%);
  --radius:    14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NOISE + ORBS ────────────────────────────────────────────────────────────── */
.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 200px;
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(80px); z-index: 0; pointer-events: none;
}
.orb-1 { width: 600px; height: 600px; top: -200px; left: -100px; background: rgba(24,119,242,.1); }
.orb-2 { width: 500px; height: 500px; bottom: -150px; right: -100px; background: rgba(66,176,255,.08); }
.orb-3 { width: 300px; height: 300px; top: 40%; left: 55%; background: rgba(0,82,204,.07); }

/* ── LAYOUT ──────────────────────────────────────────────────────────────────── */
.container { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ─────────────────────────────────────────────────────────────────────── */
nav {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,7,15,.7);
  backdrop-filter: blur(20px);
}

.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -.5px;
}

.nav-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-size: 11px; font-weight: 500; letter-spacing: .5px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px;
}

/* ── HERO ────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; z-index: 2;
  text-align: center; padding: 90px 24px 72px;
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  background: rgba(24,119,242,.1); border: 1px solid rgba(24,119,242,.25);
  border-radius: 100px; padding: 6px 18px;
  margin-bottom: 28px;
  animation: fadeUp .5s ease both;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 800; line-height: 1.0; letter-spacing: -2.5px;
  margin-bottom: 20px;
  animation: fadeUp .5s .08s ease both;
}

.gradient-text {
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: block;
}

.hero-sub {
  font-size: 17px; font-weight: 300; color: var(--muted); line-height: 1.65;
  max-width: 520px; margin: 0 auto 44px;
  animation: fadeUp .5s .16s ease both;
}

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

/* ── URL FORM ────────────────────────────────────────────────────────────────── */
.url-form { animation: fadeUp .5s .24s ease both; }

.input-wrap {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 8px;
  transition: border-color .25s, box-shadow .25s;
}

.input-wrap:focus-within {
  border-color: rgba(24,119,242,.5);
  box-shadow: 0 0 0 3px rgba(24,119,242,.1), 0 24px 64px rgba(0,0,0,.4);
}

.input-icon {
  flex-shrink: 0; padding: 0 4px 0 14px; color: var(--muted);
  pointer-events: none; transition: color .25s;
}

.input-wrap:focus-within .input-icon { color: var(--accent); }

#urlInput {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text);
  padding: 14px 8px;
}

#urlInput::placeholder { color: var(--muted); }

.btn-fetch {
  flex-shrink: 0;
  background: var(--grad);
  border: none; border-radius: 12px;
  padding: 14px 24px;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .3px;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}

.btn-fetch:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.btn-fetch:active { transform: scale(.97); }
.btn-fetch:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-label, .btn-loader { display: flex; align-items: center; gap: 7px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-hints {
  font-size: 12px; color: var(--muted); margin-top: 14px;
  animation: fadeUp .5s .32s ease both;
}

/* ── RESULT SECTION ──────────────────────────────────────────────────────────── */
.result-section { position: relative; z-index: 2; padding: 0 0 56px; }

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 12px;
}

.result-label { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 17px; }

.result-badge {
  font-size: 12px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 3px 12px;
}

.btn-reset {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  transition: border-color .2s, color .2s;
}

.btn-reset:hover { border-color: var(--accent); color: var(--text); }

/* ── MEDIA GRID ──────────────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.media-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  animation: fadeUp .4s ease both;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.media-card:hover {
  border-color: rgba(24,119,242,.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}

.card-thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: var(--surface2);
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-shimmer {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--surface2) 25%, #1a2235 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { 0%{background-position:200%} 100%{background-position:-200%} }

.card-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%);
}

.card-type {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; border-radius: 6px; padding: 3px 9px;
}

.card-type.video {
  background: rgba(24,119,242,.85); color: #fff;
  border: 1px solid rgba(66,176,255,.3);
}

.card-type.image {
  background: rgba(34,211,160,.85); color: #042f22;
  border: 1px solid rgba(34,211,160,.4);
}

.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── QUALITY ROW (select + download button side by side) ─────────────────── */
.quality-row {
  display: flex; align-items: stretch; gap: 8px;
}

.quality-select-wrap {
  position: relative; display: flex; align-items: center;
  flex: 1; min-width: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 10px 0 10px;
  transition: border-color .2s;
  overflow: hidden;
}

.quality-select-wrap:focus-within {
  border-color: rgba(24,119,242,.5);
  box-shadow: 0 0 0 2px rgba(24,119,242,.1);
}

.quality-icon {
  flex-shrink: 0; color: var(--accent); margin-right: 6px; pointer-events: none;
}

.quality-select {
  flex: 1; min-width: 0;
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer;
  padding: 10px 24px 10px 0;
}

.quality-select option {
  background: #161d2c; color: var(--text);
}

.select-arrow {
  position: absolute; right: 10px; color: var(--muted); pointer-events: none; flex-shrink: 0;
}

/* Download button — used both standalone and in quality-row */
.btn-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--grad);
  color: #fff; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: .3px; border-radius: 10px;
  padding: 10px 20px;
  transition: opacity .2s, transform .15s;
  white-space: nowrap; flex-shrink: 0;
}

/* Full-width variant (photos / single quality) */
.btn-dl-full { width: 100%; }

.btn-dl:hover { opacity: .88; transform: translateY(-1px); }
.btn-dl:active { transform: scale(.97); }

.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card-ext {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 100px; padding: 2px 10px;
}

.item-size { font-size: 11px; color: var(--muted); }

.card-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.desc-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 500; padding: 0;
}

/* ── ERROR ───────────────────────────────────────────────────────────────────── */
.error-wrap { padding: 0 0 32px; }

.error-box {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5; border-radius: var(--radius); padding: 14px 18px;
  font-size: 14px; line-height: 1.5;
}

/* ── SECTIONS ────────────────────────────────────────────────────────────────── */
.section { position: relative; z-index: 2; padding: 80px 0; }

.section-dark { background: rgba(255,255,255,.02); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { text-align: center; margin-bottom: 52px; }

.section-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}

.section-head h2 {
  font-family: 'Syne', sans-serif; font-size: clamp(28px, 4vw, 40px);
  font-weight: 800; letter-spacing: -1.5px;
}

/* ── STEPS ───────────────────────────────────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }

.step-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .2s, transform .2s;
  position: relative;
}

.step-card:hover { border-color: rgba(24,119,242,.35); transform: translateY(-3px); }

.step-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(24,119,242,.1); border: 1px solid rgba(24,119,242,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 16px;
}

.step-num {
  font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 8px;
}

.step-card h3 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 8px; }

.step-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── FEATURES ────────────────────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }

.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 20px;
  transition: border-color .2s, transform .2s;
}

.feature-card:hover { border-color: rgba(24,119,242,.3); transform: translateY(-2px); }

.feature-icon { font-size: 28px; margin-bottom: 12px; }

.feature-card h3 { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 8px; }

.feature-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── FAQ ─────────────────────────────────────────────────────────────────────── */
.faq-list { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s;
}

.faq-item.open { border-color: rgba(24,119,242,.3); }

.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; background: none; border: none; cursor: pointer;
  text-align: left; padding: 18px 20px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; color: var(--text);
}

.faq-chevron { flex-shrink: 0; color: var(--muted); transition: transform .3s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }

.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-a p { padding: 0 20px 18px; font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── FOOTER ──────────────────────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  background: rgba(7,7,15,.6); backdrop-filter: blur(20px);
}

.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

.footer-logo { font-size: 16px !important; }

.footer-note { font-size: 12px; color: var(--muted); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  .hero { padding: 60px 16px 48px; }
  .input-wrap { flex-wrap: wrap; border-radius: 14px; }
  .btn-fetch { width: 100%; justify-content: center; }
  footer { padding: 24px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
