/* Johann Jara · estilos de la web
   Colores y tipografías de la guía de marca. */

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/montserrat-var.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-italic-var.woff') format('woff');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Marca */
  --midnight: #1a2e47;
  --celeste: #69c4e3;
  --white: #ffffff;
  --smoke: #c9cdd4;
  --coral: #ff7f5f; /* color de acción: todo lo que lleva a conversar */
  --coral-hover: #ff9b80;

  /* Derivados para texto y superficies */
  --celeste-deep: #1b7397; /* celeste legible sobre blanco */
  --midnight-deep: #12213a;

  /* Tema claro */
  --bg: #ffffff;
  --bg-tint: #f3f6f9;
  --text: #1a2e47;
  --text-muted: #4b5d73;
  --rule: #dde1e7;
  --link: var(--celeste-deep);
  --code-bg: #f3f6f9;
  --focus: var(--celeste-deep);

  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --space-section: clamp(4rem, 9vw, 7.5rem);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1c2e;
    --bg-tint: #13233a;
    --text: #e9eef4;
    --text-muted: #a8b4c3;
    --rule: #263a55;
    --link: var(--celeste);
    --code-bg: #0b1625;
    --focus: var(--celeste);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--celeste);
  color: var(--midnight);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--midnight);
  font-weight: 600;
  border-radius: var(--radius);
}

.skip:focus {
  top: 1rem;
}

/* ---------- Plano (fondo de la marca) ---------- */

