/* ===== Fuentes autoalojadas (subconjunto latino, variables) ===== */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('assets/fonts/fraunces-normal-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/fraunces-italic-300.woff2') format('woff2');
}

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

/* ===== Orígenes Coffee — sistema editorial minimalista =====
   Referencia: La Cabra (aire, tipografía serena, hairlines)
   + largo aliento tipo revista NatGeo en las páginas de país. */

:root {
  --paper: #faf7f1;
  --ink: #211a13;
  --ink-soft: #6e6154;
  --hair: #e4dbc9;
  --paper-dim: #f2ecdf;
  --tema: #7a5c40; /* acento por defecto; cada país lo redefine */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
}

/* acentos por país — apagados, tipo mapa antiguo */
.tema-guatemala { --tema: #50603f; }
.tema-mexico { --tema: #a4502a; }
.tema-colombia { --tema: #b08a2e; }
.tema-venezuela { --tema: #3f5873; }
.tema-brasil { --tema: #2f6146; }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
}

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

[id] {
  scroll-margin-top: 5rem; /* anclas no quedan bajo la barra fija */
}

a,
button {
  touch-action: manipulation; /* sin zoom por doble tap en móvil */
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.article p {
  text-wrap: pretty;
}

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

body {
  font-optical-sizing: auto;
}

/* accesibilidad: foco visible al navegar con teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--tema);
  outline-offset: 3px;
}

/* accesibilidad: saltar al contenido (visible solo con foco) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 300;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.narrow {
  width: min(680px, 92%);
  margin: 0 auto;
}

/* ===== Etiquetas pequeñas en versalitas ===== */
.label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--tema);
}

.label-ink {
  color: var(--ink-soft);
}

/* ===== Barra superior ===== */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
}

.topbar.scrolled {
  background: rgba(250, 247, 241, 0.93);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--hair);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark em {
  font-style: italic;
  font-weight: 300;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.topnav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.topnav a:hover,
.topnav a.active {
  border-color: var(--ink);
}

/* sobre imagen: enlaces claros hasta hacer scroll */
.topbar.over-image:not(.scrolled) .wordmark,
.topbar.over-image:not(.scrolled) .topnav a {
  color: #f7f1e6;
}

.topbar.over-image:not(.scrolled) .topnav a:hover {
  border-color: #f7f1e6;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin: -10px;
}

.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: background 0.3s;
}

.topbar.over-image:not(.scrolled) .nav-toggle span {
  background: #f7f1e6;
}

/* ===== Portada (home) ===== */
.masthead {
  padding: 11rem 0 5rem;
}

.masthead .label {
  display: block;
  margin-bottom: 2rem;
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 7.2vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.masthead h1 em {
  font-style: italic;
}

.masthead-deck {
  margin-top: 2.4rem;
  max-width: 44ch;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.masthead-photo {
  margin-top: 5rem;
}

.masthead-photo img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.masthead-photo figcaption,
.figcap {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 0.8rem;
}

/* ===== Secciones ===== */
.block {
  padding: 7rem 0;
}

.block-hair {
  border-top: 1px solid var(--hair);
}

.block-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  margin: 1rem 0 3.5rem;
}

/* ===== Atlas: índice de países ===== */
.atlas-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 3.2rem 0;
  border-top: 1px solid var(--hair);
  text-decoration: none;
  color: var(--ink);
}

.atlas-row:last-child {
  border-bottom: 1px solid var(--hair);
}

.atlas-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.8rem;
}

.atlas-row h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.05;
  transition: color 0.25s;
}

.atlas-row:hover h3 {
  color: var(--tema);
}

.atlas-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin-top: 0.4rem;
}

.atlas-excerpt {
  margin-top: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 40ch;
}

.atlas-go {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.atlas-media {
  overflow: hidden;
}

.atlas-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.atlas-row:hover .atlas-media img {
  transform: scale(1.03);
}

.atlas-row:nth-child(even) .atlas-media {
  order: -1;
}

/* ===== Manifiesto ===== */
.manifesto {
  text-align: center;
}

.manifesto p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.45;
  max-width: 30ch;
  margin: 0 auto;
}

.manifesto p + p {
  margin-top: 2rem;
}

.manifesto em {
  font-style: italic;
  color: var(--tema);
}

/* ===== Titular escalonado por líneas ===== */
.stagger .line {
  display: block;
  overflow: hidden;
}

.stagger .line > span {
  display: block;
  transform: translateY(110%);
  animation: line-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stagger .line:nth-child(2) > span { animation-delay: 0.12s; }
.stagger .line:nth-child(3) > span { animation-delay: 0.24s; }

@keyframes line-up {
  to { transform: translateY(0); }
}

/* ===== Barra de progreso de lectura ===== */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--tema);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

/* ===== Página de país: apertura ===== */
.feature-hero {
  height: 86vh;
  height: 86svh;
  min-height: 460px;
  position: relative;
  overflow: hidden;
}

.feature-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}

.feature-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 15, 10, 0.3) 0%, rgba(20, 15, 10, 0) 40%, rgba(20, 15, 10, 0.66) 100%);
}

.feature-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.2rem;
  margin: 0 auto;
}

.label-onimage {
  color: #f0e6d6;
  display: block;
  margin-bottom: 1rem;
}

.feature-title h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 11vw, 8rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: #faf5ea;
  text-shadow: 0 2px 24px rgba(15, 10, 6, 0.45);
}

.label-onimage {
  text-shadow: 0 1px 12px rgba(15, 10, 6, 0.6);
}

.feature-head {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--hair);
}

.feature-deck {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 36ch;
}

/* ===== Artículo ===== */
.article {
  padding: 5rem 0;
}

.article p {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.14rem;
  line-height: 1.85;
  margin-bottom: 1.7rem;
}

