/* Shared stylesheet for the platform pages that use the shared template.
   The accent — and the ink tones derived from it — are baked into every page's
   <head> by build.mjs, so nothing here waits for vd-shell.js to run. */

:root {
  --bg: #0f0f10;
  --bg-soft: #141416;
  --card: #191a1c;
  --border: #2a2b2e;
  --border-control: #6b6f78;
  --text: #ececee;
  --muted: #98999c;
  --danger: #ff6b6b;
  --accent-soft: color-mix(in srgb, var(--vd-accent, #8b5cf6) 70%, white);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 80% -10%, color-mix(in srgb, var(--vd-accent, #8b5cf6) 12%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 40px 0 26px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 16px; max-width: 540px; margin: 0 auto; line-height: 1.55; }

.badge {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--vd-accent, #8b5cf6) 35%, var(--border));
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--bg-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- search ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.search-card { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.search { display: flex; gap: 10px; }

.search input {
  flex: 1;
  min-width: 0;
  background: #101113;
  border: 1px solid var(--border-control);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
}

.search input:focus {
  border-color: var(--vd-accent, #8b5cf6);
  /* Full accent, not a 35% tint: the tint lands at 1.45:1 on this background. */
  outline: 2px solid var(--vd-accent, #8b5cf6);
  outline-offset: 1px;
}

.search button {
  background: var(--vd-accent, #8b5cf6);
  border: 0;
  border-radius: 12px;
  color: var(--vd-btn-ink, #0b0b0d);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 20px;
  white-space: nowrap;
}

.search button:disabled { cursor: progress; opacity: 0.7; }

.error { color: var(--danger); font-size: 14px; margin: 12px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.linklike {
  background: none;
  border: 0;
  color: var(--accent-soft);
  cursor: pointer;
  font: inherit;
  /* 24 px minimum target: the hint line is a button, not just text. */
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- result ---------- */
.result { margin: 26px 0 0; display: grid; gap: 22px; }

.result-head { display: flex; gap: 16px; align-items: flex-start; }
.result-head .thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.result-head .meta { min-width: 0; }
.result-title { font-size: 19px; margin: 6px 0 4px; overflow-wrap: anywhere; }
.result-head .uploader { color: var(--accent-soft); font-size: 13px; margin: 0 0 6px; }
.result-head .sub { margin: 0; text-align: left; font-size: 14px; }

.media { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.media-chip { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; margin: 0 0 10px; text-transform: uppercase; }
.media-duration { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.preview { width: 100%; border-radius: 12px; background: #000; display: block; max-height: 420px; object-fit: contain; }
.note { color: var(--muted); font-size: 14px; margin: 0; }

.qualities { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }

.quality {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(70px, auto) 1fr auto;
  padding: 10px 12px;
}

.quality-label { font-weight: 700; font-size: 14px; }
.quality-meta { color: var(--muted); font-size: 13px; }

.download {
  background: color-mix(in srgb, var(--vd-accent, #8b5cf6) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--vd-accent, #8b5cf6) 50%, var(--border));
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
}

.download:disabled { cursor: progress; opacity: 0.6; }

.progress { background: var(--border-control); border-radius: 999px; display: block; grid-column: 1 / -1; height: 4px; overflow: hidden; }
.progress-bar { background: var(--vd-accent, #8b5cf6); display: block; height: 100%; width: 0; transition: width 0.15s linear; }

/* ---------- steps + faq ---------- */
.steps, .faq { margin: 40px 0 0; }
.steps h2, .faq h2 { font-size: 21px; margin: 0 0 16px; }
.step-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.step-n {
  align-items: center;
  background: color-mix(in srgb, var(--vd-accent, #8b5cf6) 25%, transparent);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  margin-bottom: 10px;
  width: 26px;
}
.step h3 { font-size: 15px; margin: 0 0 6px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }

.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; padding: 12px 14px; }
.faq-item summary { cursor: pointer; font-size: 15px; font-weight: 600; padding: 6px 0; }
.faq-item p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 10px 0 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 22px 0 30px; }
.footer p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---------- language list ---------- */
.langnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }

.langnav a {
  border-radius: 8px;
  color: var(--muted);
  display: inline-block;
  font-size: 13px;
  padding: 6px 8px;
  text-decoration: none;
}

.langnav a:hover { background: var(--bg-soft); color: var(--accent-soft); }
.langnav a.cur { color: var(--text); font-weight: 700; }

@media (max-width: 560px) {
  .search { flex-direction: column; }
  .quality { grid-template-columns: 1fr auto; }
  .quality-meta { grid-column: 1 / -1; }
}
