:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: rgba(255,255,255,.92);
  --surface-2: #ffffff;
  --text: #141625;
  --muted: #666b7a;
  --line: #e5e7ef;
  --accent: #7357ff;
  --accent-2: #cf3b9f;
  --accent-3: #ff8a4c;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 24px 60px rgba(25, 22, 55, .10);
  --radius: 24px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f17;
  --surface: rgba(24,27,39,.92);
  --surface-2: #171a25;
  --text: #f5f6fb;
  --muted: #a8adbc;
  --line: #2c3040;
  --accent: #9a86ff;
  --accent-2: #ef5eb7;
  --accent-3: #ff9d67;
  --danger: #ff8b83;
  --success: #75e0ad;
  --shadow: 0 24px 60px rgba(0,0,0,.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(115,87,255,.10), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(207,59,159,.09), transparent 30%),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); box-shadow: 0 10px 25px rgba(115,87,255,.25);
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.theme-toggle, .secondary-btn, .primary-btn {
  border: 0; border-radius: 14px; min-height: 46px; padding: 0 18px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; text-decoration: none;
}
.theme-toggle, .secondary-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; box-shadow: 0 10px 24px rgba(115,87,255,.22); }
.theme-toggle:hover, .secondary-btn:hover, .primary-btn:hover { transform: translateY(-1px); }
.theme-toggle:focus-visible, .secondary-btn:focus-visible, .primary-btn:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 2px; }

.hero { text-align: center; padding: 74px 0 50px; }
.eyebrow, .kicker { color: var(--accent); font-weight: 850; font-size: 12px; letter-spacing: .14em; }
.hero h1 { max-width: 870px; margin: 14px auto 14px; font-size: clamp(40px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
.hero > p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.7; }
.download-card {
  text-align: left; max-width: 900px; margin: 38px auto 0; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.download-card > label:first-child { display: block; font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.input-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; }
.input-row input {
  min-width: 0; height: 54px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); color: var(--text); padding: 0 16px; outline: none;
}
.input-row input::placeholder { color: var(--muted); }
.permission-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.permission-check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 1px; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 15px; color: var(--muted); font-size: 12px; }
.examples code { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); border: 1px solid var(--line); padding: 5px 8px; border-radius: 8px; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.loading .spinner { display: inline-block; }
.loading .btn-label { opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { max-width: 900px; text-align: left; margin: 16px auto 0; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); line-height: 1.5; }
.alert.success { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }

.results-section { padding: 38px 0 70px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 22px; }
.section-heading h2, .how-it-works h2 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.section-heading p { color: var(--muted); max-width: 720px; margin: 8px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.media-card { overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 30px rgba(25,22,55,.07); }
.preview-wrap { position: relative; aspect-ratio: 4/5; background: #0a0b10; overflow: hidden; }
.media-image, .media-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-video { background: #000; }
.media-badge { position: absolute; top: 12px; left: 12px; padding: 6px 9px; border-radius: 999px; color: white; background: rgba(0,0,0,.62); backdrop-filter: blur(8px); font-size: 11px; text-transform: uppercase; font-weight: 850; letter-spacing: .08em; }
.media-card-body { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.media-card-body > div { min-width: 0; }
.media-label, .media-file { display: block; }
.media-file { color: var(--muted); font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.media-card-body .primary-btn { min-height: 40px; padding: 0 13px; font-size: 13px; flex: 0 0 auto; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 25px 0 70px; }
.feature-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 25px; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--accent); font-size: 20px; font-weight: 900; }
.feature-grid h3 { margin: 18px 0 8px; font-size: 18px; }
.feature-grid p { color: var(--muted); line-height: 1.65; margin: 0; font-size: 14px; }

.how-it-works { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: start; padding: 55px 0 70px; border-top: 1px solid var(--line); }
.how-it-works ol { list-style: none; counter-reset: steps; padding: 0; margin: 0; display: grid; gap: 14px; }
.how-it-works li { counter-increment: steps; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 18px 62px; }
.how-it-works li::before { content: counter(steps); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 900; }
.how-it-works li strong, .how-it-works li span { display: block; }
.how-it-works li span { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.55; }
.notice-card { border-radius: 20px; padding: 22px 24px; background: color-mix(in srgb, var(--accent-3) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-3) 30%, var(--line)); }
.notice-card p { margin: 6px 0 0; color: var(--muted); line-height: 1.65; font-size: 14px; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px 0 42px; color: var(--muted); font-size: 13px; }
footer nav { display: flex; gap: 18px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

.content-page { max-width: 850px; margin: 50px auto 90px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px,5vw,54px); box-shadow: var(--shadow); }
.content-page h1 { font-size: clamp(34px,6vw,56px); letter-spacing: -.045em; margin: 0 0 18px; }
.content-page h2 { margin-top: 34px; }
.content-page p, .content-page li { color: var(--muted); line-height: 1.75; }
.status-table { width: 100%; border-collapse: collapse; margin-top: 24px; }
.status-table th, .status-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.status-ok { color: var(--success); font-weight: 800; }
.status-bad { color: var(--danger); font-weight: 800; }

@media (max-width: 850px) {
  .hero { padding-top: 48px; }
  .results-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .how-it-works { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 650px) {
  .page-shell { width: min(100% - 20px, 1180px); }
  .topbar { min-height: 72px; }
  .brand small, .theme-text { display: none; }
  .theme-toggle { width: 44px; padding: 0; }
  .hero { padding-top: 38px; }
  .hero h1 { font-size: clamp(39px, 13vw, 58px); }
  .download-card { padding: 14px; border-radius: 19px; }
  .input-row { grid-template-columns: 1fr auto; }
  .input-row input { grid-column: 1 / -1; }
  .input-row .primary-btn { flex: 1; }
  .results-grid, .feature-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading .secondary-btn { width: 100%; }
  .media-card-body { padding: 12px; }
  footer { flex-direction: column; align-items: flex-start; }
}
