/* ============================================================
   TURBA — café de especialidad, Ushuaia
   Hero + preloader + responsive
   Paleta: estratigrafía de turbera fueguina
   ============================================================ */

:root {
  --musgo:   #74804A;
  --oxido:   #9A5B3C;
  --ambar:   #C68A3F;
  --turba-1: #2E2015;
  --turba-0: #14100A;
  --hueso:   #EDE6D8;

  --display: "Hanken Grotesk", system-ui, sans-serif;
  --cuerpo: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --dur-fade: 1600ms;
}

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

html { scroll-behavior: smooth; }

html, body {
  height: 100%;
  background: var(--turba-0);
  color: var(--hueso);
  font-family: var(--cuerpo);
  line-height: 1.6;
  overflow-x: hidden;              /* nunca scroll horizontal */
  -webkit-font-smoothing: antialiased;
}

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

/* ================= PRELOADER ================= */
/* Barra de carga minimal que se llena mientras cargan las fuentes.
   Al terminar, se completa y se funde. */
.cargador {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--turba-0);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.1rem;
  transition: opacity 700ms ease, visibility 700ms;
}
.cargador.listo { opacity: 0; visibility: hidden; }

.cargador-txt {
  font-family: var(--display);
  font-weight: 400;
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: none;
  color: rgba(237,230,216,.5);
}

.barra {
  width: clamp(140px, 40vw, 240px);
  height: 1px;
  background: rgba(237,230,216,.18);
  overflow: hidden;
}
.barra-relleno {
  height: 100%;
  width: 0%;
  background: var(--ambar);
  transition: width 1400ms cubic-bezier(.4,0,.2,1);
}

/* ================= HERO ================= */
.hero {
  position: relative;
  height: 100vh;                   /* fallback */
  height: 100svh;                  /* móvil: descuenta barras del navegador */
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* --- carrusel de fondo --- */
.carrusel { position: absolute; inset: 0; z-index: -2; }
.carrusel .capa {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity var(--dur-fade) ease;
  background-color: var(--turba-1);
}
.carrusel .capa.activa { opacity: 1; }

/* --- velo de legibilidad --- */
.velo {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(20,16,10,.25) 0%, rgba(20,16,10,.55) 100%),
    linear-gradient(to bottom, rgba(20,16,10,.2), rgba(20,16,10,.6));
}

/* --- grano / textura (SVG inline, cero descargas) --- */
.grano {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- marca --- */
.marca { text-align: center; padding: 0 1.5rem; z-index: 1; }

.logo {
  font-family: "Stylish", var(--display);
  font-weight: 400;
  font-size: clamp(3.6rem, 14vw, 10rem);
  letter-spacing: .03em;
  line-height: 1;
  color: var(--hueso);
}

.bajada {
  margin-top: 1.2rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: .12em;
  line-height: 1.7;
  text-transform: none;
  color: var(--hueso);
  opacity: .82;
}

/* --- crédito al pie del hero --- */
.pie {
  position: absolute;
  bottom: clamp(1rem, 3vw, 1.8rem);
  left: 0; right: 0;
  text-align: center;
  z-index: 1;
  font-size: .72rem;
  letter-spacing: .04em;
  color: rgba(237,230,216,.45);
  padding: 0 1rem;
}

/* ============================================================
   RESPONSIVE
   clamp() ya hace fluido el tamaño de texto; estas queries
   cubren los casos límite donde la geometría se rompería.
   ============================================================ */

/* ---- Pantallas muy grandes: poner techo al logo ---- */
@media (min-width: 1700px) {
  .logo { font-size: 11rem; }
}

/* ---- Tablet vertical (portrait, ~768–1024) ---- */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: portrait) {
  .logo { font-size: clamp(5rem, 12vw, 8rem); }
  .bajada { letter-spacing: .1em; }
}

/* ---- Celular vertical (portrait, ≤600) ---- */
@media (max-width: 600px) {
  .bajada { letter-spacing: .08em; font-size: .82rem; }
  .pie { font-size: .62rem; }
}

/* ---- Celular muy angosto (≤360) ---- */
@media (max-width: 360px) {
  .logo { font-size: clamp(3rem, 16vw, 4.5rem); }
  .bajada { letter-spacing: .06em; font-size: .78rem; }
}

/* ---- Cualquier pantalla apaisada y baja (celular/tablet horizontal) ----
   Acá el logo NO puede escalar por ancho o se sale por arriba y abajo:
   lo atamos a la altura (vh) para que siempre entre. ---- */
@media (orientation: landscape) and (max-height: 560px) {
  .marca { padding: 0 2rem; }
  .logo { font-size: clamp(2.2rem, 13vh, 5rem); }
  .bajada { margin-top: .5rem; font-size: clamp(.7rem, 3vh, 1rem); letter-spacing: .08em; }
  .pie { bottom: .6rem; font-size: .58rem; }
  .cargador { gap: 1rem; }
}

/* ---- Landscape muy bajo (celulares chicos apaisados) ---- */
@media (orientation: landscape) and (max-height: 380px) {
  .logo { font-size: clamp(1.8rem, 14vh, 3.2rem); }
}

