/* Plantilla «Mosaico». Se carga después de site.css y solo cambia lo que la distingue: la barra vertical fija,
   el menú que se despliega desde la izquierda, el mosaico de imágenes a sangre y una tipografía más seca.
   Formularios, texto largo, código y demás siguen saliendo de site.css. */

/* Inter Tight (SIL Open Font License, ver fonts/OFL.txt), servida desde el propio sitio. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-tight-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-tight-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #111111;
  --rail: 70px;
  --drawer: min(300px, 100vw - var(--rail));
  --space: 1.5rem;
  --bg: #0a0a0a;
  --surface: #151515;
  --surface-2: #1f1f1f;
  --line: #2b2b2b;
  --text: #f4f4f4;
  --muted: #a3a3a3;
  --code-bg: #141414;
  --radius: 0px;
  --wrap: 1192px;
  --narrow: 852px;
  --gutter: 24px;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root[data-scheme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ececec;
  --line: #e2e2e2;
  --text: #000000;
  --muted: #5c5c5c;
  --code-bg: #f5f5f5;
}

@media (prefers-color-scheme: light) {
  :root[data-scheme="auto"] {
    --bg: #ffffff;
    --surface: #f5f5f5;
    --surface-2: #ececec;
    --line: #e2e2e2;
    --text: #000000;
    --muted: #5c5c5c;
    --code-bg: #f5f5f5;
  }
}

@media (max-width: 740px) {
  :root { --rail: 52px; --gutter: 16px; --space: 1rem; }
}

/* Con el menú abierto la página se sale por la derecha: que no dé desplazamiento lateral ni encoja la vista en el móvil. */
html, body { overflow-x: clip; }
body { display: block; font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
main { flex: 1; padding-bottom: 0; }
main:has(+ .signup-band) { padding-bottom: 0; }
main > .wrap:last-child { padding-bottom: 72px; }

a { text-decoration: none; }
a:hover { color: inherit; }
.prose a, .lead a, .signup-consent a, .site-footer a:hover, .crumbs a:hover, .feed-link a, .pager a, .more:hover, .not-found a:not(.btn), main > .wrap > p a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.012em; }
h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
.skip { z-index: 100; border-radius: 0; }

