/* PokeMitos · estilo de la web.
   Cielo de día con nubes de pixel art que pasan despacio y, al final de la página, un prado. Encima, todo va en las
   ventanas de los vídeos (motor/src/ui/narrator.mjs): ventana azul de Explorers of Sky (borde oscuro, filo claro,
   bisel azul, cuerpo azul marino) y cuadro dorado de los avisos destacados (filo dorado, cuerpo verde oscuro).
   Fuente de PMD (site/fonts/pmd.otf): 1 píxel de letra = 0,1 em, así que los tamaños van en múltiplos de 10 px. */

@font-face {
  font-family: "PMD";
  src: url("../fonts/pmd.otf") format("opentype");
  font-display: swap;
}

:root {
  --ui: 4px;                      /* 1 píxel de interfaz, como el ×4 de los cuadros de los vídeos */
  --out: #101428;
  --rim: #d8e8f8;
  --bevel: #6080c0;
  --body: #182860;
  --gold: #f8e060;
  --gold-rim: #f8d060;
  --gold-body: #0e2e2c;
  --cyan: #88d8f8;
  --ink: #ffffff;
  --muted: #b8c8e8;
  --shadow: #10101c;
  --ok: #98e070;
  --bad: #f88870;
  --field: #0c1640;
  --maxw: 1120px;
  /* Ventanas en 9 trozos dibujadas píxel a píxel (7×7, se cortan a 3 px) */
  --win: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath fill='%23101428' d='M1 0h5v1H1zM0 1h1v5H0zM6 1h1v5H6zM1 6h5v1H1z'/%3E%3Cpath fill='%23d8e8f8' d='M1 1h5v1H1zM1 2h1v3H1zM5 2h1v3H5zM1 5h5v1H1z'/%3E%3Cpath fill='%236080c0' d='M2 2h3v1H2zM2 3h1v1H2zM4 3h1v1H4zM2 4h3v1H2z'/%3E%3Cpath fill='%23182860' fill-opacity='.96' d='M3 3h1v1H3z'/%3E%3C/svg%3E");
  --win-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath fill='%231c1206' d='M1 0h5v1H1zM0 1h1v5H0zM6 1h1v5H6zM1 6h5v1H1z'/%3E%3Cpath fill='%23f8d060' d='M1 1h5v1H1zM1 2h1v3H1zM5 2h1v3H5zM1 5h5v1H1z'/%3E%3Cpath fill='%23b87828' d='M2 2h3v1H2zM2 3h1v1H2zM4 3h1v1H4zM2 4h3v1H2z'/%3E%3Cpath fill='%230e2e2c' fill-opacity='.97' d='M3 3h1v1H3z'/%3E%3C/svg%3E");
  /* Cursor de menú de PMD (triángulo de 4×7) */
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%2310101c' d='M1 1h1v7H1zM2 2h1v5H2zM3 3h1v3H3zM4 4h1v1H4z'/%3E%3Cpath fill='%23f8e060' d='M0 0h1v7H0zM1 1h1v5H1zM2 2h1v3H2zM3 3h1v1H3z'/%3E%3C/svg%3E");
  /* Nubes (128×64 nativo) y borde de prado (32×16 nativo), dibujados en tools/: se amplían ×4 */
  --clouds: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27128%27 height=%2764%27 shape-rendering=%27crispEdges%27%3E%3Cpath fill=%27%23ffffff%27 d=%27M118 5h3v1h-3zM116 6h2v1h-2zM121 6h2v1h-2zM20 8h5v1h-5zM113 8h3v1h-3zM123 8h1v1h-1zM18 9h2v1h-2zM25 9h2v1h-2zM112 9h1v1h-1zM124 9h2v1h-2zM16 10h2v1h-2zM27 10h2v1h-2zM111 10h1v1h-1zM126 10h1v1h-1zM15 11h1v1h-1zM29 11h1v1h-1zM127 11h1v1h-1zM30 13h5v1h-5zM11 14h4v1h-4zM35 14h1v1h-1zM10 15h1v1h-1zM36 15h1v1h-1zM9 16h1v1h-1zM37 17h3v1h-3zM8 18h1v1h-1zM40 18h2v1h-2zM42 20h1v1h-1zM83 35h7v1h-7zM82 36h1v1h-1zM90 36h1v1h-1zM81 37h1v1h-1zM91 37h1v1h-1zM80 38h1v1h-1zM92 38h1v1h-1zM93 39h6v1h-6zM78 40h2v1h-2zM99 40h1v1h-1zM75 41h3v1h-3zM100 41h1v1h-1zM74 42h1v1h-1zM101 43h4v1h-4zM73 44h1v1h-1zM105 44h2v1h-2zM107 46h1v1h-1z%27/%3E%3Cpath fill=%27%23f8fcff%27 d=%27M118 6h3v1h-3zM116 7h7v1h-7zM116 8h7v1h-7zM20 9h5v1h-5zM113 9h4v1h-4zM118 9h6v1h-6zM18 10h9v1h-9zM113 10h3v1h-3zM122 10h4v1h-4zM16 11h13v1h-13zM15 12h15v1h-15zM15 13h15v1h-15zM15 14h20v1h-20zM11 15h25v1h-25zM10 16h27v1h-27zM9 17h28v1h-28zM9 18h16v1h-16zM27 18h13v1h-13zM10 19h9v1h-9zM28 19h14v1h-14zM83 36h7v1h-7zM82 37h9v1h-9zM81 38h11v1h-11zM80 39h13v1h-13zM80 40h19v1h-19zM78 41h22v1h-22zM75 42h26v1h-26zM74 43h27v1h-27zM74 44h9v1h-9zM91 44h14v1h-14zM75 45h7v1h-7zM92 45h7v1h-7zM100 45h7v1h-7z%27/%3E%3Cpath fill=%27%23cfe8f8%27 d=%27M117 9h1v1h-1zM112 10h1v1h-1zM116 10h6v1h-6zM112 11h5v1h-5zM118 11h9v1h-9zM113 12h3v1h-3zM122 12h5v1h-5zM25 18h2v1h-2zM9 19h1v1h-1zM19 19h9v1h-9zM9 20h16v1h-16zM27 20h15v1h-15zM10 21h9v1h-9zM28 21h14v1h-14zM83 44h8v1h-8zM74 45h1v1h-1zM82 45h10v1h-10zM99 45h1v1h-1zM74 46h9v1h-9zM91 46h16v1h-16zM75 47h7v1h-7zM92 47h7v1h-7zM100 47h7v1h-7z%27/%3E%3C/svg%3E");
  --grass: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2732%27 height=%2716%27 shape-rendering=%27crispEdges%27%3E%3Cpath fill=%27%2358b040%27 d=%27M6 1h1v1h-1zM22 1h1v1h-1zM5 2h1v1h-1zM7 2h1v1h-1zM14 2h1v1h-1zM21 2h1v1h-1zM23 2h1v1h-1zM28 2h1v1h-1zM2 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM13 3h1v1h-1zM15 3h1v1h-1zM18 3h1v1h-1zM21 3h1v1h-1zM23 3h1v1h-1zM27 3h1v1h-1zM29 3h1v1h-1zM1 4h1v1h-1zM3 4h1v1h-1zM5 4h1v1h-1zM8 4h1v1h-1zM10 4h1v1h-1zM13 4h1v1h-1zM15 4h1v1h-1zM17 4h1v1h-1zM19 4h1v1h-1zM21 4h1v1h-1zM24 4h1v1h-1zM27 4h1v1h-1zM29 4h1v1h-1zM31 4h1v1h-1zM0 5h1v1h-1zM4 5h1v1h-1zM9 5h1v1h-1zM11 5h1v1h-1zM13 5h1v1h-1zM16 5h1v1h-1zM20 5h1v1h-1zM25 5h2v1h-2zM30 5h1v1h-1z%27/%3E%3Cpath fill=%27%2370c850%27 d=%27M6 2h1v1h-1zM22 2h1v1h-1zM6 3h1v1h-1zM14 3h1v1h-1zM22 3h1v1h-1zM28 3h1v1h-1zM2 4h1v1h-1zM6 4h2v1h-2zM14 4h1v1h-1zM18 4h1v1h-1zM22 4h2v1h-2zM28 4h1v1h-1zM1 5h3v1h-3zM5 5h4v1h-4zM10 5h1v1h-1zM14 5h2v1h-2zM17 5h3v1h-3zM21 5h4v1h-4zM27 5h3v1h-3zM31 5h1v1h-1zM0 6h32v1h-32zM0 7h7v1h-7zM8 7h12v1h-12zM21 7h11v1h-11zM0 8h3v1h-3zM4 8h11v1h-11zM16 8h12v1h-12zM29 8h3v1h-3zM0 9h32v1h-32zM0 10h9v1h-9zM10 10h14v1h-14zM25 10h7v1h-7zM0 11h32v1h-32zM0 12h2v1h-2zM3 12h14v1h-14zM18 12h14v1h-14zM0 13h30v1h-30zM31 13h1v1h-1zM0 14h12v1h-12zM13 14h19v1h-19zM0 15h32v1h-32z%27/%3E%3Cpath fill=%27%2390dc68%27 d=%27M7 7h1v1h-1zM20 7h1v1h-1zM3 8h1v1h-1zM15 8h1v1h-1zM28 8h1v1h-1zM9 10h1v1h-1zM24 10h1v1h-1zM2 12h1v1h-1zM17 12h1v1h-1zM30 13h1v1h-1zM12 14h1v1h-1z%27/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: #5aaeee linear-gradient(#3f98e6 0%, #6cbcf2 45%, #a8dcf8 100%) fixed;
  min-height: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 20px/26px "PMD", ui-monospace, monospace;
  text-shadow: .1em 0 0 var(--shadow), .1em .1em 0 var(--shadow);
  -webkit-font-smoothing: none;
  font-smooth: never;
}
/* Nubes: capa fija que se desliza (transform, sin repintar la página) */
body::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: -512px; right: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--clouds) repeat 0 24px / 512px 256px;
  image-rendering: pixelated;
  animation: drift 160s linear infinite;
}
@keyframes drift { to { transform: translateX(512px); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
main { flex: 1; }
img, video, canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--gold); }
:focus-visible { outline: var(--ui) solid var(--gold); outline-offset: var(--ui); }
h1, h2, h3 { margin: 0; font-weight: normal; color: var(--gold); }
h1 { font-size: 40px; line-height: 50px; }
h2 { font-size: 40px; line-height: 50px; }
h3 { font-size: 30px; line-height: 40px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.hl { color: var(--gold); }
.cy { color: var(--cyan); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
@media (min-width: 900px) { h1 { font-size: 60px; line-height: 70px; } }

/* ---------- Ventanas ---------- */
.win {
  border: calc(var(--ui) * 3) solid transparent;
  border-image: var(--win) 3 fill / calc(var(--ui) * 3) stretch;
  padding: 16px 20px;
}
.win.gold { border-image-source: var(--win-gold); }
.win.tight { padding: 8px 14px; }
.win.thin { --ui: 2px; padding: 0; }
.tag {
  display: inline-block;
  border: calc(var(--ui) * 3) solid transparent;
  border-image: var(--win-gold) 3 fill / calc(var(--ui) * 3) stretch;
  padding: 0 10px;
  color: var(--gold);
  white-space: nowrap;
}

/* ---------- Botones: entradas de menú de PMD ---------- */
.btn {
  position: relative;
  display: inline-block;
  border: calc(var(--ui) * 3) solid transparent;
  border-image: var(--win) 3 fill / calc(var(--ui) * 3) stretch;
  padding: 6px 18px 6px 34px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  background: none;
  text-shadow: inherit;
}
.btn.gold { border-image-source: var(--win-gold); color: var(--gold); }
.btn::before {
  content: "";
  position: absolute;
  left: 12px; top: 50%;
  width: 10px; height: 16px;
  margin-top: -8px;
  background: var(--cursor) no-repeat 0 0 / 10px 16px;
  opacity: 0;
}
.btn:hover::before, .btn:focus-visible::before { opacity: 1; animation: blink 0.8s steps(1) infinite; }
.btn:hover { color: var(--gold); }
.btn[disabled] { opacity: .55; cursor: wait; }
@keyframes blink { 50% { opacity: 0; } }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; padding: 8px 0; }
.top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 14px; }
.logo { display: flex; align-items: center; font-size: 30px; line-height: 40px; color: var(--gold); white-space: nowrap; }
.logo img { width: 46px; height: 46px; flex: none; margin-right: 10px; }
.logo span { color: var(--cyan); }
.logo:hover { color: var(--gold); }
.menu { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.menu a { position: relative; display: block; padding: 4px 10px 4px 22px; color: var(--ink); }
.menu a::before { content: ""; position: absolute; left: 4px; top: 50%; width: 10px; height: 16px; margin-top: -9px; background: var(--cursor) no-repeat 0 0 / 10px 16px; opacity: 0; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--gold); }
.menu a:hover::before, .menu a[aria-current="page"]::before { opacity: 1; }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: inline-block; padding: 2px 12px 2px 30px; }
  .menu { display: none; position: absolute; right: 16px; top: 72px; flex-direction: column; gap: 4px; min-width: 210px;
    border: calc(var(--ui) * 3) solid transparent; border-image: var(--win) 3 fill / calc(var(--ui) * 3) stretch; padding: 8px 6px; }
  .menu.open { display: flex; }
  .menu a { padding: 6px 10px 6px 26px; }
}

