/* Dirección D · Plataforma: blanco limpio, un color de acento por web, Inter. */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --fg: #18181b;
  --muted: #55555c;
  --line: #e6e6e9;
  --brand: #871818;
  --a: var(--accent);
  --tint: color-mix(in srgb, var(--a) 9%, var(--surface));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1a1a1d;
    --fg: #ededef;
    --muted: #a6a6ad;
    --line: #2c2c31;
    --a: var(--accent-dark);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--a); text-underline-offset: 3px; }
img { max-width: 100%; }
.i { vertical-align: -3px; margin-right: 6px; flex-shrink: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; border-radius: 4px; }

/* Cabecera */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 14px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--fg); text-decoration: none; }
.brand span { color: var(--a); }
nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
nav a:hover { color: var(--fg); background: var(--bg); }
nav a[aria-current="page"] { color: var(--a); background: var(--tint); }
.by { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.by img { border-radius: 50%; box-shadow: 0 0 0 1.5px var(--a); }
.by:hover { color: var(--fg); }

/* Portada */
.hero { padding: 48px 0 24px; max-width: 760px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 18px; margin: 0; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; margin: 16px 0 40px; }
.section-title { display: flex; align-items: center; font-size: 22px; letter-spacing: -0.02em; margin: 32px 0 16px; }
.section-title .i { width: 22px; height: 22px; color: var(--a); }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; padding: 0; margin: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card h2, .card h3 { margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.card h2 { font-size: 24px; }
.card h3, .card h2.sm { font-size: 19px; }
.card h2 a, .card h3 a { color: var(--fg); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--a); }
.card p { margin: 0; }
.card .more-link { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 15px; }
.card .more-link a { text-decoration: none; display: inline-flex; align-items: center; }
.card .more-link .i { margin: 0 0 0 4px; }
.sotd.big { background: var(--tint); border-color: color-mix(in srgb, var(--a) 25%, var(--line)); }
.search h2 label { cursor: pointer; }
.label { display: flex; align-items: center; margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 14px; }
.pill { display: inline-block; background: var(--tint); color: var(--a); font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 999px; text-decoration: none; overflow-wrap: anywhere; }

/* Formularios */
.field { display: flex; gap: 8px; margin-top: 6px; }
.field input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.field.big { margin: 8px 0; }
.field.big input { font-size: 18px; padding: 16px 18px; background: var(--surface); }
button, .button { font: inherit; font-weight: 600; font-size: 16px; background: var(--a); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-color-scheme: dark) { button, .button { color: #111113; } }
.button .i { margin: 0 0 0 6px; }
.button.ghost { background: transparent; color: var(--a); border: 1px solid var(--line); }
.count { color: var(--muted); font-size: 15px; margin: 4px 0 16px; }
.skills li[hidden] { display: none; }

/* Artículo */
.single { max-width: 760px; padding: 40px 0; display: flex; flex-direction: column; gap: 14px; }
.single h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.03em; margin: 0; }
.lead { font-size: 19px; margin: 0; }
.prose h2 { font-size: 21px; margin: 24px 0 4px; letter-spacing: -0.01em; }
.prose p, .prose ul, .prose ol { margin: 8px 0; }
.prose li { margin: 4px 0; }
.note { color: var(--muted); font-size: 15px; margin: 0; }
code { background: var(--tint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; overflow-wrap: anywhere; }
.author { flex-direction: row; align-items: center; gap: 16px; margin-top: 8px; }
.author img { border-radius: 50%; box-shadow: 0 0 0 2px var(--a); flex-shrink: 0; }

/* Archivo */
.month { text-transform: capitalize; margin-top: 32px; font-size: 20px; }
.list { padding-left: 20px; }
.list li { margin: 8px 0; }
.list small { color: var(--muted); }
.empty, .more { padding: 24px 0; color: var(--muted); }

/* Pie */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 56px; padding: 28px 0; color: var(--muted); font-size: 15px; }
.foot .wrap { display: flex; flex-direction: column; gap: 8px; }
.foot p { margin: 0; }
.foot a { color: var(--muted); }
.foot .by { font-size: 16px; color: var(--fg); font-weight: 600; }

@media (max-width: 640px) {
  .by:not(.foot .by) { display: none; }
  .hero { padding-top: 28px; }
}

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px !important; font-size: 14px; color: var(--muted); }
.chips span { width: 100%; }
.chips a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--fg); background: var(--bg); min-height: 36px; display: inline-flex; align-items: center; }
.chips a:hover { border-color: var(--a); color: var(--a); }

