/* Mati Mati · design tokens and site styles.
   Source: Manual de Identidad Visual v2.0 (octubre de 2026).
   §04 colours · §05 type · §06 patterns · §07 grid (8 px module).

   Theming has two independent switches on <html>:
     data-serie="mati|mar|milpa|jacaranda|fiesta|anil|barro|noche"
       the palette of the day (set by theme.js; any element can fix its own)
     data-theme="light|dark"
   Every contrast pair below was checked against WCAG 2.1 AA. */

/* ---------- Brand colours (§04) ---------- */
:root {
  --mati-tinta: #2B1D1A;        /* warm black: never #000 */
  --mati-papel: #FFF9F5;
  --mati-blanco: #FFFFFF;
  --mati-hueso: #F0EAE6;
  --mati-terracota: #C1502E;
  --mati-cacao-rojo: #7A2E1D;
  --mati-mostaza: #D9A93F;
  --mati-turquesa-mar: #44989D;
  --mati-cafe-tierra: #5A3F33;
  --mati-rosa-crema: #FFE7E0;

  --font-titulo: "Fredoka", "Noto Sans", system-ui, sans-serif;
  --font-cuerpo: "Nunito Sans", "Noto Sans", system-ui, sans-serif;

  --r: 28px;            /* cards and panels (Manual: 28 / 44 px) */
  --r-lg: 44px;
  --r-tag: 14px;
  --patron: url("../img/patron-estrella.svg");   /* P11 Estrella de ocho puntas */
}
html:lang(zh) {
  --font-titulo: "Fredoka", "Noto Sans SC", system-ui, sans-serif;
  --font-cuerpo: "Nunito Sans", "Noto Sans SC", system-ui, sans-serif;
}

/* ---------- Light / dark surfaces ---------- */
:root {
  color-scheme: light;
  --bg: var(--mati-papel);
  --surface: var(--mati-blanco);
  --ink: var(--mati-tinta);
  --muted: var(--mati-cafe-tierra);   /* 9.2:1 on papel */
  --line: rgba(43, 29, 26, 0.12);    /* hairlines, as in Chinamitl */
  --line-soft: #EBE3DE;
  --shadow: 0 10px 30px rgba(43, 29, 26, 0.14);
  --shadow-lg: 0 24px 60px rgba(43, 29, 26, 0.22);
  --panel: rgba(255, 249, 245, 0.9);  /* frosted HUD panels */
}
/* Dark mode uses only brand colours (§04): Tinta background, Grafito surfaces,
   Hueso text, Lino secondary text, Piedra lines. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--mati-tinta);
  --surface: #3A3532;                 /* Grafito */
  --ink: var(--mati-hueso);           /* 13.6:1 on Tinta */
  --muted: #B8A890;                   /* Lino, 7.0:1 on Tinta */
  --line: rgba(240, 234, 230, 0.12);
  --line-soft: #3A3532;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --panel: rgba(43, 29, 26, 0.88);    /* Tinta, frosted */
}

/* ---------- The eight series (§04 C), raw values ----------
   pastel 60 % · solido 30 % · acento 10 % · oscuro = large text on pastel
   texto = small text on pastel · trazo = pattern line on pastel
   dfondo / dtrazo = the same roles in dark mode (dark solids of each family);
   dtexto = small text in dark mode when the pastel falls short (Mar) */