.blueprint {
  --on-dark: rgba(255, 255, 255, 0.78);
  color: var(--white);
  background-color: var(--midnight);
  background-image:
    linear-gradient(rgba(105, 196, 227, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 196, 227, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(105, 196, 227, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 196, 227, 0.04) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

.blueprint a:not(.button) {
  color: var(--celeste);
}

.blueprint :focus-visible {
  outline-color: var(--celeste);
}

/* ---------- Encabezado ---------- */

.site-header {
  background: var(--midnight);
  color: var(--white);
  border-bottom: 1px solid rgba(105, 196, 227, 0.16);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.wordmark {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

/* En celular el menú baja a una segunda línea */
@media (max-width: 520px) {
  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 0.15rem;
    min-height: 0;
    padding-block: 0.85rem 0.35rem;
  }
  .site-nav {
    width: 100%;
    gap: 1.4rem;
  }
  .site-nav a {
    font-size: 0.9rem;
  }
}

/* ---------- Botones ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button--primary {
  background: var(--coral);
  color: var(--midnight);
}

.button--primary:hover {
  background: var(--coral-hover);
}

.button--light {
  background: var(--celeste);
  color: var(--midnight);
}

.button--light:hover {
  background: var(--white);
}

.button--ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.button--ghost:hover {
  border-color: var(--celeste);
  color: var(--celeste);
}

.button--dark {
  background: var(--midnight);
  color: var(--white);
}

.button--dark:hover {
  background: var(--celeste-deep);
}

@media (prefers-color-scheme: dark) {
  .button--dark {
    background: var(--celeste);
    color: var(--midnight);
  }
  .button--dark:hover {
    background: var(--white);
  }
}

.link-strong {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
}

/* ---------- Portada ---------- */

.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}

.hero__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--celeste);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-weight: 800;
  font-size: clamp(2.35rem, 6.2vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero__lead {
  color: var(--on-dark);
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  max-width: 34rem;
  margin-top: 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero__actions {
  align-items: center;
  gap: 0.75rem 1.75rem;
}

.blueprint .hero__link {
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration-color: var(--celeste);
}

.blueprint .hero__link:hover {
  color: var(--celeste);
}

/* Línea de cota: idea, prototipo, producción.
   Celeste es la estructura; coral marca el destino. */

.dim {
  position: relative;
  max-width: 34rem;
  height: 2.75rem;
  margin-top: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--celeste);
}

.dim__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.5rem;
  height: 0;
  border-top: 1px solid var(--celeste);
  transform-origin: left center;
  animation: dim-draw 1100ms cubic-bezier(0.65, 0, 0.35, 1) 250ms both;
}

.dim__line::before,
.dim__line::after {
  content: '';
  position: absolute;
  top: -0.5rem;
  width: 1px;
  height: 1rem;
  background: var(--celeste);
}

.dim__line::before {
  left: 0;
}

.dim__line::after {
  right: 0;
  width: 2px;
  background: var(--coral);
}

.dim__tick {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 1rem;
  background: var(--celeste);
  animation: dim-label 400ms ease-out 800ms both;
}

.dim__end {
  position: absolute;
  top: 1.25rem;
  white-space: nowrap;
  animation: dim-label 500ms ease-out both;
}

.dim__end--start {
  left: 0;
  animation-delay: 200ms;
}

.dim__end--mid {
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 800ms;
}

.dim__end--finish {
  right: 0;
  color: var(--coral);
  font-weight: 600;
  animation-delay: 1250ms;
}

@keyframes dim-draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes dim-label {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Marco de la foto, como lámina de plano */

.frame {
  margin: 0;
  justify-self: center;
  width: min(100% - 1.5rem, 22rem);
}

/* Sin foto, en celular el monograma no aporta: se oculta */
@media (max-width: 899px) {
  .frame--placeholder {
    display: none;
  }
  /* En celular la foto es más chica para no empujar el contenido */
  .frame {
    width: min(100% - 1.5rem, 15rem);
  }
}

@media (min-width: 900px) {
  .frame {
    justify-self: end;
  }
}

.frame__box {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(105, 196, 227, 0.45);
  background: rgba(18, 33, 58, 0.55);
  display: grid;
  place-items: center;
}

/* Marcas de corte en las esquinas */
.frame__box::before,
.frame__box::after {
  content: '';
  position: absolute;
  inset: -0.75rem;
  pointer-events: none;
  background:
    linear-gradient(var(--celeste), var(--celeste)) left top / 1.25rem 1px,
    linear-gradient(var(--celeste), var(--celeste)) left top / 1px 1.25rem,
    linear-gradient(var(--celeste), var(--celeste)) right top / 1.25rem 1px,
    linear-gradient(var(--celeste), var(--celeste)) right top / 1px 1.25rem,
    linear-gradient(var(--celeste), var(--celeste)) left bottom / 1.25rem 1px,
    linear-gradient(var(--celeste), var(--celeste)) left bottom / 1px 1.25rem,
    linear-gradient(var(--celeste), var(--celeste)) right bottom / 1.25rem 1px,
    linear-gradient(var(--celeste), var(--celeste)) right bottom / 1px 1.25rem;
  background-repeat: no-repeat;
}

.frame__box::after {
  display: none;
}

.frame__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame__monogram {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(6rem, 16vw, 9rem);
  letter-spacing: 0.02em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--celeste);
}

.frame__caption {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--on-dark);
  text-align: center;
}

/* ---------- Secciones ---------- */

.section {
  padding-block: var(--space-section);
}

.section--tint {
  background: var(--bg-tint);
}

.section--rule {
  border-top: 1px solid var(--rule);
}

.section__head {
  display: flex;
  align-items: baseline;
  margin-bottom: 0;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section__title {
  font-weight: 800;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__title--tight {
  margin-bottom: 1rem;
}

.section__intro {
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem);
}

/* Cómo te ayudo: dos caminos */

.paths {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3.5rem;
}

@media (min-width: 900px) {
  .paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem;
  }
}

.path {
  display: flex;
  flex-direction: column;
  padding-top: 1.75rem;
  border-top: 3px solid var(--text);
}

.path__title {
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  letter-spacing: -0.02em;
}

.path__lead {
  margin-top: 0.85rem;
  color: var(--text-muted);
  max-width: 48ch;
}

.path__list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.path__list li {
  padding: 1rem 0 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text-muted);
  position: relative;
}

.path__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.6rem;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--celeste);
}

.path__list strong {
  color: var(--text);
  font-weight: 650;
}

.path__note {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.path__cta {
  align-self: flex-start;
  margin-top: auto;
}

.path__list + .path__cta,
.path__note + .path__cta {
  margin-top: 1.75rem;
}

@media (min-width: 900px) {
  /* Los dos botones quedan a la misma altura */
  .path__list + .path__cta {
    margin-top: auto;
  }
  .path__list {
    margin-bottom: 1.75rem;
  }
}

/* Cómo trabajo: tres pasos sobre una línea */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }
}

.step {
  position: relative;
  padding: 2.25rem 0 0;
  border-top: 2px solid var(--celeste);
}

@media (min-width: 760px) {
  .step {
    padding-right: 2.5rem;
  }
}

.step::before {
  content: '';
  position: absolute;
  left: 0;
  top: -0.6rem;
  width: 2px;
  height: 1.1rem;
  background: var(--celeste);
}