@media (max-width: 640px) {
  .top { position: static; }
  .top .wrap { gap: 6px; padding-block: 10px 6px; }
  nav { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 12px 4px; scrollbar-width: none; }
  nav a { white-space: nowrap; padding: 8px 10px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 17px; }
}

/* Catálogo de skills */
.chips a[aria-current="page"] { border-color: var(--a); color: var(--a); background: var(--tint); }
.chips small { color: var(--muted); margin-left: 4px; }
.skills .card code { font-size: 13px; }
.original summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.original p { color: var(--muted); font-size: 15px; }
.install { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-top: 8px; }
.install h2 { margin-top: 0; font-size: 22px; }
.seg { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.seg label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 15px; }
.seg label:has(input:checked) { border-color: var(--a); background: var(--tint); color: var(--a); font-weight: 600; }
.seg input { accent-color: var(--a); }
.code { margin: 16px 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.code pre { background: #18181b; color: #ededef; border-radius: 12px; padding: 16px 18px; width: 100%; overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0; }
.code pre code { background: none; border: 0; padding: 0; color: inherit; overflow-wrap: normal; }
.code button { order: -1; min-height: 36px; padding: 6px 12px; font-size: 14px; }
.folders { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 12px; display: block; overflow-x: auto; }
.folders th, .folders td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.folders thead th { color: var(--muted); font-weight: 600; font-size: 14px; }

/* Portadas generadas con IA */
.cover { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: #08080a; }
.card-cover { display: block; margin: -22px -22px 4px; border-radius: 15px 15px 0 0; overflow: hidden; }
.card-cover .cover { transition: transform .3s ease; }
.card:hover .card-cover .cover { transform: scale(1.02); }
.hero-cover { border-radius: 16px; margin: 8px 0 20px; }

/* Revisión con impeccable (2026-11-01) */
::placeholder { color: var(--muted); opacity: 1; }
/* Resúmenes de las tarjetas a 4 líneas: tarjetas de altura pareja y menos muro de texto. */
.grid .card > p:not([class]) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; max-width: 68ch; }

/* Escena de aventura gráfica con cuadro de diálogo en HTML (avatar pixel art de Juanjo) */
@font-face { font-family: "VT323"; src: url("/assets/fonts/vt323.woff2") format("woff2"); font-display: swap; }
.scene { position: relative; margin: 8px 0; border-radius: 16px; overflow: hidden; }
.scene img { display: block; width: 100%; height: auto; image-rendering: auto; }
.dialog { position: absolute; left: 5%; right: 5%; bottom: 3%; min-height: 15%; display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; background: #f3dcb0; color: #2a140b; border: 4px solid #3a1d10; box-shadow: 0 0 0 4px #c98a4a; font: clamp(17px, 3.2vw, 26px)/1.1 "VT323", ui-monospace, monospace; }
.dialog b { color: #871818; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 520px) {
  .scene img { aspect-ratio: 1 / .8; object-fit: cover; object-position: top; }
  .dialog { position: static; margin: 0; box-shadow: none; border-width: 3px; }
}

/* Modo aventura: el puerto, los lugares y los diálogos */
.adv { padding: 32px 0 48px; display: flex; flex-direction: column; gap: 18px; }
.adv h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; }
.adv .crumbs { margin: 0; font-weight: 600; }
.scene.wide { margin: 0; }
.scene .portrait { position: absolute; left: 3%; bottom: 4%; width: clamp(84px, 18%, 170px); height: auto; border: 4px solid #3a1d10; box-shadow: 0 0 0 4px #c98a4a; border-radius: 4px; }
.talk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.talk .dialog { position: static; min-height: 0; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.15; }
.talk .dialog strong { font-weight: 400; color: #871818; }
.talk .dialog a { color: #871818; }
.talk .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; font: 16px/1.4 Inter, system-ui, sans-serif; }
.talk .acts .button { background: #871818; color: #fff; min-height: 40px; padding: 8px 14px; }
.talk-nav { display: flex; align-items: center; gap: 14px; max-width: 860px; font: 22px "VT323", ui-monospace, monospace; }
.talk-nav button { font: inherit; background: #3a1d10; color: #f3dcb0; min-height: 44px; }
.talk-nav button:disabled { opacity: .4; cursor: default; }
.places .who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.places .who img { border-radius: 50%; }
.talk .dialog[hidden] { display: none; }

/* Juego del modo aventura */
.game { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: calc(62vh * 1.5); }
.game.fade .stage { opacity: 0; }
.stage { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 12px; background: #120806; cursor: crosshair; transition: opacity .25s; user-select: none; }
.stage .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.stage .hero, .stage .npc { position: absolute; width: auto; transform: translateX(-50%); pointer-events: none; image-rendering: pixelated; filter: drop-shadow(0 6px 4px rgba(0,0,0,.45)); }
.stage .hero.left { transform: translateX(-50%) scaleX(-1); }
.stage .spot { position: absolute; background: transparent; border: 2px dashed transparent; border-radius: 8px; cursor: pointer; min-height: 0; padding: 0; }
.stage .spot:hover, .stage .spot:focus-visible { border-color: #f3dcb0; background: rgba(243, 220, 176, .08); outline: none; }
.stage .spot.exit span { position: absolute; left: 4px; bottom: 6px; font: 20px "VT323", monospace; color: #f3dcb0; background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.stage .hint { position: absolute; top: 3%; left: 0; right: 0; margin: 0; text-align: center; font: clamp(18px, 2.4vw, 28px) "VT323", monospace; color: #f3dcb0; text-shadow: 0 2px 0 #000, 0 0 6px #000; pointer-events: none; }
.gbox.dialog { position: static; min-height: 0; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.15; cursor: default; }
.gbox .who { margin: 0; color: #871818; text-transform: uppercase; }
.gbox .line { margin: 4px 0 0; }
.gbox .line strong { font-weight: 400; color: #871818; }
.gbox .choices { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; }
.gbox .choice { font: inherit; background: none; border: 0; padding: 2px 0; min-height: 0; color: #3a1d10; text-align: left; cursor: pointer; text-decoration: none; }
.gbox .choice::before { content: "▸ "; color: #871818; }
.gbox .choice:hover, .gbox .choice:focus-visible { color: #871818; text-decoration: underline; outline: none; }
.gbox .ask { display: flex; gap: 8px; margin-top: 8px; font: 16px Inter, system-ui, sans-serif; }
.gbox .ask input { flex: 1; min-width: 0; padding: 8px 10px; border: 2px solid #3a1d10; border-radius: 6px; font: inherit; }
.gbox .ask button { background: #871818; color: #fff; min-height: 40px; }
.adv-help { margin: 0; color: var(--muted); font-size: 15px; }

/* Carteles de los edificios: tablón de madera colgado, con icono alusivo y el nombre de la fuente */
.sign { display: inline-flex; align-items: center; gap: .3em; padding: .2em .45em; background: #5a2e17; color: #f3dcb0; border: 2px solid #2b140a; box-shadow: inset 0 0 0 1px #8a4b26, 0 3px 0 rgba(0,0,0,.35); font: 400 clamp(10px, 1.35vw, 17px)/1 "VT323", ui-monospace, monospace; letter-spacing: .03em; white-space: nowrap; image-rendering: pixelated; }
.sign svg { width: 1.1em; height: 1.1em; flex-shrink: 0; color: #e0464b; }
.signs .sign, .scene .sign.top { position: absolute; transform: translate(-50%, -100%); pointer-events: none; }
.signs .sign::before, .signs .sign::after { content: ""; position: absolute; bottom: 100%; width: 2px; height: .7em; background: #2b140a; }
.signs .sign::before { left: 20%; } .signs .sign::after { right: 20%; }
.signs .sign.big, .scene .sign.top { top: 4%; transform: translateX(-50%); font-size: clamp(16px, 2.6vw, 32px); }
.scene .sign.top { left: 50%; }
.sign.flat { font-size: 18px; }
