/* Identidad «Profe de mates · en n pasos» (kit v1.4)
   Tinta #121721 · Marfil #F2EBDD · Ámbar #EFB153 · Violeta #A493D8 · Jade #76B7A7
   Ámbar sobre marfil solo como decoración (contraste 1,6:1); el texto informativo va en tinta. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/space-grotesk-700.woff2") format("woff2"); }

:root {
  --tinta: #121721;
  --marfil: #F2EBDD;
  --ambar: #EFB153;
  --violeta: #A493D8;
  --jade: #76B7A7;

  --bg: var(--marfil);
  --panel: #FAF6EE;
  --ink: var(--tinta);
  --muted: #4D5563;          /* 6,7:1 sobre marfil */
  --line: rgba(18, 23, 33, .16);
  --rule: var(--tinta);
  --steps: var(--ambar);
  --btn-bg: var(--tinta);
  --btn-ink: var(--marfil);
  --btn-hover-bg: var(--ambar);
  --btn-hover-ink: var(--tinta);
  --radius: 10px;

  --titulo: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;
  --texto: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --logo: "Space Grotesk", var(--texto);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tinta);
    --panel: #1B2230;
    --ink: var(--marfil);
    --muted: #B9B4AA;
    --line: rgba(242, 235, 221, .16);
    --rule: rgba(242, 235, 221, .55);
    --btn-bg: var(--ambar);
    --btn-ink: var(--tinta);
    --btn-hover-bg: var(--marfil);
    --btn-hover-ink: var(--tinta);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--texto);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }

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

/* ---------- Firma: «n» + tres pasos + «en n pasos» ---------- */
.firma {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.firma-n {
  font-family: var(--logo);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: -.02em;
  position: relative;
  padding-right: 22px;
  line-height: .8;
}
.pasos {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 19px;
  height: 17px;
}
.pasos i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--steps);
}
.pasos i:nth-child(1) { left: 0; bottom: 0; }
.pasos i:nth-child(2) { left: 7px; bottom: 6px; }
.pasos i:nth-child(3) { left: 14px; bottom: 12px; }
.firma-texto { display: flex; flex-direction: column; gap: 3px; }
.firma-texto small {
  font-family: var(--texto);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.firma-texto span {
  font-family: var(--logo);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: -.01em;
}

/* ---------- Cabecera ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-block: 14px;
}
nav ul { list-style: none; display: flex; gap: 4px 18px; margin: 0; padding: 0; flex-wrap: wrap; }
nav a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
  border-bottom: 3px solid transparent;
}
nav a:hover { border-bottom-color: var(--line); }
nav a[aria-current="page"] { border-bottom-color: var(--ambar); }

/* ---------- Tipografía de titulares ---------- */
.kicker {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.titular {
  font-family: var(--titulo);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: .005em;
  margin: 0;
}
.subrayado {
  background-image: linear-gradient(var(--ambar), var(--ambar));
  background-repeat: no-repeat;
  background-size: 100% .14em;
  background-position: 0 92%;
  padding-bottom: .04em;
}

/* ---------- Portada ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding-top: 48px;
  border-bottom: 1px solid var(--rule);
}
.hero-texto { padding-bottom: 36px; }
.hero .titular { font-size: clamp(2.5rem, 7vw, 4.4rem); max-width: 13ch; }
.hero .lema { margin: 18px 0 0; font-size: 1.15rem; max-width: 46ch; color: var(--muted); }
.familia { display: flex; align-items: flex-end; gap: 0; margin-bottom: -1px; }
.familia img { height: 196px; width: auto; margin-left: -22px; }
.familia img:first-child { margin-left: 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0 8px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 20px 22px;
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile .mini { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid currentColor; opacity: .85; }
.tile .mini b { font-family: var(--logo); font-size: 1.05rem; }
.tile h2 { font-size: 2.3rem; margin-top: 18px; max-width: 12ch; }
.tile p { margin: 8px 0 0; font-size: .98rem; max-width: 24ch; }
.tile .pie { margin-top: auto; padding-top: 16px; display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tile img { position: absolute; right: 12px; bottom: 30px; height: 120px; width: auto; }
.tile-tinta { background: var(--tinta); color: var(--marfil); }
.tile-marfil { background: var(--panel); color: var(--tinta); box-shadow: inset 0 0 0 1px rgba(18, 23, 33, .18); }
.tile-ambar { background: var(--ambar); color: var(--tinta); }
@media (prefers-color-scheme: dark) {
  .tile-tinta { box-shadow: inset 0 0 0 1px var(--line); background: #1B2230; }
  .tile-marfil { background: var(--marfil); }
}

h2.section { font-size: 2rem; margin: 48px 0 4px; }

/* ---------- Cabecera de sección (personaje posado en la línea) ---------- */
.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding-top: 40px;
  border-bottom: 1px solid var(--rule);
}
.page-title > div { padding-bottom: 24px; }
.page-title .titular { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.page-title p.desc { margin: 10px 0 0; color: var(--muted); max-width: 52ch; }
.page-title img { height: 150px; width: auto; margin-bottom: -1px; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0 8px; }
.filters input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
.filters input::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}
.chip:hover { background: var(--panel); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Tarjetas ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin: 16px 0 56px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.badge { color: var(--muted); }
.badge:first-child { color: var(--ink); }
.badge + .badge::before { content: "·"; margin-right: 10px; color: var(--muted); }
.card h3 { margin: 2px 0 0; font-family: var(--titulo); font-weight: 700; font-size: 1.55rem; line-height: 1.08; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; flex: 1; }

.btn {
  align-self: flex-start;
  display: inline-block;
  margin-top: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.btn:hover { background: var(--btn-hover-bg); color: var(--btn-hover-ink); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  margin: 0;
}

/* ---------- Pie ---------- */
footer { background: var(--tinta); color: var(--marfil); margin-top: 24px; }
@media (prefers-color-scheme: dark) { footer { background: #0B0F16; border-top: 1px solid var(--line); } }
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px 32px;
  padding-block: 32px 36px;
}
footer .firma { color: var(--marfil); }
footer .lema { margin: 14px 0 0; font-weight: 600; }
footer .meta { font-size: .9rem; color: #C9C3B7; text-align: right; }
footer .meta a { color: var(--marfil); font-weight: 600; }
footer .meta p { margin: 4px 0 0; }

:focus-visible { outline: 3px solid var(--ambar); outline-offset: 2px; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-texto { padding-bottom: 8px; }
  .familia { justify-content: center; }
  .familia img { height: 110px; margin-left: -14px; }
  .page-title { padding-top: 28px; }
  .page-title img { height: 96px; }
  .page-title > div { padding-bottom: 16px; }
  .tile { min-height: 210px; }
  .tile img { height: 96px; }
  footer .meta { text-align: left; }
}
@media (max-width: 520px) {
  nav .largo { display: none; }
  nav ul { gap: 4px 16px; }
}
@media (max-width: 400px) {
  .firma-n { font-size: 2.2rem; }
  .firma-texto span { font-size: 1.15rem; }
  .familia img { height: 92px; margin-left: -12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile { transition: none; }
}