.step--finish {
  border-top-color: var(--coral);
}

.step--finish::before {
  background: var(--coral);
}

.step__num {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--celeste-deep);
  margin-bottom: 0.5rem;
}

.step--finish .step__num {
  color: #c4472a;
}

@media (prefers-color-scheme: dark) {
  .step__num {
    color: var(--celeste);
  }
  .step--finish .step__num {
    color: var(--coral);
  }
}

.step h3 {
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.step p {
  color: var(--text-muted);
  max-width: 32ch;
}

/* Sobre mí */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(3rem, 7vw, 6rem);
    align-items: start;
  }
}

.about__quote {
  margin: 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--celeste);
}

.about__quote p {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

@media (min-width: 900px) {
  .about__quote {
    position: sticky;
    top: 2rem;
  }
}

.about__body > p {
  max-width: 62ch;
  margin-bottom: 1.1rem;
}

.about__body .section__title {
  margin-bottom: 1.5rem;
}

.facts {
  margin: 2.25rem 0 0;
  border-top: 1px solid var(--rule);
}

.facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 560px) {
  .facts div {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1rem;
  }
}

.facts dt {
  font-weight: 600;
  font-size: 0.9375rem;
}

.facts dd {
  margin: 0;
  color: var(--text-muted);
}

/* ---------- Guías ---------- */

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.post-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 760px) {
  .post-item {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 2rem;
  }
}

.post-item__date {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.post-item__title {
  font-weight: 700;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  letter-spacing: -0.01em;
}

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

.post-item__title a:hover {
  color: var(--link);
  text-decoration: underline;
}

.post-item__desc {
  margin-top: 0.5rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.post-item__draft {
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b6462c;
}

.series {
  margin-bottom: clamp(3rem, 7vw, 4.5rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-tint);
  border-left: 3px solid var(--celeste);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.series__eyebrow {
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
}
.series__title {
  margin-top: 0.4rem;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.015em;
}
.series__lead {
  margin-top: 0.75rem;
  max-width: 60ch;
  color: var(--text-muted);
}
.series__start {
  margin-top: 1.5rem;
}
.series__list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .series__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.series__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease;
}
.series__item:hover {
  border-color: var(--celeste);
}
.series__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--celeste);
  color: var(--midnight);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.875rem;
}
.series__name {
  font-weight: 600;
  line-height: 1.35;
}
.series__name small {
  font-weight: 500;
  color: #b6462c;
}
.posts-heading {
  margin-bottom: 0.5rem;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
}

.empty {
  max-width: 40rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--rule);
}

.empty p + p {
  margin-top: 0.6rem;
  color: var(--text-muted);
}

.empty__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

/* ---------- Cabecera de página interna ---------- */

.page-head {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.page-head--full {
  min-height: 70vh;
  display: grid;
  align-items: center;
}

.page-head__title {
  font-weight: 800;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 20ch;
}

.page-head__lead {
  margin-top: 1.25rem;
  max-width: 40rem;
  color: var(--on-dark);
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
}

.back {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.back::before {
  content: '← ';
}

/* ---------- Artículo ---------- */

.wrap--post {
  max-width: calc(46rem + var(--gutter) * 2);
  margin-inline: auto;
}

/* Con índice, el título se alinea con la columna de texto */
@media (min-width: 1100px) {
  .post--toc .wrap--post {
    max-width: var(--wrap);
    padding-left: calc(var(--gutter) + 18rem);
  }
}

.page-head--post .page-head__title {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  max-width: 24ch;
}

.post__meta {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--on-dark);
}

.post__layout {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--space-section);
  display: grid;
  grid-template-columns: minmax(0, 46rem);
  justify-content: center;
  gap: 2.5rem;
}

