/* Fuentes locales, sin servicios externos */
@font-face {
  font-family: "Afacad";
  src: url("/static/fonts/afacad/afacad_variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/static/fonts/eb-garamond/garamond_regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/static/fonts/eb-garamond/garamond_mediana.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/static/fonts/eb-garamond/garamond_seminegrita.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* Paleta del CMS. La web publica define su paleta a continuacion. */
:root {
  color-scheme: dark;
  --font-heading: "EB Garamond", Georgia, serif;
  --font-text: "EB Garamond", Georgia, serif;
  --bg: #000000;
  --text: #fff;
  --muted: #ffffff;
  --wine: #ff03ba;
  --accent: #ff03ba;
  --line: #ff03bc73;
}

/* Paleta oficial de la web publica. El amarillo se reserva para enlaces y botones. */
html.public-site {
  color-scheme: dark;
  --font-text: "Afacad", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #580069;
  --text: #edc98b;
  --muted: rgba(237, 201, 139, 0.78);
  --surface: rgba(237, 201, 139, 0.07);
  --surface-hover: rgba(237, 201, 139, 0.12);
  --line: rgba(237, 201, 139, 0.38);
  --accent: #e69900;
  --accent-hover: #edc98b;
  --button-text: #580069;
}
/* Base y accesibilidad */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 var(--font-text);
}
.public-site body {
  font-size: 18px;
  line-height: 1.6;
}
::selection {
  background: var(--text);
  color: var(--bg);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}
/* Cabecera y navegación */
header,
main,
footer {
  max-width: 1120px;
  margin: auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
}
header > a {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
nav,
.eyebrow,
.section-heading span,
footer {
  font-family: var(--font-text);
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
nav a:hover,
header > a:hover {
  color: var(--accent-hover);
}
nav a {
  transition: color 0.18s ease, background 0.18s ease;
}
/* Portada y presentación */
main {
  padding: 0 32px;
}
.intro {
  padding: 88px 0 0;
  max-width: 760px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
h1 {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}
.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--button-text);
  padding: 13px 23px;
  margin-top: 22px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.18s;
}
.button:hover {
  background: transparent;
  color: var(--accent);
}
.button-outline {
  background: transparent;
  color: var(--accent);
}
.button-outline:hover {
  background: var(--accent);
  color: var(--button-text);
}
/* Encabezados de sección */
.content-section {
  margin-top: 88px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 25px;
}
h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0;
}
.section-heading span {
  font-size: 13px;
  color: var(--muted);
}
h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 12px 0;
}
/* Pie de página */
footer {
  margin-top: 0;
  padding: 26px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
/* Adaptación a móvil */
@media (max-width: 600px) {
  header {
    padding: 22px;
    gap: 18px;
    align-items: flex-start;
    flex-direction: column;
  }
  header > a {
    font-size: 22px;
  }
  nav {
    font-size: 14px;
  }
  main {
    padding: 0 22px;
  }
  .intro {
    padding: 64px 0 0;
  }
  .lead {
    font-size: 18px;
  }
  footer {
    padding: 22px;
    flex-wrap: wrap;
    margin-top: 60px;
  }
  .section-heading span {
    font-size: 13px;
  }
  h1 {
    font-size: 34px;
  }
  h2 {
    font-size: 26px;
  }
  h3,
  .publication h3 {
    font-size: 22px;
  }
  .content-section {
    margin-top: 72px;
  }
}
/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
  nav a {
    transition: none;
  }
}
/* Listado de publicaciones */
.publications {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.publication {
  display: block;
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
}
.publication:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.publication h3 {
  font-size: 24px;
  overflow-wrap: anywhere;
}
.publication p {
  font-size: 18px;
  line-height: 1.55;
}
.publication img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}
/* Página de una publicación */
.reading {
  max-width: 850px;
  padding-top: 65px;
}
.reading h1 {
  font-size: clamp(36px, 6vw, 64px);
  overflow-wrap: anywhere;
}
.post-cover {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  margin: 24px 0;
}
.post-body {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.9;
  margin-top: 35px;
}
.post-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 720px;
  margin: 28px auto;
  object-fit: contain;
}
.post-body p,
.post-body li {
  white-space: normal;
}
.post-dates {
  color: var(--muted);
  font-size: 13px;
}
.post-body pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #120e11;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin-left: 0;
  padding-left: 20px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .publications {
    grid-template-columns: 1fr;
  }
  .publication h3 {
    font-size: 22px;
  }
  .reading {
    padding-top: 40px;
  }
}

/* Acciones de la presentación */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-top: 24px;
}
.hero-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin: 0;
}
.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--accent);
  opacity: 0.72;
  transition: opacity 0.18s ease;
}
.github-link::before {
  content: "";
  width: 25px;
  height: 25px;
  background: currentColor;
  -webkit-mask: url("/static/icons/github.svg") center / contain no-repeat;
  mask: url("/static/icons/github.svg") center / contain no-repeat;
}
.github-link img {
  display: none;
}
.github-link:hover {
  opacity: 1;
}
.github-link:focus-visible {
  outline-offset: 4px;
}
.text-action,
.profile-link {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
}
.text-action:hover,
.profile-link:hover {
  color: var(--accent);
}
.text-action span {
  margin-left: 10px;
}

/* Contacto */
.contact-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 0 0 80px;
}
.contact-section p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  max-width: 600px;
}
.contact-email {
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.contact-section strong {
  color: var(--text);
  font-weight: 500;
}
.profile-link {
  white-space: nowrap;
  border-bottom: 1px solid var(--accent);
}
.profile-link span {
  margin-left: 30px;
}
.footer-name {
  font-family: var(--font-heading);
  font-size: 21px;
}
footer {
  align-items: center;
  margin-top: 20px;
}
.copyright {
  font-size: 14px;
}
@media (max-width: 600px) {
  .contact-section {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 48px;
    padding: 0 0 32px;
  }
  .hero-actions {
    gap: 22px;
  }
}
