/* Trazo — estilos del sitio. Reglas de marca en CLAUDE.md y /contenido. */

/* DM Sans servida desde el propio sitio (sin Google Fonts). Licencia en fuentes/OFL.txt */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/dm-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fuentes/dm-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/dm-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fuentes/dm-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --lino: #EAE0D5;
  --carbon: #1C1C1B;
  --piedra: #D1C1B3;
  --arcilla: #99371D;
  --arcilla-hover: #82301A;
  --bronce: #885832;

  --gutter: 20px;
  --max: 1240px;
  --section-pad: 96px;
  --header-h: 84px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--lino);
  color: var(--carbon);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: clamp(40px, 8.4vw, 84px); }
h2 { font-size: clamp(32px, 5.6vw, 56px); }
h3 { font-size: 21px; line-height: 1.25; }

p { margin: 0; }

strong { font-weight: 500; }

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

.section { padding: var(--section-pad) 0; }

.dark { background: var(--carbon); color: var(--lino); }

/* Etiquetas y metadatos: mayúsculas, 9–11 px, +22 %, bronce */
.label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronce);
}

/* Sobre carbón el bronce no es combinación aprobada: etiquetas en lino */
.dark .label { color: var(--lino); }

.section-head { max-width: 760px; }
.section-head .label { margin-bottom: 20px; }
.section-head p { margin-top: 20px; max-width: 560px; }

/* Cuadrado arcilla: marcador pequeño */
.sq {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--arcilla);
  flex: none;
}

/* Fotos: tono cálido común a todas (manual: hacia el bronce, sin blanco y negro) */
.foto { filter: sepia(0.3) saturate(0.78) contrast(0.96); }

/* ---------- Botones de contacto ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn svg { width: 20px; height: 20px; flex: none; }

.btn-wa { background: var(--arcilla); color: var(--lino); }
.btn-wa:hover { background: var(--arcilla-hover); }

.btn-mail { border-color: currentColor; background: transparent; }
.btn-mail:hover { background: var(--carbon); color: var(--lino); border-color: var(--carbon); }
.dark .btn-mail:hover,
.hero .btn-mail:hover { background: var(--lino); color: var(--carbon); border-color: var(--lino); }

.botones { display: flex; flex-wrap: wrap; gap: 12px; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--bronce);
  outline-offset: 3px;
}

.dark a:focus-visible,
.hero a:focus-visible { outline-color: var(--lino); }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--lino);
  border-bottom: 1px solid var(--piedra);
}

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

.site-header .logo img { width: 164px; }

.nav { display: flex; align-items: center; gap: 12px; }

.nav-link {
  display: none;
  font-size: 16px;
  text-decoration: none;
}

.nav-link,
.nav .btn { white-space: nowrap; }

/* Los enlaces del menú solo caben junto al logo grande, ES | EN y WhatsApp desde 1280 px */
@media (min-width: 1280px) {
  .nav-link { display: inline; }
}

.nav-link:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.nav .btn { min-height: 44px; padding: 10px 16px; font-size: 16px; }

/* En celular el botón del encabezado queda solo con el ícono para que quepan
   el logo grande y el selector de idioma (tiene aria-label) */
.nav .btn .largo,
.nav .btn .corto { display: none; }
.nav .btn { width: 48px; padding: 10px; }

/* Selector de idioma ES | EN */
.idioma {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.idioma a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  text-decoration: none;
}

.idioma a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.idioma a:not([aria-current]):hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.idioma span { color: var(--piedra); }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  color: var(--lino);
  background: var(--carbon);
  overflow: hidden;
}

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

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 28, 27, 0.9) 0%, rgba(28, 28, 27, 0.66) 55%, rgba(28, 28, 27, 0.45) 100%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 96px;
  padding-bottom: 64px;
}

.hero h1 { max-width: 900px; }

.hero p { max-width: 600px; margin-top: 24px; font-size: 18px; }

.hero .botones { margin-top: 36px; }

/* ---------- Qué hacemos ---------- */
.tarjetas {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  gap: 40px;
}

.tarjeta .marco { overflow: hidden; }

.tarjeta img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tarjeta h3 { margin-top: 20px; }
.tarjeta p { margin-top: 8px; }

/* ---------- Qué importamos ---------- */

.galeria {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.galeria li { position: relative; overflow: hidden; background: var(--carbon); }

.galeria li:first-child { grid-column: 1 / -1; }

.galeria img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.galeria li:first-child img { aspect-ratio: 3 / 2; }

.galeria .cargador img { object-position: center 20%; }

.galeria figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 14px 12px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--lino);
  background: linear-gradient(to top, rgba(28, 28, 27, 0.85), rgba(28, 28, 27, 0));
}

.galeria figure { margin: 0; height: 100%; }