/* ================= ACCESIBILIDAD ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carrusel .capa { transition: none; }
  .barra-relleno { transition: none; }
  .cargador { transition: opacity 1ms; }
}

/* ================= NAV (barra fija) ================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 400ms ease, border-color 400ms ease, backdrop-filter 400ms ease;
}
/* al scrollear (clase agregada por JS) toma fondo y desenfoque */
.nav.desplazado {
  background: rgba(20, 16, 10, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(237, 230, 216, .08);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* logo izquierda */
.nav-logo {
  font-family: "Stylish", system-ui, sans-serif;
  font-size: 1.5rem;
  color: var(--hueso);
  text-decoration: none;
  line-height: 1;
  flex: 0 0 auto;
}

/* secciones centro */
.nav-links {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  list-style: none;
  margin: 0 auto;
}
.nav-links a {
  color: var(--hueso);
  text-decoration: none;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
  transition: opacity 250ms ease;
  white-space: nowrap;
}
.nav-links a:hover { opacity: 1; }

/* idiomas derecha */
.nav-idiomas {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: .8rem;
  letter-spacing: .06em;
}
.nav-idiomas a { color: var(--hueso); opacity: .5; text-decoration: none; transition: opacity 250ms ease; }
.nav-idiomas a:hover { opacity: .85; }
.nav-idiomas a.activo { opacity: 1; border-bottom: 1px solid var(--ambar); }
.nav-idiomas span { color: var(--hueso); opacity: .3; }

/* hamburguesa (oculta en desktop) */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
  flex: 0 0 auto;
}
.nav-burger span {
  width: 24px; height: 2px;
  background: var(--hueso);
  transition: transform 300ms ease, opacity 200ms ease;
}
.nav-burger.abierto span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.abierto span:nth-child(2) { opacity: 0; }
.nav-burger.abierto span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* como el nav es fijo y opaco, damos aire arriba al contenido que no sea el hero */
body { padding-top: 0; }

/* ---- MÓVIL: hamburguesa + menú desplegable ---- */
@media (max-width: 720px) {
  .nav-burger { display: flex; }

  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100svh;
    width: min(75vw, 320px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 2rem;
    background: rgba(20, 16, 10, .96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(.2,.7,.2,1);
  }
  .nav-links.abierto { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }

  /* con el panel abierto, el nav toma fondo aunque estés arriba de todo */
  .nav.menu-abierto { background: rgba(20,16,10,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

  /* en móvil, los idiomas quedan a la derecha antes de la hamburguesa */
  .nav-idiomas { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links, .nav-burger span { transition: none; }
}

/* ================= SECCIONES DE CONTENIDO ================= */
.seccion {
  padding: clamp(4rem, 10vw, 7rem) clamp(1.2rem, 4vw, 2.5rem);
  scroll-margin-top: 70px;   /* para que el nav fijo no tape el título al saltar */
  border-top: 1px solid var(--turba-1);
}
.seccion-inner { max-width: 900px; margin: 0 auto; }

.seccion-label {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: 1rem;
}
.seccion h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 1.8rem;
  color: var(--hueso);
}
.parrafo {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: rgba(237,230,216,.8);
  max-width: 42rem;
  margin-bottom: 1.2rem;
}

/* ---- Ubicación ---- */
.ubicacion-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-top: 1rem;
}
.dato-dir {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}
.dato-ciudad { font-size: 1rem; opacity: .7; }
.dato-sub {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: .5rem;
}
.dato-horarios { line-height: 1.9; color: rgba(237,230,216,.8); margin-bottom: 1.5rem; }
.link-mapa {
  display: inline-block;
  color: var(--hueso);
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--ambar);
  padding-bottom: 2px;
  transition: opacity 250ms ease;
}
.link-mapa:hover { opacity: .7; }

/* ---- Mapa Leaflet ---- */
.mapa {
  width: 100%;
  height: 340px;
  border: 1px solid var(--turba-1);
  background: var(--turba-1);
  z-index: 0;
}
/* Dark Matter ya es oscuro; un filtro suave lo lleva hacia el cálido de Turba */
.map-tiles {
  filter: sepia(.4) hue-rotate(-12deg) saturate(1.15) brightness(.95);
}
/* controles y atribución en tono acorde */
.leaflet-container { background: var(--turba-0); }
.leaflet-control-attribution {
  background: rgba(20,16,10,.7) !important;
  color: rgba(237,230,216,.5) !important;
}
.leaflet-control-attribution a { color: var(--ambar) !important; }
.leaflet-bar a {
  background: rgba(20,16,10,.85) !important;
  color: var(--hueso) !important;
  border-color: var(--turba-1) !important;
}
.pin-turba { background: none; border: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }

/* ---- Contacto ---- */
.contacto-lista { list-style: none; margin-top: 2rem; }
.contacto-lista li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--turba-1);
}
.contacto-lista li:last-child { border-bottom: 1px solid var(--turba-1); }
.contacto-tipo {
  flex: 0 0 100px;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ambar);
}
.contacto-lista a {
  color: var(--hueso);
  text-decoration: none;
  font-size: 1.1rem;
  transition: opacity 250ms ease;
}
.contacto-lista a:hover { opacity: .7; }