@media (min-width: 1100px) {
  .post__layout--toc {
    grid-template-columns: 14rem minmax(0, 46rem);
    justify-content: start;
    gap: 4rem;
  }
  .toc {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

.toc {
  font-size: 0.9375rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

@media (min-width: 1100px) {
  .toc {
    padding: 0 0 0 1rem;
    border: 0;
    border-left: 2px solid var(--rule);
    border-radius: 0;
  }
}

.toc__title {
  font-family: var(--font-head);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.toc li + li {
  margin-top: 0.4rem;
}

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

.toc a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Sección que se está leyendo (la marca src/scripts/site.js al hacer scroll) */
.toc a {
  display: block;
  position: relative;
  transition: color 0.2s ease;
}

.toc a[aria-current] {
  color: var(--text);
}

.toc li:has(> a[aria-current])::marker {
  color: var(--link);
}

@media (min-width: 1100px) {
  /* Barra celeste sobre la línea del índice, a la altura de la sección activa */
  .toc a::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-2.2rem - 2px);
    width: 2px;
    background: var(--celeste);
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .toc a[aria-current]::before {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toc a,
  .toc a::before {
    transition: none;
  }
}

/* Texto del artículo */

.prose {
  font-size: 1.125rem;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  font-weight: 800;
  font-size: clamp(1.5rem, 2.8vw, 1.875rem);
  letter-spacing: -0.02em;
  margin-top: 3rem;
}

.prose h3 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-top: 2.25rem;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.9rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose li::marker {
  color: var(--celeste-deep);
}

.prose strong {
  font-weight: 650;
}

.prose blockquote {
  margin-inline: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--celeste);
  color: var(--text-muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: 2.5rem;
}

.prose img,
.prose figure {
  margin-inline: 0;
  border-radius: var(--radius);
}

.prose figure img {
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.prose :not(pre) > code {
  font-family: var(--font-code);
  font-size: 0.88em;
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
}

.code {
  position: relative;
}

.code pre {
  margin: 0;
  /* Arriba queda una franja solo para el botón Copiar: el texto empieza debajo y nunca pasa por detrás del botón. */
  padding: 3.1rem 1.25rem 1.25rem;
  overflow-x: auto;
  background: var(--midnight-deep);
  color: #e3ebf3;
  border-radius: var(--radius);
  font-family: var(--font-code);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 2;
}

/* Prompts y código bajan de línea solos para ajustarse al ancho de la caja.
   Es solo visual: el botón Copiar copia el texto con sus saltos de línea originales. */
.code pre,
.code code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code__copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.35rem 0.7rem;
  font: 600 0.8125rem/1.2 var(--font-body);
  color: var(--white);
  background: rgba(105, 196, 227, 0.16);
  border: 1px solid rgba(105, 196, 227, 0.4);
  border-radius: 4px;
  cursor: pointer;
}

.code__copy:hover {
  background: rgba(105, 196, 227, 0.3);
}

.code__copy[data-state='done'] {
  background: var(--celeste);
  color: var(--midnight);
}

.table {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.975rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

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

.post-cta {
  margin-top: 3.5rem !important;
  padding: 2rem;
  background: var(--bg-tint);
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-cta p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.post-cta .post-cta__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ---------- Contacto y pie ---------- */

.contact {
  padding-block: var(--space-section);
}

.contact__title {
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 18ch;
}

.contact__lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  color: var(--on-dark);
  font-size: 1.125rem;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.contact__actions {
  align-items: center;
}

.contact__alt {
  color: var(--on-dark);
}

.site-footer {
  background: var(--midnight-deep);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-block: 2rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--white);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--celeste);
  text-decoration: underline;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* ---------- Botón flotante de WhatsApp ---------- */

.wa-float {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.7rem 1.15rem 0.7rem 1rem;
  border-radius: 999px;
  background: var(--coral);
  color: var(--midnight);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.28);
  transition: background-color 160ms ease, opacity 200ms ease, transform 200ms ease;
}

.wa-float:hover {
  background: var(--coral-hover);
}

.wa-float:focus-visible {
  outline: 2px solid var(--celeste);
  outline-offset: 3px;
}

/* Se oculta cuando el bloque de contacto ya está en pantalla */
.wa-float[data-hidden] {
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
}

.site-footer {
  padding-bottom: 4.5rem;
}

@media (min-width: 760px) {
  .site-footer {
    padding-bottom: 0;
  }
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .contact,
  .code__copy,
  .post-cta,
  .share,
  .post__download,
  .wa-float {
    display: none;
  }
  .code pre {
    padding-top: 1.25rem;
  }
  .blueprint {
    background: none;
    color: #000;
  }
}

/* Video de YouTube arriba de una guía (frontmatter: youtube) */
.post-video {
  margin: 0 0 2rem;
  aspect-ratio: 16 / 9;
  background: var(--bg-tint);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  overflow: hidden;
}
.post-video--short {
  aspect-ratio: 9 / 16;
  max-width: 22rem;
  margin-inline: auto;
}
.post-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Descarga en PDF y cierre "seguir" de las guías */
.post__download {
  margin-top: 1.5rem;
}
.post__download {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.post__download .button {
  min-height: 2.5rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
}

/* Compartir la guía: tarjeta al final, antes del cierre */
.share {
  margin-top: 3.5rem !important;
  padding: 1.75rem 2rem;
  background: var(--bg-tint);
  border-left: 3px solid var(--celeste);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose .share__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}
.prose .share__lead {
  margin: 0.35rem 0 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
}
.share__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.share__actions .button {
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
}
.prose .share__actions a.button {
  color: var(--white);
  text-decoration: none;
}
.share__native[hidden] {
  display: none;
}
.share__copy {
  background: var(--bg);
  color: var(--text);
  border-color: var(--rule);
  cursor: pointer;
}
.share__copy:hover {
  border-color: var(--celeste);
}
.share__copy[data-state='done'] {
  background: var(--celeste);
  border-color: var(--celeste);
  color: var(--midnight);
}
.share__more {
  margin-top: 1rem;
  font-size: 0.9rem;
}
.share__more summary {
  display: inline-block;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.share__more summary::-webkit-details-marker {
  display: none;
}
.share__more summary:hover {
  color: var(--link);
}
.prose .share__more ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.prose .share__more li {
  margin: 0;
}
.prose .share__more a {
  font-weight: 600;
}
/* En el celular, el botón "Compartir" ya incluye WhatsApp y las demás apps. */
.share--native .share__whatsapp,
.share--native .share__more {
  display: none;
}
/* El cierre queda pegado a la tarjeta de compartir. */
.share + .post-cta {
  margin-top: 1rem !important;
}
@media (prefers-color-scheme: dark) {
  .prose .share__actions a.button--dark {
    color: var(--midnight);
  }
}

.prose .follow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.prose .follow-links li {
  margin: 0;
}
.prose .follow-links .button {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.post-cta .post-cta__pdf {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

/* ---------- Enlaces (/links, link en bio de las redes) ---------- */

main:has(> .links) {
  display: flex;
  flex-direction: column;
}

.links {
  flex: 1;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3rem, 8vw, 5rem);
}

.links__inner {
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.links__profile {
  text-align: center;
}

.links__avatar {
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.4rem;
  padding: 0.35rem;
  border-radius: 50%;
  border: 1px solid rgba(105, 196, 227, 0.5);
  display: grid;
  place-items: center;
}

.links__avatar img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
}

.links__avatar span {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.25px var(--celeste);
}

.links__name {
  font-weight: 800;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  letter-spacing: -0.02em;
}

.links__role {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--celeste);
}

.links__headline {
  margin: 1rem auto 0;
  max-width: 24rem;
  color: var(--on-dark);
  font-size: 1.0625rem;
}

.links__social {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.links a.links__social-link,
.links__social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  transition: color 160ms ease, border-color 160ms ease;
}

.links .links__social a:hover {
  color: var(--celeste);
  border-color: var(--celeste);
}

.links__list {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.links a.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.9rem 1.1rem 0.9rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(105, 196, 227, 0.32);
  background: rgba(15, 28, 46, 0.72);
  color: var(--white);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.links a.link-card:hover {
  border-color: var(--celeste);
  background: rgba(105, 196, 227, 0.1);
}

.link-card__text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.link-card__kicker {
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--celeste);
}

.link-card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.link-card__note {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--on-dark);
}

.link-card__arrow {
  flex: none;
  display: grid;
  color: var(--celeste);
  transition: transform 160ms ease;
}

.link-card:hover .link-card__arrow {
  transform: translateX(3px);
}

.links a.link-card--primary {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--midnight);
}

.links a.link-card--primary:hover {
  background: var(--coral-hover);
  border-color: var(--coral-hover);
}

.link-card--primary .link-card__title {
  font-size: 1.0625rem;
}

.link-card--primary .link-card__note {
  color: rgba(26, 46, 71, 0.82);
}

.link-card--primary .link-card__arrow {
  color: var(--midnight);
}

.links__group {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--on-dark);
}

.links__list--group {
  margin-top: 0.9rem;
}

.links__foot {
  margin-top: 2.75rem;
  text-align: center;
  font-size: 0.8125rem;
}

.links .links__foot a {
  color: var(--on-dark);
  text-decoration: none;
}

.links .links__foot a:hover {
  color: var(--celeste);
}