/* ---------- Secciones ---------- */
section { padding: 28px 0; }
section[id] { scroll-margin-top: 100px; }
.head { display: inline-block; max-width: 100%; margin-bottom: 18px; }
.head p { margin-top: 4px; color: var(--muted); }
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
ul.pix { list-style: none; margin: 8px 0 0; padding: 0; }
ul.pix li { position: relative; padding-left: 22px; margin-bottom: 6px; }
ul.pix li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 10px; height: 16px; background: var(--cursor) no-repeat 0 0 / 10px 16px; }

/* ---------- Portada ---------- */
.hero { padding-top: 12px; }
.hero .wrap { display: grid; gap: 20px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) 460px; gap: 32px; } }
@media (max-width: 899px) { .hero .screen { order: -1; } }
.hero .tag { margin-bottom: 14px; }
.hero h1 { margin-bottom: 14px; }
.screen { position: relative; justify-self: center; width: 100%; max-width: 460px; }
.screen .frame { position: relative; padding: 0; overflow: hidden; display: grid; place-items: center; }
.screen canvas { width: 100%; height: auto; }
.screen .narr {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  --ui: 2px;
  border: calc(var(--ui) * 3) solid transparent;
  border-image: var(--win) 3 fill / calc(var(--ui) * 3) stretch;
  padding: 6px 10px; min-height: 70px; margin: 0;
}
.screen .series { position: absolute; left: 8px; top: 8px; --ui: 2px; padding: 0 8px; font-size: 20px; }

