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

:root {
  --bg:       #080808;
  --surface:  #111111;
  --surface2: #1a1a1a;
  --border:   rgba(255 255 255 / 0.07);
  --text:     #f0f0f0;
  --muted:    #6b6b6b;
  --accent:   #ff2020;
  --orange:   #ff7000;
  --green:    #22d3a0;
  --grad:     linear-gradient(135deg, #ff2020 0%, #ff7000 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(90px); z-index: 0; pointer-events: none; }
.orb-1 { width: 600px; height: 600px; top: -200px; left: -120px; background: rgba(255,32,32,.07); }
.orb-2 { width: 500px; height: 500px; bottom: -150px; right: -120px; background: rgba(255,112,0,.06); }
.orb-3 { width: 280px; height: 280px; top: 45%; left: 55%; background: rgba(255,60,0,.04); }

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
.container { position: relative; z-index: 2; max-width: 1060px; 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(8,8,8,.75); backdrop-filter: blur(20px);
}

.logo {
  display: flex; align-items: center; gap: 9px;
  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: 740px; 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(255,32,32,.1); border: 1px solid rgba(255,32,32,.22);
  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(40px, 6.5vw, 72px);
  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(255,32,32,.45);
  box-shadow: 0 0 0 3px rgba(255,32,32,.08), 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 26px;
  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 60px; }

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; 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(300px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  animation: fadeUp .4s ease both;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.media-card:hover {
  border-color: rgba(255,112,0,.3);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
}

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

.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s, opacity .3s;
}
.media-card:hover .card-thumb img { transform: scale(1.04); }

.card-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 50%);
  opacity: 0; transition: opacity .3s;
}
.media-card:hover .card-thumb-overlay { opacity: 1; }

/* Play icon overlay on thumb hover */
.card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Ccircle cx='40' cy='40' r='32' fill='rgba(0,0,0,0.55)'/%3E%3Cpolygon points='32,24 60,40 32,56' fill='white'/%3E%3C/svg%3E") center/60px no-repeat;
  opacity: 0; transition: opacity .25s;
}
.media-card:hover .card-thumb::after { opacity: 1; }

.card-type {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; color: #fff;
}
.card-type.video { background: rgba(255,32,32,.9); }
.card-type.short { background: rgba(255,112,0,.9); }

/* ── CARD BODY ────────────────────────────────────────────────────────────── */
.card-body { padding: 14px 16px; }

.card-title {
  font-size: 0.87rem; font-weight: 600; color: #f0f0f0;
  margin: 0 0 4px; line-height: 1.35; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-author {
  font-size: 0.72rem; color: var(--muted);
  margin: 0 0 10px; line-height: 1.4;
}

.card-desc {
  font-size: 0.73rem; color: #888; margin: 0 0 10px; line-height: 1.5; word-break: break-word;
}

.desc-toggle {
  background: none; border: none; color: var(--accent);
  font-size: 0.71rem; cursor: pointer; padding: 0;
  font-weight: 600; text-decoration: underline;
}
.desc-toggle:hover { color: var(--orange); }

.card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}

.card-quality { font-weight: 600; font-size: 14px; }
.card-ext, .item-size {
  font-size: 11px; color: var(--muted);
  background: var(--surface2); border-radius: 4px; padding: 2px 7px;
}

.badge-no-audio {
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  color: #ff9900;
  background: rgba(255,153,0,.12); border: 1px solid rgba(255,153,0,.3);
  border-radius: 4px; padding: 2px 7px;
}

.btn-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: var(--grad); border: none; border-radius: 10px;
  padding: 11px 16px;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .3px;
  color: #fff; cursor: pointer; text-decoration: none;
  transition: opacity .2s, transform .15s;
}
.btn-dl:hover { opacity: .85; transform: translateY(-1px); }
.btn-dl:active { transform: scale(.97); }

/* ── ERROR ────────────────────────────────────────────────────────────────── */
.error-wrap { padding: 0 0 40px; }
.error-box {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,50,50,.07); border: 1px solid rgba(255,50,50,.22);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 14px; color: #ff7070; line-height: 1.55;
}
.error-box::before { content: '⚠'; flex-shrink: 0; font-size: 16px; margin-top: 1px; }

/* ── SECTIONS ─────────────────────────────────────────────────────────────── */
.section { position: relative; z-index: 2; padding: 80px 0; }
.section-dark { background: var(--surface); }
.section-head { text-align: center; margin-bottom: 52px; }
.section-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.section-head h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800; letter-spacing: -1.5px;
}

/* ── STEPS ────────────────────────────────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 680px) { .steps-grid { grid-template-columns: 1fr; } }

.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 26px;
  position: relative; overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.step-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity .25s;
}
.step-card:hover { border-color: rgba(255,32,32,.25); transform: translateY(-4px); }
.step-card:hover::after { opacity: 1; }

.step-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,32,32,.1); border: 1px solid rgba(255,32,32,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 20px;
}
.step-num {
  font-family: 'Syne', sans-serif; font-size: 42px; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  opacity: .22; line-height: 1; margin-bottom: 10px;
}
.step-card h3 { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step-card p  { font-size: 14px; color: var(--muted); line-height: 1.65; }
.step-card strong { color: var(--text); }

/* ── FEATURES ─────────────────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 22px;
  transition: border-color .25s, transform .25s;
}
.feature-card:hover { border-color: rgba(255,112,0,.25); transform: translateY(-3px); }
.feature-icon { font-size: 26px; margin-bottom: 14px; }
.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.65; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-list { max-width: 680px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; background: none; border: none; text-align: left;
  padding: 20px 0; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: color .2s;
}
.faq-q:hover { color: var(--accent); }
.faq-q:hover .faq-chevron { color: var(--accent); }
.faq-chevron { flex-shrink: 0; color: var(--muted); transition: transform .3s, color .2s; }
.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 0 20px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.faq-a strong { color: var(--text); }

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 30px 40px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-logo { font-size: 17px; }
.footer-note { font-size: 13px; color: var(--muted); }

/* ── SHIMMER ──────────────────────────────────────────────────────────────── */
.thumb-shimmer {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,.04) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

/* ── SCROLLBAR ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  .nav-pills { display: none; }
  .hero { padding: 60px 16px 52px; }
  .input-wrap { flex-direction: column; border-radius: 16px; }
  .input-icon { display: none; }
  #urlInput { padding: 14px 16px; width: 100%; }
  .btn-fetch { width: 100%; justify-content: center; }
  .section { padding: 56px 0; }
  footer { padding: 24px 20px; }
  .media-grid { grid-template-columns: 1fr; }
}

/* ── QUALITY DROPDOWN ─────────────────────────────────────────────────────── */
.quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.quality-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.quality-select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.quality-select:focus {
  border-color: rgba(255,32,32,.45);
  box-shadow: 0 0 0 3px rgba(255,32,32,.08);
}

.quality-select option[disabled] {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

/* Override card-body to stack vertically for single-card layout */
.media-card .card-body {
  display: block;
  padding: 16px 18px;
}

/* Make download button full width in single-card layout */
.media-card .btn-dl {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

/* Single card max width */
.media-grid {
  max-width: 520px;
  margin: 0 auto;
}
