/*
 * Virtual Devices — pagina publica. Sin dependencias externas.
 * Dos temas: claro y oscuro (como el plugin). data-theme en <html> lo pone el script del <head>:
 * lo elegido con el boton, o el del sistema. Todos los pares texto/fondo pasan 4,5:1 (la mayoria 7:1).
 */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --band: #f3f4f6;
  --surface: #ffffff;
  --text: #111316;
  --text-soft: #2b3036;
  --muted: #4a515b;
  --line: #d9dde3;
  --input-line: #8a929d;
  --accent: #9a4a00;
  --accent-hover: #7a3a00;
  --accent-text: #ffffff;
  --topbar: rgba(255, 255, 255, 0.94);
  --placeholder-line: #8a929d;
  --code-bg: #eceef1;
  --ok: #1a6b3d;
  --error: #a3221b;
  /* Graficos */
  --graph-bg: #ffffff;
  --graph-grid: #e4e7ec;
  --graph-zero: #6b737e;
  --graph-text: #4a515b;
  --curve-left: #0e7a72;
  --curve-right: #b5532a;
  --radius: 10px;
  --wrap: 1080px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161a;
  --band: #1c1f24;
  --surface: #202329;
  --text: #eef0f3;
  --text-soft: #d5d9df;
  --muted: #b4bac3;
  --line: #343840;
  --input-line: #6c737d;
  --accent: #f2a93b;
  --accent-hover: #ffc061;
  --accent-text: #1a1205;
  --topbar: rgba(20, 22, 26, 0.94);
  --placeholder-line: #6c737d;
  --code-bg: #2a2e35;
  --ok: #5fd08f;
  --error: #ff8a80;
  --graph-bg: #111317;
  --graph-grid: #2c3037;
  --graph-zero: #8d959f;
  --graph-text: #b4bac3;
  --curve-left: #3fd0bf;
  --curve-right: #ff8a5c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code { font: 0.92em ui-monospace, Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
section { padding: 72px 0; }
.band { background: var(--band); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.15rem; color: var(--text-soft); }
.intro { max-width: 760px; }
.note { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--band); border-radius: 0 6px 6px 0; }
ul.plain { padding-left: 1.2em; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.theme-toggle {
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
  font: inherit; font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"] .theme-toggle .icon-moon, :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--text); font-size: 0.95rem; }
.nav a.lang { color: var(--muted); }
.nav a.button { color: var(--accent-text); }
@media (max-width: 760px) {
  .nav a:not(.button):not(.lang) { display: none; }
  .nav { gap: 12px; }
  .theme-label { display: none; }
}
@media (max-width: 420px) {
  .nav a.button { display: none; }
}

/* Botones */
.button {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; padding: 12px 22px; border-radius: 999px;
}
.button:hover { background: var(--accent-hover); text-decoration: none; }
.button.small { padding: 7px 14px; font-size: 0.9rem; }
.button:disabled { opacity: 0.6; cursor: default; }

/* Inicio */
.hero { padding: 64px 0 72px; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }
.hero-art { width: 100%; height: auto; display: block; border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25); }
.shot { margin: 40px 0 0; }
.shot img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.shot figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 8px; }
.media-gap { margin-bottom: 20px; }
.download-head { display: flex; gap: 20px; align-items: center; }
.download-head img { width: 96px; height: 96px; border-radius: 20px; flex: none; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0f1114; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 9; border-radius: var(--radius);
  border: 1px dashed var(--placeholder-line); color: var(--muted); background: var(--band);
}
p.placeholder { aspect-ratio: auto; padding: 28px 16px; margin: 0; }
.shot.placeholder { aspect-ratio: auto; padding: 56px 16px; }

/* Que es */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.features p { color: var(--text-soft); }

/* Reproductor A/B */
.ab { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface); }
.ab .ab-title { flex: 1 1 100%; font-weight: 600; margin: 0; }
.ab .switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ab .switch button { border: 0; background: transparent; font: inherit; padding: 8px 16px; cursor: pointer; color: var(--muted); }
.ab .switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.ab .play { min-width: 112px; }
.ab .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.ab progress { flex: 1 1 160px; height: 6px; accent-color: var(--accent); }

/* Capturas */
.group-title { margin-top: 40px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.category { margin: 28px 0 8px; font-size: 1.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
@media (max-width: 400px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card h4 { margin: 0; font-size: 1.05rem; }
.card .device { color: var(--muted); margin: 0; font-size: 0.92rem; }
.card svg { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--graph-bg); }
/* Colores del informe reemplazados por los del tema (CSS le gana a los atributos del SVG) */
.card svg line { stroke: var(--graph-grid); }
.card svg line[stroke="#8b939e"] { stroke: var(--graph-zero); }
.card svg text { fill: var(--graph-text); }
.card svg polyline[stroke="#0e7a72"] { stroke: var(--curve-left); }
.card svg polyline[stroke="#b5532a"] { stroke: var(--curve-right); }
.legend .left { background: var(--curve-left); }
.legend .right { background: var(--curve-right); }
.legend { display: flex; gap: 14px; font-size: 0.82rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: 0.88rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.card .how { font-size: 0.85rem; margin-top: auto; }

/* Preguntas */
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--text-soft); }

/* Formularios */
.form { display: grid; gap: 14px; margin-top: 8px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; font-size: 0.92rem; font-weight: 600; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%;
}
.form input[type="checkbox"] { width: auto; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form button { justify-self: start; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--error); }

/* Testers */
.downloads { padding-left: 1.2em; }

/* Pie */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); }
.footer p { margin: 0 0 0.6em; }
