/* =========================================================
   JOZHS — estilos globales
   Colores muestreados de reference/*.png y assets/*.png
   ========================================================= */

@font-face {
  font-family: "Onest";
  src: url("/assets/fonts/onest-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Aktura (Fontshare, ITF Free Font License): auto-alojada sin modificar.
   "block" evita que el logo aparezca un instante en otra letra. */
@font-face {
  font-family: "Aktura";
  src: url("/assets/fonts/aktura/Aktura-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light;

  /* Paleta (muestreo exacto) */
  --cream: #f9f2c8;        /* fondo pergamino  rgb(249,242,200) */
  --ink: #000000;          /* tinta            rgb(0,0,0)       */
  --green: #2f724a;        /* botón y trazo    rgb(47,114,74)   */
  --green-dark: #245a3a;   /* hover / texto de éxito            */
  --red: #c5211b;          /* la "z"           rgb(197,33,27)   */
  --yellow: #eadb22;       /* trazo del logo   rgb(234,219,34)  */
  --error: #9e1f2d;        /* rojo oscurecido para texto (AA)   */
  --white: #ffffff;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad-x: clamp(16px, 6vw, 86px);
  --pad-x-end: clamp(16px, 9.5vw, 137px);
  --tap: 44px;

  /* Textura de papel: ruido SVG muy sutil (no hay textura de papel en los assets) */
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .36 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--cream);
  background-image: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px, como en las capturas */
  line-height: 1.45;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

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

a {
  color: inherit;
}

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

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* ---------- Barra superior ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: max(clamp(12px, 3.5vw, 46px), env(safe-area-inset-top));
  padding-left: max(var(--pad-x), env(safe-area-inset-left));
  padding-right: max(var(--pad-x-end), env(safe-area-inset-right));
}

.topbar__nav,
.topbar__social {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topbar__nav {
  gap: clamp(8px, 2.8vw, 40px);
  margin-left: -8px; /* compensa el padding del área táctil */
}

.topbar__nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 8px;
  font-size: 1.0625rem;
  text-decoration: none;
  text-underline-offset: 4px;
}
.topbar__nav a:hover,
.topbar__nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

.topbar__social {
  gap: 4px;
  margin-right: -10px;
}

.topbar__social a {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
}
.topbar__social svg {
  width: 24px;
  height: 24px;
}
.topbar__social a:hover svg {
  color: var(--green);
}

/* ---------- Oso ---------- */

.bear {
  pointer-events: none;
  user-select: none;
  width: clamp(44px, 9vw, 74px);
  height: auto;
  transform: scaleX(-1); /* espejo horizontal: el oso mira hacia la derecha, hacia el contenido */
}

/* ---------- Home ---------- */

.home {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 6vh, 64px) max(16px, env(safe-area-inset-right)) clamp(24px, 4vh, 48px) max(16px, env(safe-area-inset-left));
  text-align: center;
}

.logo {
  margin: 0;
  font-family: "Aktura", "UnifrakturMaguntia", "Old English Text MT", serif;
  font-weight: 400;
  font-size: clamp(104px, 30vw, 153px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.logo__word {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding-bottom: 0.1em; /* espacio para el trazo */
}

.logo__z {
  color: var(--red);
}

/* Trazo negro ondulado, detrás de las letras (el PNG se usa como máscara) */
.logo__word::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.19em;
  right: -0.19em;
  top: 0.77em;
  aspect-ratio: 312 / 29;
  background-color: var(--ink);
  -webkit-mask: url("/assets/img/linea-amarilla.png") no-repeat center / 100% 100%;
  mask: url("/assets/img/linea-amarilla.png") no-repeat center / 100% 100%;
  pointer-events: none;
}

.subscribe {
  width: 100%;
  max-width: 540px;
  margin-top: clamp(20px, 3vw, 28px);
}

.subscribe__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field {
  flex: 1 1 auto;
  min-width: 0;
  border-style: solid;
  border-width: 8px 9px;
  border-image: url("/assets/img/input-frame.webp") 15 17 fill / 8px 9px stretch;
}

.field {
  position: relative;
  height: 50px; /* 34px de contenido + marco; el input cubre todo el marco */
}

.field input {
  position: absolute;
  top: -8px;
  left: -9px;
  display: block;
  width: calc(100% + 18px);
  height: 50px;
  margin: 0;
  padding: 0 19px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: max(16px, 1.0625rem); /* >=16px evita el zoom en iOS */
  line-height: 50px;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder {
  color: #1d1a12;
  opacity: 1;
}
.field input:focus {
  outline: none;
}
.field:focus-within {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.field input[aria-invalid="true"] {
  text-decoration: underline wavy var(--error) 1px;
  text-underline-offset: 5px;
}

.arrow-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.arrow-btn__circle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.arrow-btn svg {
  width: 18px;
  height: 18px;
}
.arrow-btn:hover .arrow-btn__circle {
  background: var(--green-dark);
}
.arrow-btn:active .arrow-btn__circle {
  transform: scale(0.94);
}

.status {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.status:empty {
  display: none;
}
.status--error {
  color: var(--error);
}
.status--success {
  color: var(--green-dark);
  font-weight: 600;
}
.subscribe .status {
  margin-top: 10px;
}

.tagline {
  margin: 14px 0 0;
  font-size: 1.0625rem;
}

.noscript {
  margin: 8px 0 0;
  font-size: 0.9375rem;
}

/* Honeypot: fuera de pantalla, sin foco */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.home__bear {
  padding: 0 max(var(--pad-x), env(safe-area-inset-left)) max(clamp(16px, 4vh, 52px), env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
  /* Centra el input (como en la captura) y deja la flecha colgando a la derecha */
  .subscribe {
    max-width: 590px;
  }
  .subscribe__row {
    padding-left: 50px;
  }
  .arrow-btn__circle {
    width: 34px;
    height: 34px;
  }
  .arrow-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 900px) {
  /* Con espacio de sobra, el oso se ancla en la esquina sin ocupar fila */
  .home {
    grid-template-rows: auto 1fr;
    position: relative;
  }
  .hero {
    padding-bottom: 110px; /* compensa la barra superior para centrar ópticamente */
  }
  .home__bear {
    position: absolute;
    left: 0;
    bottom: 0;
  }
}

/* ---------- Modal de consentimiento ---------- */

.modal {
  width: min(100% - 32px, 480px);
  max-width: none;
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(26, 20, 4, 0.5);
}

.modal__panel {
  max-height: inherit;
  overflow-y: auto;
  padding: 28px 28px 24px;
  background-color: var(--cream);
  background-image: var(--paper);
  border-style: solid;
  border-width: 8px 9px;
  border-image: url("/assets/img/input-frame.webp") 15 17 / 8px 9px stretch;
}

.modal__title {
  margin: 0 0 12px;
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
}

.modal__text {
  margin: 0 0 12px;
}

.modal__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal .status {
  margin-top: 4px;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.06);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.modal[open] {
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 639.98px) {
  /* Hoja inferior a ancho completo */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92svh;
    margin: auto 0 0;
  }
  .modal__panel {
    border-image: none;
    border-width: 3px 0 0;
    border-color: var(--ink);
    border-radius: 18px 18px 0 0;
    padding: 24px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .modal[open] {
    animation: sheet-in 0.24s ease-out;
  }
  .modal__actions {
    flex-direction: column-reverse;
  }
  .modal__actions .btn {
    width: 100%;
  }
}
@keyframes sheet-in {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
  .arrow-btn__circle { transition: none; }
}

/* ---------- Página de privacidad ---------- */

.legal {
  position: relative;
  max-width: 65ch;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) max(16px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.legal__title {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-top: clamp(26px, 4vw, 34px);
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2rem);
  line-height: 1.2;
  font-weight: 400;
}
.legal__title::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10px;
  width: calc(100% + 24px);
  max-width: 495px;
  aspect-ratio: 495 / 48;
  background-color: var(--red);
  -webkit-mask: url("/assets/img/linea-verde.png") no-repeat left top / 100% 100%;
  mask: url("/assets/img/linea-verde.png") no-repeat left top / 100% 100%;
  max-height: 24px;
}

.legal__date {
  margin: 14px 0 0;
  font-size: 0.8125rem;
}

.legal h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4rem);
  line-height: 1.25;
  font-weight: 700;
}

.legal h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.legal p,
.legal ul {
  margin: 0 0 1rem;
}

.legal ul {
  padding-left: 1.25rem;
}
.legal li {
  margin-bottom: 0.25rem;
}
.legal li::marker {
  font-size: 0.8em;
}

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

.legal__bear {
  margin: 1.5rem 0;
}
.legal__bear .bear {
  width: 56px;
}

@media (min-width: 1100px) {
  /* Oso en el margen izquierdo, a media página, fuera de la columna de texto */
  .legal__bear {
    position: absolute;
    left: -130px;
    margin: -60px 0 0;
  }
  .legal__bear .bear {
    width: 74px;
  }
}