/* ---------- Formatos ---------- */
.fmt { display: flex; flex-direction: column; gap: 10px; }
.fmt .stage { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 300px; margin: 0 0 6px; }
@media (min-width: 760px) { .fmt .stage { height: 380px; } }
.fmt .stage > .win.thin { height: 100%; flex: none; }
.fmt .stage video, .fmt .stage canvas { height: 100%; width: auto; max-width: none; }
.fmt .stage > .win.thin.desk { height: auto; flex: 1 1 0; min-width: 0; max-width: 340px; align-self: center; }
.fmt .stage .desk canvas { width: 100%; height: auto; }
.fmt .note { color: var(--muted); }
.price { font-size: 30px; line-height: 40px; color: var(--gold); }
.fmt .btn { align-self: flex-start; margin-top: auto; }

/* ---------- Ejemplos ---------- */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .gallery { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.piece { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px 12px; }
.piece .media { margin: -2px -4px 0; }
.piece video { width: 100%; height: auto; aspect-ratio: 9 / 16; }
.piece .num { color: var(--gold); }

/* ---------- Pasos ---------- */
.steps .n { font-size: 30px; line-height: 40px; color: var(--gold); margin-bottom: 4px; }
.steps h3, .fmt h3 { margin-bottom: 4px; }

/* ---------- Formularios ---------- */
form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field legend { color: var(--gold); padding: 0; }
.field .hint { color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], textarea {
  width: 100%;
  font: inherit; color: var(--ink); text-shadow: inherit;
  background: var(--field);
  border: var(--ui) solid var(--bevel);
  box-shadow: 0 0 0 var(--ui) var(--out);
  padding: 8px 10px;
  border-radius: 0;
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: #7a88b8; }
input:focus, textarea:focus { border-color: var(--gold); outline: none; }
textarea { min-height: 150px; resize: vertical; }
/* Opciones: cajas de menú con cursor (display:block para que la ventana no se parta en varias líneas) */
.choices { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .choices.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .choices.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .box {
  display: block; height: 100%;
  border: calc(var(--ui) * 3) solid transparent;
  border-image: var(--win) 3 fill / calc(var(--ui) * 3) stretch;
  padding: 8px 12px 8px 32px;
  position: relative;
}
.choice .box::before { content: ""; position: absolute; left: 10px; top: 13px; width: 10px; height: 16px; background: var(--cursor) no-repeat 0 0 / 10px 16px; opacity: 0; }
.choice .box b { display: block; font-weight: normal; }
.choice .box small { display: block; font-size: 20px; color: var(--muted); }
.choice input:checked + .box { border-image-source: var(--win-gold); }
.choice input:checked + .box b { color: var(--gold); }
.choice input:checked + .box::before { opacity: 1; }
.choice:hover .box::before { opacity: .6; }
.choice input:focus-visible + .box { outline: var(--ui) solid var(--gold); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { appearance: none; flex: none; width: 24px; height: 24px; margin: 2px 0 0; background: var(--field); border: var(--ui) solid var(--bevel); box-shadow: 0 0 0 var(--ui) var(--out); cursor: pointer; }
.check input:checked { background: var(--gold); border-color: var(--gold-rim); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.result { display: none; }
.result.show { display: block; }
.result.ok h3 { color: var(--ok); }
.result.bad h3 { color: var(--bad); }

/* ---------- Preguntas ---------- */
details { margin-bottom: 12px; }
details:last-child { margin-bottom: 0; }
details summary { cursor: pointer; color: var(--gold); list-style: none; position: relative; padding-left: 22px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; position: absolute; left: 2px; top: 5px; width: 10px; height: 16px; background: var(--cursor) no-repeat 0 0 / 10px 16px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
details p { margin-top: 8px; }

/* ---------- Pie, sobre el prado ---------- */
footer {
  margin-top: 28px;
  padding: 0 0 92px;
  color: var(--muted);
  background: var(--grass) repeat-x 0 100% / 128px 64px, linear-gradient(transparent calc(100% - 44px), #70c850 calc(100% - 44px));
  image-rendering: pixelated;
}
footer .win { display: grid; gap: 10px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer p { margin: 0; }

/* ---------- Texto legal ---------- */
.prose h2 { font-size: 30px; line-height: 40px; margin: 26px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