:root, [data-serie="mati"] {
  --s-pastel: #FFE7E0; --s-solido: #C1502E; --s-acento: #D9A93F;
  --s-oscuro: #7A2E1D; --s-texto: #7A2E1D; --s-trazo: #ECBAAB;
  --s-dfondo: #7A2E1D; --s-dtrazo: #975748; --s-dtexto: initial;
}
[data-serie="mar"] {
  --s-pastel: #CDDFDD; --s-solido: #2F6B73; --s-acento: #3A7A6D;
  --s-oscuro: #2F6B73; --s-texto: #2B1D1A; --s-trazo: #9EBCBD;
  --s-dfondo: #2F6B73; --s-dtrazo: #52858A; --s-dtexto: var(--mati-hueso);
}
[data-serie="milpa"] {
  --s-pastel: #D8E6D0; --s-solido: #2F5D4E; --s-acento: #DE7D2A;
  --s-oscuro: #2F5D4E; --s-texto: #2F5D4E; --s-trazo: #A5BDA9;
  --s-dfondo: #2F5D4E; --s-dtrazo: #547B6B; --s-dtexto: initial;
}
[data-serie="jacaranda"] {
  --s-pastel: #E8E4F1; --s-solido: #4A2F5B; --s-acento: #E08C8C;
  --s-oscuro: #4A2F5B; --s-texto: #4A2F5B; --s-trazo: #B9AEC4;
  --s-dfondo: #4A2F5B; --s-dtrazo: #6D577C; --s-dtexto: initial;
}
[data-serie="fiesta"] {
  --s-pastel: #F4E2C0; --s-solido: #C93A80; --s-acento: #A3AE45;
  --s-oscuro: #C93A80; --s-texto: #2B1D1A; --s-trazo: #E7B0AD;
  --s-dfondo: #683547; --s-dtrazo: #875B62; --s-dtexto: initial;
}
[data-serie="anil"] {
  --s-pastel: #CBD5E1; --s-solido: #2E4A7D; --s-acento: #C98A2E;
  --s-oscuro: #2E4A7D; --s-texto: #2E4A7D; --s-trazo: #9CABC3;
  --s-dfondo: #1F3552; --s-dtrazo: #455871; --s-dtexto: initial;
}
[data-serie="barro"] {
  --s-pastel: #E4CCB3; --s-solido: #5A3F33; --s-acento: #D9556B;
  --s-oscuro: #5A3F33; --s-texto: #5A3F33; --s-trazo: #BBA28D;
  --s-dfondo: #5A3F33; --s-dtrazo: #785E4F; --s-dtexto: initial;
}
[data-serie="noche"] {
  --s-pastel: #E4DFD8; --s-solido: #3A3532; --s-acento: #D9A93F;
  --s-oscuro: #3A3532; --s-texto: #3A3532; --s-trazo: #B1ACA6;
  --s-dfondo: #231B2E; --s-dtrazo: #4D4653; --s-dtexto: initial;
}

/* ---------- Roles used by the components ---------- */
:root, [data-serie] {
  --serie-fondo: var(--s-pastel);
  --serie-solido: var(--s-solido);
  --serie-acento: var(--s-acento);
  --serie-titulo: var(--s-oscuro);
  --serie-texto: var(--s-texto);
  --serie-trazo: var(--s-trazo);
  --boton-bg: var(--s-solido);       /* white text ≥ 4.7:1 */
  --boton-texto: var(--mati-blanco);
  --panel-bg: var(--s-solido);
  --panel-texto: var(--mati-blanco);
}
:root[data-theme="dark"], :root[data-theme="dark"] [data-serie] {
  --serie-fondo: var(--s-dfondo);
  --serie-titulo: var(--s-pastel);   /* large text: ≥ 4.38:1 on dfondo */
  --serie-texto: var(--s-dtexto, var(--s-pastel)); /* small text: ≥ 5:1 */
  --serie-trazo: var(--s-dtrazo);
  --boton-bg: var(--s-pastel);       /* tinta text ≥ 10:1 */
  --boton-texto: var(--mati-tinta);
  --panel-bg: var(--s-dfondo);
  --panel-texto: var(--mati-hueso);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-cuerpo); font-size: 18px; line-height: 1.6;
  display: flex; flex-direction: column; min-height: 100vh;
  transition: background-color .2s ease, color .2s ease;
}
main { flex: 1; }
main:focus { outline: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--font-titulo); margin: 0; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(36px, 5.4vw, 56px); line-height: 1.12; }
h2 { font-weight: 600; font-size: clamp(28px, 3.4vw, 32px); line-height: 1.25; }
h3 { font-weight: 600; font-size: 22px; line-height: 1.3; }
p { margin: 0; max-width: 65ch; }
.caption { font-size: 13px; line-height: 1.4; color: var(--muted); }
.lead { font-size: 20px; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.wrap--text { width: min(720px, 100% - 32px); }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--mati-turquesa-mar); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Words in an indigenous language: Fredoka Bold, accent colour (§05).
   In articles: <span class="lang" lang="nah">Tlasojkamati</span> */
