:root {
  --bg: #FFFFFF;
  --fg: #0A0A0A;
  --gray-60: #6B6B6B;
  --gray-15: #E8E8E8;
  --radius: 8px;
  --photo-radius: 16px;
  --max-width: 680px;
  --font-sans: 'Inter', -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Consolas, monospace;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Medium.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(32px, 7vw, 48px); }
h2 { font-size: clamp(22px, 4.5vw, 32px); }
h3 { font-size: clamp(18px, 3.5vw, 24px); }

p {
  margin: 0 0 1em;
}

small, .meta {
  font-size: 14px;
  color: var(--gray-60);
}

a {
  color: inherit;
}

code, .mono {
  font-family: var(--font-mono);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0;
  top: -40px;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 100;
  transition: top 150ms;
}

.skip-link:focus {
  top: 0;
}

/* Focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  padding: 32px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.social-icons {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  transition: background-color 150ms, color 150ms;
}

.social-icons a:hover {
  background: var(--fg);
  color: var(--bg);
}

.social-icons svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero */
.hero .wrap {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 32px;
  padding-top: 8px;
  padding-bottom: 48px;
  text-align: center;
}

.hero-photo-wrap {
  width: 100%;
  max-width: 280px;
}

.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--photo-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hero-text {
  max-width: 480px;
}

.hero-subtitle {
  font-weight: 600;
  font-size: 18px;
}

.hero-desc {
  color: var(--gray-60);
}

@media (min-width: 640px) {
  .hero .wrap {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .hero-photo-wrap {
    max-width: 320px;
    flex-shrink: 0;
  }
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--gray-15);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.button:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.button-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.button-primary:hover {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--gray-15);
}

/* Secciones */
section {
  padding: 32px 0;
  border-top: 1px solid var(--gray-15);
}

.topic-group {
  margin-bottom: 40px;
}

.topic-group:last-child {
  margin-bottom: 0;
}

.link-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.link-list a {
  display: block;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 4px;
}

.link-list a:hover {
  text-decoration: underline;
}

.link-list p {
  margin: 0;
  color: var(--gray-60);
  font-size: 14px;
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.newsletter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 240px;
}

.newsletter-field label {
  font-size: 14px;
  font-weight: 600;
}

.newsletter-field input[type="email"] {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-15);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
}

.newsletter-status {
  width: 100%;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--gray-60);
}

/* Footer */
.site-footer {
  padding: 32px 0 48px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--gray-60);
}

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

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

/* En pantallas angostas, "Volver arriba" queda justo donde flota el
   jesus-widget (fixed, bottom-right): sin esto, el link queda tapado e
   inalcanzable al hacer scroll hasta el final. Se apila el contenido del
   footer a la izquierda, lejos de esa esquina, en vez de repartirlo en una
   sola fila de lado a lado. */
@media (max-width: 639px) {
  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Easter egg: jesus-widget (PARTE 5). Usa solo los 4 neutros de BRAND.md
   (--fg, --bg, --gray-60, --gray-15), cero color nuevo. */
.jesus-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.jesus-banner {
  max-width: 260px;
  padding: 14px 28px 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-15);
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  position: relative;
  opacity: 0;
  visibility: hidden;
  transform: translateX(32px);
  transition: opacity 200ms, transform 200ms, visibility 200ms;
}

.jesus-quote {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.5;
}

.jesus-source {
  margin: 0;
  font-size: 12px;
  color: var(--gray-60);
}

.jesus-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray-60);
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.jesus-close:hover {
  color: var(--fg);
}

.jesus-figure {
  flex-shrink: 0;
  width: 52px;
  height: 64px;
  padding: 6px;
  border: none;
  border-radius: var(--radius);
  /* Fijo a propósito (no var(--fg)): la túnica blanca necesita un fondo oscuro
     constante para leerse bien tanto en modo claro como oscuro. Ver nota de
     excepción a BRAND.md en index.html, junto al widget. */
  background: #1c1c1c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transform: translateX(0);
}

/* Contenedor de los 7 frames (idle + walk1..walk6): ocupan la misma celda,
   apilados, y solo el frame activo (data-frame en el wrapper) es visible. */
.jesus-sprite-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.jesus-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.jesus-sprite-wrap[data-frame="idle"] .jesus-frame[data-name="idle"],
.jesus-sprite-wrap[data-frame="walk1"] .jesus-frame[data-name="walk1"],
.jesus-sprite-wrap[data-frame="walk2"] .jesus-frame[data-name="walk2"],
.jesus-sprite-wrap[data-frame="walk3"] .jesus-frame[data-name="walk3"],
.jesus-sprite-wrap[data-frame="walk4"] .jesus-frame[data-name="walk4"],
.jesus-sprite-wrap[data-frame="walk5"] .jesus-frame[data-name="walk5"],
.jesus-sprite-wrap[data-frame="walk6"] .jesus-frame[data-name="walk6"] {
  opacity: 1;
}

/* walk1..walk6 son la pose de perfil (ver nota en index.html) replicada sin
   cambios salvo la posicion de los pies -- originalmente miran hacia la
   derecha. Al volver (is-returning, camina hacia la izquierda) se espejan
   con scaleX(-1) para que la figura mire hacia donde se mueve. */
.jesus-widget.is-returning .jesus-sprite-wrap {
  transform: scaleX(-1);
}

/* Colores fijos y representativos, muestreados pixel a pixel de las dos
   referencias de Santi (ver nota en index.html) — excepción deliberada a los
   4 neutros de BRAND.md. No usan variables de tema: no deben cambiar entre
   modo claro y oscuro. */
.jp-outline     { fill: #241309; }
.jp-halo        { fill: #F8B414; }
.jp-halo-dk     { fill: #3F2503; }
.jp-hair        { fill: #844B2D; }
.jp-hair-dark   { fill: #5A2E19; }
.jp-skin        { fill: #FCC495; }
.jp-skin-shadow { fill: #D29164; }
.jp-robe        { fill: #FDF1DB; }
.jp-sash        { fill: #DA3428; }
.jp-sash-dark   { fill: #8C1E16; }

.jesus-widget.is-open .jesus-banner {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .jesus-figure {
    transition: transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .jesus-widget.is-exiting .jesus-figure {
    transition: transform 450ms ease-in;
    transform: translateX(140px);
  }

  .jesus-widget.is-open .jesus-banner {
    transition: opacity 550ms, transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1) 100ms, visibility 550ms;
  }
}