/* ---- Pie final ---- */
.pie-final {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: .72rem;
  color: rgba(237,230,216,.4);
  border-top: 1px solid var(--turba-1);
}
.credito-diseno {
  margin-top: .6rem;
  font-size: .64rem;
  letter-spacing: .04em;
  color: rgba(237,230,216,.22);
}
.credito-diseno a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 300ms ease, border-color 300ms ease;
}
.credito-diseno a:hover {
  color: var(--ambar);
  border-bottom-color: var(--ambar);
}

/* ---- Responsive de secciones ---- */
@media (max-width: 720px) {
  .ubicacion-grid { grid-template-columns: 1fr; }
  .mapa { height: 280px; }
  .contacto-lista li { flex-direction: column; gap: .3rem; }
  .contacto-tipo { flex: none; }
}

/* ============================================================
   PÁGINA HISTORIA
   Línea a la izquierda, hitos a la derecha. Mobile-first.
   Etapa 1: línea estática. La animación llega en etapa 2.
   ============================================================ */
.pagina-historia { background: var(--turba-0); }

.historia {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 5vw, 2rem);
}

/* ---- ORIGEN (poético) ---- */
.hist-cabana {
  color: var(--ambar);
  width: clamp(120px, 22vw, 190px);
  margin-bottom: 2rem;
  opacity: .9;
}
.hist-cabana svg {
  width: 100%;
  height: auto;
  display: block;
}
.hist-origen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0 4rem;
}
.hist-kicker {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: 1rem;
}
.hist-titulo {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.05;
  margin-bottom: 2.5rem;
}
.hist-origen-texto p {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.7;
  color: rgba(237,230,216,.9);
  margin-bottom: 1.5rem;
  max-width: 40rem;
}
.hist-scroll-hint {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--ambar), transparent);
  margin-top: 3rem;
}

/* ---- TIMELINE (línea + hitos) ---- */
.hist-timeline {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;   /* línea recta | contenido */
  gap: clamp(1.5rem, 5vw, 2.5rem);
}

/* la línea ocupa la primera columna, a lo alto de todo el timeline */
.hist-linea {
  position: relative;
  grid-column: 1;
  color: var(--ambar);
  width: 24px;
}
.hist-linea svg {
  position: absolute;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
}
.hist-path {
  opacity: .5;
}

/* hitos en la segunda columna */
.hist-hitos {
  grid-column: 2;
  display: flex;
  flex-direction: column;
}

.hito {
  padding: 3.5rem 0;
  position: relative;
}
/* punto que marca el hito (centrado sobre la línea recta) */
.hito::before {
  content: "";
  position: absolute;
  left: calc(-1 * (clamp(1.5rem, 5vw, 2.5rem) + 12px) - 3.5px);
  top: calc(3.5rem + .4rem);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ambar);
  box-shadow: 0 0 0 4px var(--turba-0);
}
.hito-fecha {
  display: block;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: .8rem;
}
.hito-texto {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.7;
  color: rgba(237,230,216,.82);
  max-width: 34rem;
}

/* la ESPERA: espaciado enorme para que se sienta físicamente larga */
.hito-espera { padding: 14rem 0; }
.hito-espera .hito-texto { color: rgba(237,230,216,.6); font-style: italic; }

/* la ACELERACIÓN: hitos juntos, ritmo rápido */
.hito-acelera { padding: 1.5rem 0; }

/* ---- CIERRE (poético) ---- */
.hist-cierre {
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 0 5rem;
  border-top: 1px solid var(--turba-1);
  margin-top: 4rem;
}
.hist-cierre-fecha {
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: 2rem;
}
.hist-cierre-texto p {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  line-height: 1.7;
  color: rgba(237,230,216,.9);
  margin-bottom: 1.5rem;
  max-width: 42rem;
}
.hist-cierre-final { color: var(--hueso) !important; }
.hist-volver {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--ambar);
  text-decoration: none;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: .9rem;
  letter-spacing: .05em;
  border-bottom: 1px solid transparent;
  transition: border-color 250ms ease;
}
.hist-volver:hover { border-bottom-color: var(--ambar); }

/* ---- botón en la home (sección Nosotros) ---- */
.nosotros-cta {
  display: inline-block;
  margin-top: 2rem;
  padding: .8rem 1.6rem;
  border: 1px solid var(--ambar);
  border-radius: 2px;
  color: var(--hueso);
  text-decoration: none;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: .85rem;
  letter-spacing: .08em;
  transition: background 300ms ease, color 300ms ease;
}
.nosotros-cta:hover { background: var(--ambar); color: var(--turba-0); }

/* ---- móvil ---- */
@media (max-width: 600px) {
  .hist-timeline { grid-template-columns: 16px 1fr; gap: 1.2rem; }
  .hist-linea { width: 16px; }
  .hito::before { left: calc(-1 * (1.2rem + 8px) - 3.5px); }
  .hito-espera { padding: 9rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hist-scroll-hint { display: none; }
}