.lang { font-family: var(--font-titulo); font-weight: 700; color: var(--serie-texto); }

/* ---------- Pattern (§06, soft mode), only in small blocks ---------- */
.patron { position: relative; background-color: var(--serie-fondo); isolation: isolate; }
.patron::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-color: var(--serie-trazo);
  -webkit-mask: var(--patron) 0 0 / 40px 40px repeat;
  mask: var(--patron) 0 0 / 40px 40px repeat;
}

/* ---------- Panels (frosted, floating) ---------- */
.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* ---------- Buttons: pills, like Chinamitl and the conjugator ---------- */
.pill, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border: 0; border-radius: 999px;
  font-family: var(--font-titulo); font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center; white-space: nowrap;
  background: var(--boton-bg); color: var(--boton-texto); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, filter .15s ease;
}
.pill:hover, .button:hover { transform: translateY(-1px); filter: brightness(0.95); }
.pill:active, .button:active { transform: translateY(0); }
.pill--solid { background: var(--boton-bg); color: var(--boton-texto); }
/* Soft: the series pastel, text in its dark colour. */
.pill--soft, .button--line, .button--paper {
  background: var(--serie-fondo); color: var(--serie-texto); box-shadow: none;
}
.pill--soft:hover, .button--line:hover { filter: brightness(0.96); }
.pill--panel { background: var(--panel); color: var(--ink); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill--panel:hover { background: var(--serie-fondo); filter: none; }
/* Ko-fi: Mostaza takes Tinta text, never white (§04). */
.pill--kofi, .button--kofi { background: var(--mati-mostaza); color: var(--mati-tinta); }
.pill--kofi::before, .button--kofi::before { content: "♥"; color: var(--mati-cacao-rojo); }
.pill--icon { width: 42px; padding: 0; }
.pill--icon svg { width: 20px; height: 20px; }

/* A row of options inside one pill (languages, menu), like Chinamitl's. */
.pill-group {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pill-group ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.pill-group a, .pill-group span[aria-current] {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-titulo); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  color: var(--serie-texto);
}
.pill-group a:hover { background: var(--serie-fondo); }
.pill-group a[aria-current], .pill-group span[aria-current] { background: var(--boton-bg); color: var(--boton-texto); }

.tag {
  display: inline-block; font-family: var(--font-titulo); font-weight: 600;
  font-size: 14px; line-height: 1; letter-spacing: 0.02em;
  padding: 7px 12px; border-radius: var(--r-tag);
  background: var(--boton-bg); color: var(--boton-texto);
}
.tag--soft { background: var(--serie-fondo); color: var(--serie-texto); }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a.tag { text-decoration: none; }

.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-titulo); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color .15s ease;
}
.chip:hover { background: var(--serie-fondo); }
.chip--soft { background: var(--serie-fondo); color: var(--serie-texto); border-color: transparent; }
.chip[aria-pressed="true"] { background: var(--boton-bg); color: var(--boton-texto); border-color: transparent; }