/* ---- Barra fija y menú ---- */
.rail { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--rail); display: flex; flex-direction: column; align-items: center; background: var(--ink); color: #fff; box-shadow: 1px 0 0 rgb(255 255 255 / 0.08); transition: transform 0.3s ease-in-out; }
.rail a { color: #fff; }
.rail-toggle { flex: none; display: grid; place-items: center; width: 100%; height: 62px; }
.rail-toggle svg { fill: currentColor; }
/* El nombre del sitio, en vertical y leyéndose de abajo arriba; si no cabe, se corta con puntos suspensivos. */
.rail-brand { flex: 1; min-height: 0; width: 100%; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: var(--rail); }
.rail-brand.is-logo { writing-mode: horizontal-tb; transform: none; overflow: visible; display: grid; place-items: center; }
.rail-brand.is-logo img { height: calc(var(--rail) - 26px); width: auto; max-width: 60vh; object-fit: contain; transform: rotate(-90deg); }
.rail .social { flex: none; list-style: none; margin: 0; padding: 14px 0 20px; display: flex; flex-direction: column; gap: 14px; }
.rail .social a { opacity: 0.75; }
.rail .social a:hover { opacity: 1; }

.drawer { position: fixed; inset: 0 auto 0 0; z-index: 31; width: var(--drawer); padding: 25px; overflow-y: auto; overscroll-behavior: contain; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; transform: translateX(-100%); visibility: hidden; transition: transform 0.3s ease-in-out, visibility 0s 0.3s; }
.drawer a { color: #fff; }
.drawer p { margin: 0 0 30px; }
.drawer-logo { display: block; margin-bottom: 20px; }
.drawer-logo img { height: 64px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.drawer .drawer-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.drawer .drawer-text { opacity: 0.75; }
.drawer nav ul { list-style: none; margin: 0 0 30px; padding: 0; }
.drawer nav a { display: block; width: fit-content; padding: 5px 0; font-size: 17px; font-weight: 500; }
.drawer nav a:hover, .drawer nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
.drawer .social { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.drawer .drawer-foot { opacity: 0.6; font-size: 12px; margin: 0; }

.page { position: relative; left: 0; margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; transition: left 0.3s ease-in-out; }
.scrim { display: none; position: fixed; inset: 0 0 0 calc(var(--drawer) + var(--rail)); z-index: 29; cursor: default; }

/* Abierto: lo pone mosaico.js (clase «menu-open») o, sin JavaScript, el propio enlace a «#menu». */
.menu-open .drawer, html:not(.js) .drawer:target { transform: none; visibility: visible; transition: transform 0.3s ease-in-out, visibility 0s; }
.menu-open .rail, html:not(.js) .drawer:target ~ .rail { transform: translateX(var(--drawer)); }
.menu-open .page, html:not(.js) .drawer:target ~ .page { left: var(--drawer); }
.menu-open .scrim, html:not(.js) .drawer:target ~ .scrim { display: block; }

/* ---- Elementos comunes ---- */
.kicker { font: 700 12px/1.4 var(--sans); letter-spacing: 0.08em; color: inherit; margin-bottom: 12px; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.18rem); margin-top: 14px; }
.btn { background: var(--text); border-color: var(--text); color: var(--bg); border-radius: 25px; padding: 11px 24px; font-size: 13px; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; transition: background-color 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); filter: none; }
.btn small { text-transform: none; letter-spacing: 0; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.signup-row .btn, .contact .btn, form.actions .btn, .buy .btn, .cookie-bar .btn { font-size: 13px; font-weight: 500; }
.cookie-bar { border-radius: 0; }
.chip { font: 13px/1.4 var(--sans); letter-spacing: 0; padding: 0; border: 0; border-radius: 0; }
a.chip:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.notice { border-radius: 0; }
.crumbs ol { font: 12px/1.4 var(--sans); margin-bottom: 18px; }
.item-meta { font: 13px/1.4 var(--sans); }
.facts dt { font: 700 11px/1.4 var(--sans); }
.facts dd { font-weight: 500; }
.tags { gap: 4px 14px; margin: 0; }

/* ---- Portada: cartel oscuro con el titular centrado ---- */
.hero { --bg: var(--ink); --text: #fff; --muted: rgb(255 255 255 / 0.82); --line: rgb(255 255 255 / 0.45); background: var(--ink); color: #fff; border: 0; display: grid; align-items: center; min-height: min(64vh, 640px); padding-block: clamp(56px, 10vh, 120px); text-align: center; }
.hero::before { content: none; }
.hero .wrap { max-width: 940px; }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); max-width: none; letter-spacing: -0.015em; line-height: 1.1; }
.hero .kicker { opacity: 0.8; }
.hero .lead { margin: 18px auto 0; }
.hero .actions { justify-content: center; }
.hero.has-bg { min-height: 100vh; min-height: 100svh; }

.band-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 22px var(--space); }
.band-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.more { font-size: 13px; color: inherit; }
.band-dark { --text: #fff; --muted: rgb(255 255 255 / 0.7); --line: rgb(255 255 255 / 0.16); background: var(--ink); color: #fff; }
.band-text { padding-block: clamp(48px, 8vw, 88px); }
.services { gap: 0; border-top: 1px solid var(--line); }
.services li { background: none; border: 0; box-shadow: inset -1px -1px 0 var(--line); padding: var(--space) var(--space) calc(var(--space) * 1.5); }
.service-n { font: 700 12px var(--sans); color: inherit; opacity: 0.6; }
.services h3 { font-size: 24px; }
.services p { font-size: 14px; }

/* ---- Mosaico ----
   Una rejilla de filas muy finas (1/48 del ancho de columna): cada tesela ocupa las que le tocan por su proporción
   y el navegador la sube al primer hueco, así que encajan como en un muro sin JavaScript y sin saltos al cargar. */
.mosaic-wrap { container-type: inline-size; }
.mosaic { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: calc(100cqw / var(--cols) / 48); grid-auto-flow: row dense; }
/* --rows-3 y --rows-2 las pone la plantilla en las teselas que alarga o recorta para que el mosaico acabe recto
   con tres y con dos columnas. */
.mosaic-2 { --cols: 2; }
.tile { position: relative; overflow: hidden; min-width: 0; grid-row: span var(--rows-3, var(--rows, 27)); background: var(--surface-2); color: #fff; }
.tile.ratio-16x9 { --rows: 27; --rows-wide: 54; }
.tile.ratio-4x3 { --rows: 36; --rows-wide: 72; }
.tile.ratio-1x1 { --rows: 48; --rows-wide: 96; }
.tile.ratio-9x16 { --rows: 85; --rows-wide: 170; }
.tile-wide { grid-column: span 2; grid-row: span var(--rows-3, var(--rows-wide, 54)); }
.tile > img, .tile > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Mientras el vídeo de una tesela se reproduce, sobra el triángulo. */
.tile.is-playing::before, .tile.is-playing::after { opacity: 0; }
.tile.is-video::before { content: ""; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgb(0 0 0 / 0.62); }
.tile.is-video::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; transform: translateX(2px); }

/* Sobre la imagen, al pasar el ratón o llegar con el teclado: arriba el antetítulo y el resumen, abajo el título. */
.tile-over { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: var(--space); background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.38) 50%, rgb(0 0 0 / 0.5)); opacity: 0; transition: opacity 0.3s ease-out; }
.tile:hover .tile-over, .tile:focus-within .tile-over { opacity: 1; }
.tile-over p { margin: 0; }
.tile-top { min-height: 0; overflow: hidden; transform: translateY(20px); transition: transform 0.3s ease-in-out; }
.tile-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px !important; }
.tile-summary { font-size: 14px; line-height: 1.4; max-width: 46ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.tile-title { flex: none; font-size: clamp(20px, 2.5cqw, 36px); line-height: 1.08; transform: translateY(-20px); transition: transform 0.3s ease-in-out; }
.tile-title a { color: inherit; }
/* Toda la tesela es clicable sin repetir el enlace para los lectores de pantalla. */
.tile-title a::after { content: ""; position: absolute; inset: 0; }
.tile-title a:focus-visible { outline: 0; }
.tile:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile:hover .tile-top, .tile:hover .tile-title, .tile:focus-within .tile-top, .tile:focus-within .tile-title { transform: none; }
/* Entrada con vídeo de YouTube o Vimeo en el listado del blog: la tesela entera es el botón de reproducir (por debajo
   del texto, que deja pasar el clic) y solo el título lleva a la entrada; sin JavaScript, toda lleva a la entrada. Al pulsarla, el reproductor la ocupa toda. */
.tile-play { display: none; position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.js .tile-play { display: block; }
.tile-play:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.js .tile-player .tile-over { z-index: 2; pointer-events: none; }
.js .tile-player .tile-title a { pointer-events: auto; }
.js .tile-player .tile-title a::after { content: none; }
.tile-player.is-playing .tile-over { display: none; }
.tile > iframe { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; border: 0; background: #000; }

/* Sin imagen: tesela de texto, con el título y el resumen siempre a la vista. */
.tile-text { background: var(--bg); color: var(--text); box-shadow: inset -1px -1px 0 var(--line); transition: background-color 0.3s ease-out; }
.tile-text:hover { background: var(--surface); }
.tile-text .tile-over { opacity: 1; background: none; justify-content: flex-start; gap: 10px; }
.tile-text .tile-top { display: contents; }
.tile-text .tile-kicker { order: 1; margin: 0 !important; color: var(--muted); }
.tile-text .tile-title { order: 2; font-size: clamp(19px, 1.8cqw, 24px); line-height: 1.15; transform: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.tile-text .tile-summary { order: 3; flex: 1; min-height: 0; max-width: none; display: block; color: var(--muted); -webkit-mask-image: linear-gradient(#000 calc(100% - 2.8em), transparent); mask-image: linear-gradient(#000 calc(100% - 2.8em), transparent); }
.tile-date { order: 4; flex: none; margin-top: auto !important; font-size: 12px; color: var(--muted); }

/* Donde no hay ratón el título va siempre puesto, abajo, sobre un degradado. */
@media (hover: none) {
  .tile:not(.tile-text) .tile-over { opacity: 1; background: linear-gradient(to top, rgb(0 0 0 / 0.75), transparent 60%); justify-content: flex-end; }
  .tile:not(.tile-text) .tile-top { display: none; }
  .tile-title { font-size: clamp(18px, 2.2cqw, 28px); transform: none; }
  .tile.is-video::before, .tile.is-video::after { inset: 0 0 20%; }
}

@media (max-width: 1000px) {
  .mosaic { --cols: 2; }
  .tile { grid-row: span var(--rows-2, var(--rows, 27)); }
  .tile-wide { grid-row: span var(--rows-2, var(--rows-wide, 54)); }
}

/* En el móvil, una columna: cada tesela con su proporción y las de texto, con el alto que pida su contenido. */
@media (max-width: 600px) {
  .mosaic { display: block; }
  .tile { aspect-ratio: var(--ratio, 16 / 9); }
  .tile-text { aspect-ratio: auto; }
  .tile-text .tile-over { position: static; }
  .tile-text .tile-summary { flex: none; -webkit-mask-image: none; mask-image: none; }
  .tile-date { margin-top: 4px !important; }
}

/* Navegadores sin unidades de contenedor: columnas de CSS (el orden baja por cada columna en vez de ir de lado a lado). */
@supports not (width: 1cqw) {
  .mosaic { display: block; columns: 3; column-gap: 0; }
  .tile { aspect-ratio: var(--ratio, 16 / 9); break-inside: avoid; }
  @media (max-width: 1000px) { .mosaic { columns: 2; } }
  @media (max-width: 600px) { .mosaic { columns: 1; } }
}

/* ---- Listados ---- */
.page-head { padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(22px, 4vw, 36px); }
.t-projects .page-head, .t-scripts .page-head, .t-posts .page-head, .list-foot { max-width: none; padding-inline: var(--space); }
.list-foot { padding-top: 8px; }
.pager { margin-top: 24px; font-weight: 500; }
.feed-link { margin: 24px 0 0; }
.empty { padding-bottom: 48px; }

/* ---- Página de un contenido: primero lo que se ve, entero, y debajo el texto ---- */
.entry { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding: 48px var(--gutter) 96px; }
.entry h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.cover { margin: 0 0 var(--space); }
.cover img, .cover video { border: 0; border-radius: 0; }
.entry-body { max-width: var(--narrow); }
.entry-head { margin-bottom: 36px; }
.entry-head .facts { margin-top: 28px; }
.entry-head.sale { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.product-shot img { border: 0; }
@media (max-width: 700px) {
  .entry-head.sale { grid-template-columns: minmax(0, 1fr); }
}
.entry-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); }
.entry-info .item-meta { margin: 0; }
/* Anterior y siguiente: fijas abajo a la derecha, y se leen sobre cualquier fondo. */
.entry-nav { position: fixed; right: 10px; bottom: 44px; z-index: 20; display: flex; gap: 2px; mix-blend-mode: difference; }
.entry-nav a { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; }
.to-top { position: fixed; right: 0; bottom: 0; z-index: 20; padding: 10px 14px; font-size: 12px; line-height: 1.6; color: #fff; mix-blend-mode: difference; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; }
.to-top:hover { color: #fff; }
.to-top.is-visible { opacity: 1; visibility: visible; transition: opacity 0.3s, visibility 0s; }

/* ---- Texto largo y formularios ---- */
.prose { font-size: 16px; line-height: 1.65; }
.prose img { border: 0; border-radius: 0; }
.prose code { border-radius: 0; }
.embed { border: 0; }
.copy { border-radius: 0; }
.signup input[type="email"], .signup input[type="text"], .contact textarea { border-radius: 0; }
.signup-band h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
.site-footer { padding-block: 24px; font-size: 13px; }
.site-footer .wrap, .signup-band .wrap { max-width: none; padding-inline: var(--space); }

@media (max-width: 740px) {
  .rail-toggle { height: 54px; }
  .rail-toggle svg { width: 20px; }
  .rail-brand { font-size: 19px; }
  .rail .social { display: none; }
  .entry { padding-top: 28px; padding-bottom: 56px; }
  .entry-nav { position: static; mix-blend-mode: normal; justify-content: space-between; margin-top: 40px; }
  .entry-nav a { color: var(--text); }
  .entry-nav a[rel="next"] { margin-left: auto; }
  .hero.has-bg { min-height: 86vh; min-height: 86svh; }
}

@media (max-height: 520px) {
  .rail .social { display: none; }
}

@media print {
  .rail, .drawer, .scrim, .to-top, .entry-nav { display: none; }
  .page { margin-left: 0; }
}