.article > .narrow > p:first-of-type::first-letter {
  font-size: 4.4em;
  font-weight: 300;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--tema);
}

.crosshead {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--tema);
  margin: 3.6rem 0 1.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.crosshead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.pullquote {
  margin: 4.5rem auto;
  padding: 3rem 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  text-align: center;
}

.pullquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.4;
  max-width: 26ch;
  margin: 0 auto;
}

.pullquote footer {
  margin-top: 1.2rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* fotos intercaladas — se revelan con un zoom-out suave */
.interlude {
  width: min(1160px, 100%);
  margin: 4.5rem auto;
  overflow: hidden;
}

.interlude img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.interlude.visible img {
  transform: scale(1);
}

.interlude.tall img {
  aspect-ratio: 4 / 5;
  max-width: 680px;
  margin: 0 auto;
}

.interlude figcaption {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 0.8rem;
  padding: 0 4%;
}

/* datos rápidos */
.facts {
  margin: 4.5rem 0;
  border-top: 1px solid var(--hair);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.facts div {
  border-bottom: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
  padding: 1.4rem 1.2rem 1.6rem;
}

.facts div:last-child {
  border-right: none;
}

.facts dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.facts dd {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.5;
}

/* ===== Siguiente país ===== */
.country-next {
  border-top: 1px solid var(--hair);
  padding: 4.5rem 0;
}

.country-next-grid {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.country-next a {
  text-decoration: none;
  color: var(--ink);
}

.country-next .label-ink {
  display: block;
  margin-bottom: 0.7rem;
}

.country-next h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  transition: color 0.25s;
}

.country-next a:hover h3 {
  color: var(--tema);
}

.country-next .next {
  text-align: right;
}

/* ===== Película (video real) ===== */
.film {
  padding: 5.5rem 0;
}

.film-figure {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.film-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--paper-dim);
}

.film-figure figcaption {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 0.8rem;
}

/* ===== Lista / leads ===== */
.lead-block {
  border-top: 1px solid var(--hair);
  padding: 7rem 0;
  text-align: center;
}

.lead-block h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 1rem auto 1.4rem;
  max-width: 18ch;
}

.lead-block > .container > p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 3rem;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

.lead-form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  width: 100%;
}

.lead-form input {
  flex: 1 1 16rem;
  min-width: 0;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 0.7rem 0.2rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  border-radius: 0;
}

.lead-form .form-honeypot {
  display: none;
}

.lead-form input::placeholder {
  color: var(--ink-soft);
}

.lead-form input:focus {
  outline: none;
  border-bottom-color: var(--tema);
}

.lead-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.lead-check input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
  padding: 0;
  border: 1px solid var(--hair);
  accent-color: var(--tema);
}

.lead-check span {
  flex: 1;
}

.lead-form button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.lead-form button:hover {
  background: var(--ink);
  color: var(--paper);
}

.lead-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lead-note {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
}

.lead-error {
  margin: 0;
  color: #8d3428;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-align: center;
}

.lead-success {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--tema);
  padding: 0.6rem 0;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== CTA fijo (solo móvil) ===== */
.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translate(-50%, 140%);
  z-index: 150;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(33, 26, 19, 0.28);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: none;
}

.sticky-cta.show {
  transform: translate(-50%, 0);
}

/* ===== Pie ===== */
.footer {
  border-top: 1px solid var(--hair);
  padding: 2.4rem 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

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

/* ===== Aparición al scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .atlas-media img,
  .atlas-row:hover .atlas-media img,
  .interlude img,
  .interlude.visible img {
    transition: none;
    transform: none;
  }

  .stagger .line > span {
    transform: none;
    animation: none;
  }

  .feature-hero img {
    height: 100%;
    transform: none !important;
  }

  .sticky-cta {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 780px) {
  .nav-toggle {
    display: flex;
  }

  .topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hair);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .topnav.open {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    box-shadow: 0 18px 30px rgba(33, 26, 19, 0.12);
  }

  .topnav li {
    width: 100%;
  }

  .topnav a {
    display: block;
    padding: 1rem 1.4rem;
    border-bottom: none;
    color: var(--ink) !important;
  }

  .masthead {
    padding: 8rem 0 3.5rem;
  }

  .masthead h1 {
    font-size: clamp(2.6rem, 14vw, 4.2rem);
    line-height: 1.08;
    max-width: 10ch;
  }

  .stagger .line {
    overflow: visible;
  }

  .stagger .line > span {
    animation: none;
    transform: none;
  }

  .masthead-photo {
    margin-top: 3rem;
  }

  .masthead-photo img {
    aspect-ratio: 4 / 3;
  }

  .block {
    padding: 4.5rem 0;
  }

  .atlas-row {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: 2.6rem 0;
    opacity: 1;
    transform: none;
  }

  .atlas-row:nth-child(even) .atlas-media {
    order: 0;
  }

  .feature-hero {
    height: 72vh;
    height: 72svh;
    min-height: 380px;
  }

  .feature-title {
    bottom: 2.2rem;
  }

  .feature-head {
    padding: 2.6rem 0 2.2rem;
  }

  .sticky-cta {
    display: block;
  }

  .article {
    padding: 3.5rem 0;
  }

  .interlude {
    margin: 3rem auto;
  }

  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .facts div:nth-child(2n) {
    border-right: none;
  }

  .country-next-grid {
    flex-direction: column;
    gap: 2.4rem;
  }

  .country-next .next {
    text-align: left;
  }

  .lead-block {
    padding: 4.5rem 0;
  }

  .lead-form {
    gap: 1.4rem;
  }

  .lead-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lead-form-row input {
    flex: 0 0 auto;
    width: 100%;
  }

  .lead-form button {
    padding: 1rem 1.6rem;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }
}