/* ---------- HUD header ---------- */
.hud { position: sticky; top: 0; z-index: 20; padding-top: 12px; pointer-events: none; }
.hud__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud__bar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand.pill { padding: 6px 16px 6px 8px; min-height: 52px; }
.brand .logo { width: 36px; height: 36px; }
.brand span { font-family: var(--font-titulo); font-weight: 700; font-size: 20px; line-height: 1; white-space: nowrap; }
.hud__nav { margin-left: auto; }
.hud__end { display: flex; align-items: center; gap: 8px; }
.langs span[aria-current], .langs a { padding: 6px 11px; font-size: 14px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; color: var(--mati-mostaza); }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Topics: a calm row of chips under the HUD. */
.topics { padding-top: 14px; }
.topics ul {
  display: flex; gap: 8px; list-style: none; margin: 0; padding: 2px 2px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.topics ul::-webkit-scrollbar { display: none; }
.topics__gap { flex: 1; min-width: 8px; }

@media (max-width: 980px) {
  .hud__nav { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .hud__nav ul { justify-content: space-between; flex: 1; }
  .hud__end { margin-left: auto; }
  .hud__follow { display: none; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .brand.pill { padding: 6px; min-height: 48px; }
  .hud__end { gap: 6px; }
  .langs span[aria-current], .langs a { padding: 6px 8px; }
  .hud__nav { padding: 3px; }
  .hud__nav a { padding: 6px 7px; font-size: 14px; }
  .pill--kofi { padding: 9px 12px; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 88px; padding-bottom: 24px; }
.footer-card {
  display: flex; flex-wrap: wrap; gap: 32px 56px;
  padding: clamp(28px, 4vw, 44px); border-radius: var(--r-lg);
  background: var(--serie-fondo);
}
.footer-brand { flex: 1 1 300px; display: grid; gap: 12px; align-content: start; }
.site-footer p { font-size: 16px; }
.footer-col h2 { font-size: 16px; color: var(--serie-titulo); margin-bottom: 8px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 16px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; }

/* ---------- Carousel: big screenshots, HUD text on top ---------- */
.carousel { position: relative; padding-top: 20px; }
.carousel__viewport {
  position: relative; /* keeps absolutely positioned bits of off-screen slides inside */
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); scrollbar-width: none;
}
.carousel__viewport::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: start;
  min-height: clamp(460px, 62vh, 620px); background: var(--serie-fondo);
  display: flex; align-items: flex-end;
}
/* Low-poly illustration on the right, text panel on the left. */
/* Fills the area right of the text panel, whole and centred (never cropped). */
.slide__image {
  position: absolute; top: 28px; right: 32px; bottom: 76px; left: 46%;
  width: calc(54% - 32px); height: calc(100% - 104px);
  object-fit: contain; object-position: center;
}
.slide__panel {
  position: relative; margin: 24px 24px 84px; max-width: 520px;
  padding: 24px 28px; border-radius: var(--r);
  display: grid; gap: 12px; justify-items: start;
}
.slide__panel h2 { color: var(--serie-titulo); font-size: clamp(30px, 3.6vw, 40px); }
.slide__panel p { font-size: 17px; }
.slide__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.carousel__toolbar {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px;
}
.carousel__toolbar .pill { min-height: 36px; width: 36px; font-size: 16px; }
.carousel__dots { display: flex; gap: 6px; padding-inline: 6px; }
.carousel__dot {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--serie-trazo); transition: width .2s ease, background-color .2s ease;
}
.carousel__dot[aria-current="true"] { width: 28px; background: var(--boton-bg); }

/* ---------- Sections ---------- */
.section { padding-top: 72px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 24px;
}
.section-head h2 { color: var(--serie-titulo); }
.section-head p { margin-top: 4px; color: var(--muted); font-size: 16px; }
.empty { background: var(--serie-fondo); border-radius: var(--r); padding: 28px; }

/* ---------- Cards ---------- */
.card-like {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
}

/* News: one feature + headline cards */
.news { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.feature, .headline {
  position: relative; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover, .headline:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature { display: grid; gap: 12px; padding: 12px 12px 24px; }
.feature > :not(.feature__media) { margin-inline: 14px; }
.feature__media { border-radius: calc(var(--r) - 8px); overflow: hidden; aspect-ratio: 16 / 10; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__media .cover { height: 100%; }
.feature h3 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.feature h3 a, .headline h3 a { text-decoration: none; }
.feature h3 a::after, .headline h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.feature h3 a:focus-visible, .headline h3 a:focus-visible { outline: none; }
.feature:has(a:focus-visible), .headline:has(a:focus-visible) { outline: 3px solid var(--mati-turquesa-mar); outline-offset: 3px; }

.headlines { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.headline { display: grid; grid-template-columns: 1fr 112px; gap: 18px; align-items: center; padding: 18px 18px 18px 22px; }
.headline h3 { font-size: 21px; }
.headline p { font-size: 16px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.headline__thumb { width: 112px; aspect-ratio: 1; border-radius: 20px; overflow: hidden; }
.headline__thumb img { width: 100%; height: 100%; object-fit: cover; }
.headline__thumb .cover { height: 100%; }
.meta { font-size: 14px; color: var(--muted); margin-top: 6px; }
.kicker { font-family: var(--font-titulo); font-weight: 600; font-size: 14px; letter-spacing: 0.02em; color: var(--serie-texto); }

/* An article without photo: its series pastel and the monogram. */
.cover { display: grid; place-items: center; background: var(--serie-fondo); }
.cover span {
  font-family: var(--font-titulo); font-weight: 700; font-size: clamp(28px, 6vw, 56px);
  background: var(--boton-bg); color: var(--boton-texto);
  padding: .1em .45em; border-radius: var(--r-tag);
}
.headline__thumb .cover span { font-size: 22px; }

/* Magazine list */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 24px; }
.filters__label { font-family: var(--font-titulo); font-weight: 600; }
.filters__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.headline[hidden], .feature[hidden], li[hidden] { display: none; }
.newsletter {
  margin-top: 32px; padding: 24px 28px; border-radius: var(--r); background: var(--serie-fondo);
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
}
.rss-link { font-family: var(--font-titulo); font-weight: 600; color: var(--serie-texto); }

/* Instagram */
.ig-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.ig-post {
  position: relative; display: block; height: 100%; text-decoration: none;
  border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ig-post:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ig-post img, .ig-post .cover { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.ig-post__text { display: block; padding: 14px 18px 18px; font-size: 15px; line-height: 1.45; }
.ig-post__text time { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.ig-post__kind {
  position: absolute; top: 12px; right: 12px; padding: 5px 10px; border-radius: 999px;
  font-family: var(--font-titulo); font-weight: 600; font-size: 13px;
  background: var(--panel); color: var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ig-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px; border-radius: var(--r); background: var(--serie-fondo); }

/* Projects */
.project-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 12px 12px 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.project-card > :not(.project-card__image) { margin-inline: 12px; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.project-card__image { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; padding: 14px; background: var(--serie-fondo); border-radius: calc(var(--r) - 8px); margin-bottom: 6px; }
.project-card h3 { font-size: 24px; color: var(--serie-titulo); }
.project-card h3 a { text-decoration: none; }
.project-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.project-card h3 a:focus-visible { outline: none; }
.project-card:has(a:focus-visible) { outline: 3px solid var(--mati-turquesa-mar); outline-offset: 3px; }
.project-card p { font-size: 16px; }
.project-card__go { margin-top: auto; }
.project-card--soon { background: var(--serie-fondo); box-shadow: none; padding: 24px 12px; }
.project-card span.project-card__go:not(.pill) { font-family: var(--font-titulo); font-weight: 600; color: var(--serie-texto); }

/* Support band */
.band { display: grid; grid-template-columns: 1fr auto; border-radius: var(--r-lg); overflow: hidden; background: var(--serie-fondo); }
.band__text { padding: clamp(24px, 4vw, 48px); display: grid; gap: 10px; }
.band__text h2 { color: var(--serie-titulo); }
.band__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.band__art { width: clamp(120px, 22vw, 280px); }

/* ---------- Inner pages ---------- */
.page-hero { padding-top: 20px; }
.page-hero .wrap {
  padding: clamp(28px, 5vw, 56px); border-radius: var(--r-lg); background: var(--serie-fondo);
  display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center;
}
.page-hero__text { display: grid; gap: 14px; justify-items: start; }
.page-hero h1 { color: var(--serie-titulo); }
.page-hero__art { width: clamp(120px, 18vw, 200px); aspect-ratio: 1; border-radius: var(--r); }
/* Textile logo: on a plain background, never on a pattern, never cropped (§03). */
.page-hero__logo { width: clamp(140px, 20vw, 220px); height: auto; aspect-ratio: 1; border-radius: var(--r); box-shadow: var(--shadow); }
.page-hero--404 .wrap { min-height: 40vh; }

.statement-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.box { border-radius: var(--r); padding: 28px; display: grid; gap: 12px; align-content: start; justify-items: start; background: var(--serie-fondo); }
.box h2 { color: var(--serie-titulo); }
.box--plain { background: var(--surface); box-shadow: var(--shadow); }
.box--plain h2 { color: var(--ink); }
.promise {
  margin: 20px 0 0; padding: clamp(28px, 5vw, 48px); border-radius: var(--r-lg);
  background: var(--panel-bg); color: var(--panel-texto); text-align: center;
}
.promise p { margin-inline: auto; font-family: var(--font-titulo); font-weight: 700; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.25; max-width: 30ch; }
.promise .promise__label { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 10px; }
.value-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.value-grid li { padding: 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); font-size: 16px; }
.value-grid strong { display: block; font-family: var(--font-titulo); font-weight: 600; font-size: 20px; color: var(--serie-texto); margin-bottom: 4px; }

.two-cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--serie-acento); }
.check-list a { color: var(--serie-texto); font-weight: 700; text-underline-offset: 3px; }

/* ---------- Article page ---------- */
.article-head { padding-top: 20px; }
.article-head .wrap { padding: clamp(24px, 4vw, 44px); border-radius: var(--r-lg); background: var(--serie-fondo); display: grid; gap: 16px; }
.article-head h1 { color: var(--serie-titulo); }
.article-head .meta { margin: 0; color: var(--ink); }
.article-head .meta a { color: var(--serie-texto); font-weight: 700; }
.back-link { justify-self: start; }
.article-cover { margin-block: 24px 0; }
.article-cover img { border-radius: var(--r); width: 100%; box-shadow: var(--shadow); }

.prose { padding-top: 40px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.8em; color: var(--serie-titulo); }
.prose h3 { margin-top: 1.6em; color: var(--serie-titulo); }
.prose a { color: var(--serie-texto); font-weight: 700; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-inline: 0; padding: 20px 24px; border-radius: var(--r); background: var(--serie-fondo); }
.prose img { border-radius: var(--r); }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.prose th { font-family: var(--font-titulo); font-weight: 600; }
.prose hr { border: 0; height: 24px; }
.prose hr::before { content: ""; display: block; height: 6px; width: 80px; background: var(--serie-acento); border-radius: 6px; margin: 9px auto; }
.prose .lang { font-size: 1.1em; }
/* Word of the day, in Markdown: <p class="word"><span class="lang">…</span> «…»</p> */
.prose .word { font-size: 20px; text-align: center; padding: 28px; border-radius: var(--r); background: var(--serie-fondo); max-width: none; }
.prose .word .lang { display: block; font-size: 48px; line-height: 1.15; color: var(--serie-titulo); }
.prose .footnotes, .prose .footnote-definition { font-size: 15px; color: var(--muted); }
.article-actions { margin-top: 40px; display: flex; gap: 12px; }

/* ---------- Ads (only when enabled in site.toml) ---------- */
.ad-slot { margin-top: 48px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.ad-slot__label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }

/* ---------- Small screens ---------- */
/* Carousel: art on top, text below, wherever the two would not fit side by side. */
@media (max-width: 1100px) {
  .slide { min-height: 0; flex-direction: column; align-items: stretch; }
  .slide__image { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 16 / 10; padding: 16px 16px 0; }
  .slide__panel { margin: 0; max-width: none; border-radius: 0; box-shadow: none; border: 0; padding: 20px 20px 76px; }
  .slide__image { max-height: 52vh; object-fit: contain; }
}
@media (max-width: 820px) {
  .news { grid-template-columns: 1fr; }
  .ig-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .band { grid-template-columns: 1fr; }
  .band__art { width: auto; height: 60px; order: -1; }
  .page-hero .wrap { grid-template-columns: 1fr; }
  .page-hero__art { display: none; }
  .page-hero__logo { width: 140px; grid-row: 1; }
}
@media (max-width: 480px) {
  .headline { grid-template-columns: 1fr 84px; gap: 14px; padding: 14px 14px 14px 18px; }
  .headline__thumb { width: 84px; }
  .ig-post__text { font-size: 14px; padding: 10px 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
