:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
  color: #f5f5f5;
  --surface: #0a0a0a;
  --surface-raised: #111;
  --border: #242424;
  --border-hover: #444;
  --muted: #929292;
  --accent: #fff;
  --success: #8ee6af;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #000; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

.page { width: min(100% - 40px, 1080px); margin: 0 auto; padding: 24px 0 64px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-size: 1.15rem; font-weight: 800; letter-spacing: -.055em; text-decoration: none; }
.brand span { color: #777; }
.platform, .section-heading span { color: #777; font-size: .78rem; }
.platform { border: 1px solid var(--border); border-radius: 99px; padding: 7px 11px; }

.hero { max-width: 760px; padding: 112px 0 76px; }
.eyebrow { margin: 0 0 16px; color: #777; font-size: .68rem; font-weight: 750; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(2.7rem, 8vw, 5.7rem); line-height: .94; letter-spacing: -.075em; }
.lead { max-width: 540px; margin: 26px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
h2 { font-size: 1.1rem; letter-spacing: -.025em; }
.section-heading { margin-bottom: 14px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-card {
  min-height: 280px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.tool-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.tool-card.selected { border-color: #ddd; background: var(--surface-raised); }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #2d2d2d; border-radius: 11px; background: #151515; color: #ddd; font-size: 1.05rem; font-weight: 750; }
.status { margin: 25px 0 7px; color: #777; font-size: .72rem; }
.status.ready { color: var(--success); }
h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.025em; }
.tool-card p:not(.status) { margin: 10px 0 22px; color: var(--muted); font-size: .88rem; line-height: 1.55; }

button {
  width: 100%;
  margin-top: auto;
  padding: 12px;
  border: 1px solid #fff;
  border-radius: 10px;
  color: #000;
  background: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease;
}
button:hover { opacity: .84; }
button:active { transform: scale(.985); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button:disabled { border-color: #2b2b2b; color: #666; background: #171717; cursor: not-allowed; }

.converter, .video-downloader {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid #333;
  border-radius: 16px;
  background: var(--surface);
  animation: reveal .22s ease both;
}
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.converter-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.converter h2, .video-downloader h2 { margin: 0; font-size: 1.65rem; }
.close { width: 38px; margin: 0; padding: 4px; border: 0; color: #888; background: transparent; font-size: 1.55rem; }

.url-form { margin-top: 24px; }
.url-form > label { display: block; margin-bottom: 10px; color: #ddd; font-size: .92rem; font-weight: 650; }
.url-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 9px; }
.url-row input {
  min-width: 0;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  background: #050505;
}
.url-row input::placeholder { color: #5f5f5f; }
.url-row button { margin: 0; }

.video-found {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #050505;
}
.video-found img { width: 132px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; background: #151515; }
.video-found span { display: block; margin-bottom: 5px; color: var(--success); font-size: .7rem; }
.video-found strong { display: block; overflow: hidden; color: #f3f3f3; text-overflow: ellipsis; white-space: nowrap; }
.video-found small { display: block; margin-top: 7px; color: #777; font-variant-numeric: tabular-nums; }

.download-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.download-options label { margin: 0; color: #777; font-size: .76rem; }
.download-options select, .format-label select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px 34px 11px 11px;
  border: 1px solid #333;
  border-radius: 9px;
  color: #eee;
  background: #050505;
}

.steps { margin: 20px 0 8px; padding-left: 22px; color: #aaa; font-size: .88rem; line-height: 1.8; }
.hint, .conversion-message { color: #777; font-size: .8rem; line-height: 1.55; }
.hint { margin: 12px 0 0; }
.conversion-message { min-height: 1.25em; margin: 14px 0 0; }
.download-frame { width: 0; height: 0; border: 0; }

.download-progress { margin-top: 16px; padding: 16px; border: 1px solid #292929; border-radius: 12px; background: #050505; }
.progress-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.progress-top strong { color: #eee; font-size: .92rem; }
.progress-top span { color: #777; }
.spinner-line { display: flex; gap: 12px; align-items: center; color: #aaa; font-size: .86rem; }
.spinner { width: 22px; height: 22px; flex: none; border: 2px solid #333; border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.download-progress p { margin: 12px 0 0; color: #666; font-size: .78rem; line-height: 1.5; }

.drop-zone {
  margin: 22px 0 16px;
  padding: 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed #3a3a3a;
  border-radius: 12px;
  color: #ddd;
  background: #050505;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #888; background: #0d0d0d; }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.drop-zone span { color: #777; font-size: .8rem; }
.file-name { color: #ddd; font-weight: 700; }
.format-label { display: block; margin: 14px 0; color: #888; }

.notice { display: flex; gap: 12px; align-items: center; margin-top: 24px; padding: 15px 17px; border: 1px solid #1d1d1d; border-radius: 12px; color: #666; background: #050505; }
.notice span { color: #aaa; }
.notice p { margin: 0; font-size: .78rem; line-height: 1.5; }

@media (max-width: 720px) {
  .page { width: min(100% - 28px, 560px); padding-top: 16px; }
  .hero { padding: 78px 0 48px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .tool-card p:not(.status) { margin-bottom: 24px; }
  .converter, .video-downloader { padding: 20px; }
  .url-row, .download-options { grid-template-columns: 1fr; }
  .video-found { grid-template-columns: 96px minmax(0, 1fr); }
  .video-found img { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