.otro-equipo {
  margin-top: 40px;
  font-size: 20px;
}

.otro-equipo a { font-weight: 500; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* ---------- Cómo trabajamos ---------- */
.pasos {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  gap: 40px;
}

.pasos li { position: relative; padding-top: 20px; }

/* La línea de cada paso es un pseudoelemento para poder "trazarla" al aparecer */
.pasos li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--carbon);
  transform-origin: left;
}

.pasos .num {
  display: block;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pasos h3 { margin-top: 20px; }
.pasos p { margin-top: 8px; }

/* ---------- Por qué Trazo ---------- */
.comparacion {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
}

.comparacion .col-titulo {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--carbon);
}

.comparacion .celda {
  padding: 18px 0;
  border-bottom: 1px solid var(--piedra);
  font-size: 17px;
  line-height: 1.35;
}

.comparacion .trazo { font-weight: 500; }

.comparacion .tradicional { opacity: 0.72; }

/* ---------- Colores por sección ----------
   Lino (por defecto) · carbón (Qué importamos) · piedra (Cómo trabajamos, Preguntas)
   · arcilla (franja del eslogan). Sobre piedra las etiquetas van en carbón: bronce
   sobre piedra no es combinación aprobada. */
.metodo,
.preguntas { background: var(--piedra); }

.metodo .label,
.preguntas .label { color: var(--carbon); }

/* Números de los pasos en arcilla: permitido sobre piedra a 24 px o más */
.metodo .pasos .num { color: var(--arcilla); }

.preguntas .faq details { border-bottom-color: rgba(28, 28, 27, 0.18); }

/* ---------- Eslogan ---------- */
.lema {
  background: var(--arcilla);
  color: var(--lino);
  padding: 104px 0;
}

.lema-frase {
  max-width: 16ch;
  font-size: clamp(38px, 7.4vw, 92px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lema .label { margin-top: 32px; color: var(--lino); }

/* ---------- Preguntas frecuentes ---------- */
.faq { margin-top: 56px; border-top: 1px solid var(--carbon); max-width: 860px; }

.faq details { border-bottom: 1px solid var(--piedra); }

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 18px 0;
  font-size: 19px;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 26px;
  line-height: 1;
  font-weight: 400;
}

.faq details[open] summary::after { content: "−"; }

.faq details p { padding: 0 0 24px; max-width: 680px; }

/* ---------- Contacto ---------- */
.contacto {
  position: relative;
  color: var(--lino);
  background: var(--carbon);
  overflow: hidden;
}

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

.contacto::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 27, 0.8);
}

.contacto .wrap { position: relative; z-index: 1; }

.contacto .label { color: var(--lino); }

.contacto .botones { margin-top: 40px; }

.contacto .datos {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 16px;
}

.contacto .datos a { text-underline-offset: 4px; }

.aviso-datos { margin-top: 16px; font-size: 16px; }

.antifraude {
  margin-top: 56px;
  max-width: 720px;
  padding: 20px 22px;
  border: 1px solid var(--lino);
  font-size: 16px;
}

.antifraude strong { display: block; margin-bottom: 6px; }

/* ---------- Pie ---------- */
.site-footer { padding: 64px 0 112px; font-size: 16px; border-top: 1px solid rgba(234, 224, 213, 0.2); }

.site-footer .logo { width: 220px; }

.footer-descripcion { max-width: 560px; margin-top: 28px; font-size: 16px; }

.footer-grid { display: grid; gap: 28px; margin-top: 40px; }

.footer-grid p + p { margin-top: 4px; }

.footer-grid a { text-underline-offset: 4px; }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(234, 224, 213, 0.2);
}

