@font-face {
  font-family: "Dela Gothic One";
  src: url("fonts/dela-gothic-one-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #0d0d0d;
  --muted: #6f6f6f;
  --line: #e4e2dc;
  --soft: #f3f2ef;
  --display: "Dela Gothic One", "Arial Black", sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --measure: 840px;
  --page: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

/* ---------------------------------------------------------------- cabecera */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.nav a {
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------------------------------------------------------------- estructura */

.site-main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 52px 0 10px;
  border-bottom: 1px solid var(--line);
}

.site-main > .section:first-child {
  padding-top: 68px;
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(21px, 2.5vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.section-title a {
  text-decoration: none;
}

.section-link {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.section-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.empty {
  margin: 0 0 44px;
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
}

/* ---------------------------------------------------------------- tarjetas */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 44px 30px;
  padding-bottom: 46px;
}

.grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding-bottom: 72px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
}

.card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--soft);
  margin-bottom: 16px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card-media img {
  transform: scale(1.025);
}

.card-media--contain {
  background: var(--ink);
}

.card-media--contain img {
  object-fit: contain;
}

.card-media--empty {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 54px;
  line-height: 1;
}

.card-kicker {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-kicker span + span::before {
  content: "·";
  margin-right: 8px;
}

.card-title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.card:hover .card-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.card-excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------------------------------------------------------------- sección */

.page-head {
  padding: 66px 0 38px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 44px;
  max-width: 780px;
}

.page-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-head h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.page-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 52ch;
}

/* ---------------------------------------------------------------- artículo */

.post {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 64px 0 100px;
}

.post-kicker {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.post-kicker:hover {
  color: var(--ink);
}

.post-title {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(29px, 4.5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 36px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.post-meta span + span::before {
  content: "·";
  margin-right: 16px;
}

.post-cover {
  margin: 0 0 46px;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.post-cover--square {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.prose {
  font-size: 19.5px;
  line-height: 1.68;
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.35em;
}

.prose h2 {
  margin: 2.2em 0 0.65em;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.prose h3 {
  margin: 1.9em 0 0.55em;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.prose h4 {
  margin: 1.7em 0 0.5em;
  font-size: 18px;
  font-weight: 600;
}

.prose a {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  background: var(--soft);
}

.prose sup.noteref {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
  margin-left: 1px;
}

.prose sup.noteref a {
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding: 0 1px;
}

.prose sup.noteref a:hover {
  background: var(--soft);
}

.prose .noteback {
  margin-left: 4px;
  white-space: nowrap;
  font-size: 0.95em;
  color: var(--muted);
  text-decoration: none;
}

.prose .noteback:hover {
  color: var(--ink);
  background: none;
}

.prose [id^="nota-"] {
  scroll-margin-top: 24px;
}

.prose ul,
.prose ol {
  margin: 0 0 1.35em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose li > p {
  margin-bottom: 0.4em;
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--ink);
  font-style: italic;
  color: #333;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3em 0;
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  background: var(--soft);
  padding: 0.12em 0.34em;
}

.prose pre {
  margin: 1.8em 0;
  padding: 20px 22px;
  overflow-x: auto;
  background: var(--ink);
  color: #f4f3ef;
  font-size: 13.5px;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.prose figure {
  margin: 2.2em 0;
}

.prose figure img {
  display: block;
  width: 100%;
  height: auto;
}

.prose figure figcaption,
.prose figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.prose figure.fig-sized img {
  margin-left: auto;
  margin-right: auto;
}

.prose figure.video-embed {
  margin: 2.2em 0;
}

.prose figure.video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.prose figure.x-embed {
  margin: 2.2em 0;
  max-width: 640px;
}

.x-embed a {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--ink);
  text-decoration: none;
}

.x-embed a:hover {
  background: var(--ink);
  color: var(--paper);
}

.x-embed-kicker,
.x-embed-title,
.x-embed-meta,
.x-embed-cta {
  display: block;
}

.x-embed-kicker {
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.x-embed-title {
  margin-bottom: 8px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.x-embed-meta {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.x-embed-cta {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.x-embed a:hover .x-embed-kicker,
.x-embed a:hover .x-embed-meta {
  color: var(--paper);
}

.prose img {
  height: auto;
}

.table-wrap {
  margin: 1.8em 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.math-block {
  margin: 1.7em 0;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.math-block mjx-container {
  margin: 0 !important;
  max-width: 100%;
}

.math-block mjx-container svg {
  max-width: 100%;
  height: auto;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.post-footer a {
  color: var(--muted);
  text-decoration: none;
}

.post-footer a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------- pie */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
}

.site-footer-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 34px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.footer-brand {
  font-family: var(--display);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}

.footer-brand:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------------------------------------------------------------- móvil */

@media (max-width: 720px) {
  .site-header-inner {
    padding: 18px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 11px;
  }

  .site-main {
    padding: 0 20px;
  }

      .section {
    padding-top: 38px;
  }

  .site-main > .section:first-child {
    padding-top: 46px;
  }

  .grid,
  .grid--wide {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 34px;
  }

  .page-head {
    padding: 44px 0 28px;
    margin-bottom: 34px;
  }

  .post {
    padding: 40px 0 70px;
  }

  .post-title {
    font-size: clamp(28px, 8.2vw, 38px);
  }

  .prose {
    font-size: 18px;
    line-height: 1.66;
  }

  .post-meta span + span::before {
    margin-right: 12px;
  }

  .site-footer-inner {
    padding: 26px 20px;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-media img {
    transition: none;
  }
}