.footer-meta .label { font-size: 12px; opacity: 0.85; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-flotante {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--arcilla);
  color: var(--lino);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wa-flotante svg { width: 26px; height: 26px; }

.wa-flotante:hover { background: var(--arcilla-hover); }

.wa-flotante.oculto { opacity: 0; transform: translateY(12px); pointer-events: none; }

/* ---------- Páginas legales ---------- */
.legal { padding: 64px 0 96px; }

.legal .wrap { max-width: 780px; }

.legal h1 { font-size: clamp(34px, 6vw, 52px); margin-top: 16px; }

.legal h2 { font-size: 24px; margin-top: 48px; }

.legal p,
.legal ul { margin-top: 14px; }

.legal ul { padding-left: 20px; }

.legal li + li { margin-top: 6px; }

.legal a { text-underline-offset: 4px; }

.pendiente { background: var(--piedra); padding: 0 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wa-flotante { transition: none; }
}

/* ---------- Pantalla de entrada ----------
   Solo el logo (símbolo y nombre) en lino sobre carbón; se activa con la clase
   .con-intro (script del <head>: una vez por visita, nunca con movimiento reducido). */
.intro { display: none; }

.con-intro .intro {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: var(--carbon);
  cursor: pointer;
  animation: intro-salir 0.6s ease 2s forwards;
}

.intro img {
  width: min(560px, 84vw);
  clip-path: inset(0 100% 0 0);
  animation: trazar 1.4s cubic-bezier(0.45, 0, 0.2, 1) 0.25s forwards;
}

@keyframes intro-salir { to { opacity: 0; visibility: hidden; } }

/* ---------- Animación ----------
   Solo si el visitante no pidió reducir el movimiento. --inicio retrasa la portada
   mientras está la pantalla de entrada. */
:root { --inicio: 0s; }
.con-intro { --inicio: 2.1s; }

@media (prefers-reduced-motion: no-preference) {
  :root { --suave: cubic-bezier(0.2, 0.7, 0.2, 1); }

  /* Logo del encabezado: se traza un poco más grande y luego se acomoda.
     Con pantalla de entrada no se repite: el logo ya se dibujó en el centro. */
  .site-header .logo img {
    transform-origin: left center;
    animation: trazar-logo 2.4s cubic-bezier(0.45, 0, 0.2, 1) 0.1s both;
  }
  .con-intro .site-header .logo img { animation: none; }

  /* Portada: la foto se acerca despacio y el texto sube en secuencia */
  .hero > img { animation: acercar 2.6s var(--suave) var(--inicio) both; }
  .hero h1,
  .hero p,
  .hero .botones { animation: subir 0.9s var(--suave) both; }
  .hero h1 { animation-delay: calc(var(--inicio) + 0.3s); }
  .hero p { animation-delay: calc(var(--inicio) + 0.5s); }
  .hero .botones { animation-delay: calc(var(--inicio) + 0.7s); }

  @keyframes trazar-logo {
    0% { clip-path: inset(0 100% 0 0); transform: scale(1.18); }
    65% { clip-path: inset(0 0 0 0); transform: scale(1.18); }
    100% { clip-path: inset(0 0 0 0); transform: scale(1); }
  }

  /* Apariciones al hacer scroll (sitio.js agrega .visible) */
  .js [data-revelar] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--suave), transform 0.8s var(--suave);
    transition-delay: var(--retraso, 0s);
  }
  .js [data-revelar].visible { opacity: 1; transform: none; }

  /* Pasos: la línea se traza de izquierda a derecha */
  .js .pasos li[data-revelar]::before {
    transform: scaleX(0);
    transition: transform 1.1s var(--suave);
    transition-delay: calc(var(--retraso, 0s) + 0.15s);
  }
  .js .pasos li[data-revelar].visible::before { transform: scaleX(1); }

  /* Fotos: acercamiento leve al pasar el mouse */
  .tarjeta img,
  .galeria img { transition: transform 0.7s var(--suave); }
  .tarjeta:hover img,
  .galeria li:hover img { transform: scale(1.04); }

  .btn { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }

  /* Preguntas: la respuesta aparece suave al abrir */
  .faq details[open] p { animation: subir 0.45s var(--suave) both; }

  @keyframes trazar { to { clip-path: inset(0 0 0 0); } }
  @keyframes acercar { from { transform: scale(1.08); } to { transform: scale(1); } }
  @keyframes subir {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Tableta ---------- */
@media (min-width: 640px) {
  .tarjetas { grid-template-columns: 1fr 1fr; column-gap: 24px; row-gap: 48px; }
  .pasos { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .galeria { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; }
  .galeria li:first-child { grid-column: span 2; }
  .galeria img,
  .galeria li:first-child img { aspect-ratio: auto; }
  .galeria li:first-child img { object-position: center 70%; }
  .nav .btn { width: auto; padding: 10px 16px; }
  .nav .btn .largo { display: inline; }
  .site-header .logo img { width: 200px; }
  .lema { padding: 160px 0; }
}

/* ---------- Computador ---------- */
@media (min-width: 1024px) {
  :root { --gutter: 40px; --section-pad: 144px; --header-h: 104px; }

  .site-header .logo img { width: 240px; }
  .nav { gap: 24px; }

  .hero .wrap { padding-bottom: 104px; }
  .hero p { font-size: 20px; }

  .tarjetas { grid-template-columns: repeat(4, 1fr); }

  .galeria { grid-auto-rows: 300px; }

  .pasos { grid-template-columns: repeat(4, 1fr); }
  .pasos .num { font-size: 72px; }

  .comparacion { column-gap: 48px; max-width: 960px; }
  .comparacion .celda { font-size: 20px; padding: 22px 0; }

  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }

  .site-footer { padding-bottom: 64px; }

  .wa-flotante { right: 28px; bottom: 28px; }
}
