/* ==========================================================================
   Sosiego · retiro alpino
   Secciones: variables · base · header · hero pinned (lago → cuarto) ·
   barra fija · sección crema · onsen · nota/formulario · pie · responsive
   ========================================================================== */

:root {
  /* Paleta relevada del video */
  --agua: #b9c2b8;
  --cielo: #dfe3dc;
  --montana: #5a6a5e;
  --pino: #22301f;
  --bosque: #1f3a2a; /* texto */
  --crema: #efece3;
  --crema-2: #ece9df;
  --verde-hondo: #2f4a3a; /* pie y botón */
  --tinta-suave: rgba(31, 58, 42, 0.62);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --fs-display: clamp(44px, 6.6vw, 96px);
  --fs-display-sm: clamp(34px, 4.4vw, 64px);
  --fs-bajada: clamp(13px, 1.05vw, 15px);
  --fs-label: 9px;
  --fs-nav: 11px;

  --gutter: 6vw;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --p: 0; /* progreso del hero pinned, 0 → 1 (lo escribe app.js) */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--crema);
  color: var(--bosque);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p,
dl,
dd {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
canvas {
  display: block;
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--bosque);
  outline-offset: 4px;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--crema);
  padding: 12px 18px;
  z-index: 100;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.display em {
  font-style: italic;
}
.display-sm {
  font-size: var(--fs-display-sm);
}
.overline {
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}
.bajada {
  font-size: var(--fs-bajada);
  line-height: 1.55;
  color: var(--tinta-suave);
}
.parrafo {
  font-size: var(--fs-bajada);
  line-height: 1.7;
  color: var(--tinta-suave);
  max-width: 46ch;
}

/* ---------------------------- Header ---------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 3.6vh var(--gutter);
  font-size: var(--fs-nav);
  color: var(--bosque);
  transition: transform 0.45s var(--ease-out), opacity 0.35s;
}
.nav.oculto {
  transform: translateY(-110%);
  opacity: 0;
}
.nav-izq {
  display: flex;
  gap: 26px;
}
.nav-izq a {
  border-bottom: 1px solid transparent;
}
.nav-izq a:hover {
  border-color: currentColor;
}
.marca {
  text-align: center;
  display: grid;
  gap: 5px;
  justify-items: center;
}
.marca-over {
  font-size: var(--fs-label);
  letter-spacing: 0.26em;
  color: var(--tinta-suave);
}
.marca-nombre {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}
.pill {
  justify-self: end;
  border: 1px solid rgba(31, 58, 42, 0.45);
  border-radius: 40px;
  padding: 9px 18px;
  transition: background 0.3s, color 0.3s;
}
.pill:hover {
  background: var(--bosque);
  color: var(--crema);
}

/* ---------------------------- Hero pinned ---------------------------- */
.hero-wrap {
  height: 420vh; /* 100 de pin + 320 de recorrido: lago · viaje al cuarto · ciclo del día */
  position: relative;
}
.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--cielo);
}
.escena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Capa cuarto: entra por opacidad (p 0,40 → 0,70) */
.cuarto {
  position: absolute;
  inset: 0;
  opacity: clamp(0, calc((var(--p) - 0.3) / 0.2), 1);
  background: linear-gradient(180deg, #efeae1 0%, #e6e0d5 62%, #d9d2c5 100%);
}
.cuarto-foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Pared con la sombra suave de un ambiente real */
.cuarto-pared {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(255, 255, 255, 0.75), transparent 60%),
    linear-gradient(90deg, rgba(120, 108, 92, 0.22), transparent 42%);
}
/* Capa 3D del cuarto: cuando se monta, la versión CSS se apaga */
.cuarto-3d {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.cuarto-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}
body.con-3d .cuarto-copy .display {
  font-size: clamp(30px, 3.2vw, 46px);
}
body.con-3d .cuarto-pared,
body.con-3d .cuarto-piso,
body.con-3d .cuarto-ventana,
body.con-3d .cuarto-cama,
body.con-3d .cuarto-manta {
  display: none;
}

/* Ventanal a la izquierda: muestra el mismo lago (el texto va a la derecha) */
.cuarto-ventana {
  position: absolute;
  top: 10%;
  left: 7%;
  width: 42%;
  height: 66%;
  overflow: hidden;
  box-shadow: 0 44px 90px rgba(60, 52, 40, 0.3);
}
.escena-ventana {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cuarto-marco {
  position: absolute;
  inset: 0;
  border: 12px solid #f6f3ec;
  box-shadow: inset 0 0 0 1px rgba(60, 52, 40, 0.16), inset 0 0 60px rgba(60, 52, 40, 0.12);
}
.cuarto-marco::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 9px;
  transform: translateX(-50%);
  background: #f6f3ec;
}
/* Zócalo y piso de madera clara */
.cuarto-piso {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  background: linear-gradient(180deg, #d9cfbd, #c9bda6);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
/* Cama de lino en primer plano, abajo a la izquierda */
.cuarto-cama {
  position: absolute;
  left: -3%;
  bottom: -2%;
  width: 56%;
  height: 34%;
}
.cuarto-cama::before {
  /* colchón */
  content: "";
  position: absolute;
  inset: 26% 0 0 0;
  border-radius: 10px 14px 0 0;
  background: linear-gradient(180deg, #fdfbf7 0%, #f3eee4 46%, #e6dfd1 100%);
  box-shadow: 0 -18px 50px rgba(60, 52, 40, 0.14);
}
.cuarto-cama::after {
  /* almohadas, apoyadas sobre el colchón */
  content: "";
  position: absolute;
  left: 7%;
  top: 15%;
  width: 34%;
  height: 22%;
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff, #efe9dd);
  box-shadow: 0 12px 24px rgba(60, 52, 40, 0.18);
}
/* Manta doblada a los pies */
.cuarto-manta {
  position: absolute;
  left: 8%;
  bottom: 9%;
  width: 44%;
  height: 8%;
  background: linear-gradient(180deg, #d3dacf, #bcc5bb);
  box-shadow: 0 -6px 18px rgba(60, 52, 40, 0.1);
}

/* Copys del hero */
.hero-copy {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: min(64ch, 84vw);
  text-align: center;
  z-index: 3;
  pointer-events: none;
  opacity: clamp(0, calc(1 - (var(--p) - 0.06) / 0.2), 1);
}
.hero-copy .bajada {
  margin-top: 26px;
}
.cuarto-copy {
  position: absolute;
  right: var(--gutter);
  top: 16%;
  width: min(30ch, 30vw);
  z-index: 3;
  pointer-events: none;
  opacity: clamp(0, calc((var(--p) - 0.56) / 0.1), 1);
  transform: translateY(calc((1 - clamp(0, (var(--p) - 0.56) / 0.1, 1)) * 14px));
  transition: color 0.7s ease;
}
.cuarto-copy .display,
.cuarto-copy .bajada,
.cuarto-copy .overline {
  transition: color 0.7s ease;
}
body.noche .cuarto-copy,
body.noche .cuarto-copy .display,
body.noche .cuarto-copy .bajada,
body.noche .cuarto-copy .overline {
  color: var(--crema);
}

/* Controles de luz (esquina inferior izquierda del hero) */
.luces {
  position: absolute;
  left: var(--gutter);
  bottom: 12vh;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.luces.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.luces-hint {
  margin: 0 6px 0 0;
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  transition: color 0.7s ease, opacity 0.4s ease;
}
.luces.usado .luces-hint {
  opacity: 0;
}
.luz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  border: 1px solid rgba(31, 58, 42, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--tinta);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, color 0.7s ease, border-color 0.7s ease;
}
.luz i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.luz[aria-pressed="true"] i {
  background: #ffcf80;
  border-color: #ffcf80;
  box-shadow: 0 0 10px 2px rgba(255, 200, 120, 0.65);
}
.luz kbd {
  font: inherit;
  font-size: 11px;
  opacity: 0.55;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 5px;
}
.luz:hover {
  background: rgba(255, 255, 255, 0.6);
}
body.noche .luces-hint,
body.noche .luz {
  color: var(--crema);
}
body.noche .nav,
body.noche .barra {
  color: var(--crema);
}
body.noche .barra {
  border-top-color: rgba(239, 236, 227, 0.4);
}
body.noche .marca-over,
body.noche .barra span {
  color: rgba(239, 236, 227, 0.78);
}
body.noche .pill {
  border-color: rgba(239, 236, 227, 0.5);
}
body.noche .luz {
  border-color: rgba(239, 236, 227, 0.45);
  background: rgba(20, 24, 32, 0.45);
}
body.noche .luz:hover {
  background: rgba(20, 24, 32, 0.7);
}
.cuarto-copy .display {
  margin: 18px 0 20px;
}

/* ---------------------------- Barra fija ---------------------------- */
.barra {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 4vh;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 58, 42, 0.35);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--tinta-suave);
}

/* Sobre el bosque oscuro, header y barra pasan a crema */
body.sobre-oscuro .nav,
body.sobre-oscuro .barra {
  color: var(--crema);
}
body.sobre-oscuro .barra {
  border-top-color: rgba(239, 236, 227, 0.4);
}
body.sobre-oscuro .marca-over,
body.sobre-oscuro .barra span {
  color: rgba(239, 236, 227, 0.78);
}
body.sobre-oscuro .pill {
  border-color: rgba(239, 236, 227, 0.5);
}
body.sobre-oscuro .pill:hover {
  background: var(--crema);
  color: var(--bosque);
}

/* ---------------------------- Sección crema ---------------------------- */
.arte {
  position: relative;
  z-index: 2;
  background: var(--crema-2);
  padding: 16vh var(--gutter) 18vh;
}
.asterisco {
  font-family: var(--serif);
  font-size: 34px;
  margin-bottom: 26px;
}
.arte .parrafo {
  margin-top: 30px;
}
.datos {
  margin-top: 9vh;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid rgba(31, 58, 42, 0.18);
  padding-top: 26px;
}
.datos dt {
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-bottom: 8px;
}
.datos dd {
  font-family: var(--serif);
  font-size: 22px;
}

/* ---------------------------- Onsen ---------------------------- */
.agenda {
  position: relative;
  z-index: 2;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  color: var(--crema);
}
.agenda-copy {
  position: absolute;
  left: var(--gutter);
  top: 10%;
  width: min(36ch, 44vw);
}
.agenda-copy .bajada {
  margin-top: 24px;
  color: rgba(239, 236, 227, 0.78);
}
/* Marco de ventana a la derecha, como en la referencia */
.agenda-marco {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 26%;
  border-left: 14px solid rgba(239, 236, 227, 0.9);
  box-shadow: inset 22px 0 60px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* ---------------------------- Nota / formulario ---------------------------- */
.nota {
  position: relative;
  z-index: 2;
  background: var(--crema);
  padding: 15vh var(--gutter) 20vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8vw;
}
.nota-izq .display {
  margin: 20px 0 26px;
}
.nota-chica {
  margin-top: 20px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--tinta-suave);
  max-width: 40ch;
}
.nota-marca {
  font-family: var(--serif);
  font-size: 40px;
  margin-top: 8vh;
}
.nota-der {
  display: grid;
  align-content: start;
  gap: 26px;
}
.campo {
  display: grid;
  gap: 8px;
}
.campo > span {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--tinta-suave);
}
.campo input,
.campo textarea {
  font: inherit;
  font-size: 14px;
  color: var(--bosque);
  border: 0;
  border-bottom: 1px solid rgba(31, 58, 42, 0.4);
  background: transparent;
  padding: 8px 0;
  resize: vertical;
}
.campo input:focus,
.campo textarea:focus {
  outline: none;
  border-bottom-color: var(--bosque);
}
.campo textarea::placeholder {
  color: rgba(31, 58, 42, 0.38);
}
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  font-size: 11px;
  line-height: 1.6;
  color: var(--tinta-suave);
}
.check a {
  text-decoration: underline;
}
.enviar {
  justify-self: start;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--crema);
  background: var(--verde-hondo);
  border: 0;
  border-radius: 0;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.3s;
}
.enviar:hover {
  background: #253c2e;
}
.form-estado {
  font-size: 11px;
  color: var(--tinta-suave);
  min-height: 1.2em;
}

/* ---------------------------- Pie ---------------------------- */
.pie {
  position: relative;
  z-index: 2;
  background: var(--verde-hondo);
  color: var(--crema);
  padding: 4.5vh var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 11px;
}
.pie nav {
  display: flex;
  gap: 26px;
}
.pie a {
  border-bottom: 1px solid transparent;
}
.pie a:hover {
  border-color: currentColor;
}

/* ---------------------------- Responsive ---------------------------- */
@media (max-width: 1000px) {
  .datos {
    grid-template-columns: repeat(2, 1fr);
  }
  .nota {
    grid-template-columns: 1fr;
    gap: 8vh;
  }
}
@media (max-width: 720px) {
  :root {
    --gutter: 7vw;
  }
  .nav {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .nav-izq,
  .pill {
    display: none;
  }
  .marca {
    justify-items: start;
    text-align: left;
  }
  .hero-copy {
    top: 24%;
    width: 86vw;
  }
  .luces {
    top: 13vh;
    bottom: auto;
    left: var(--gutter);
    right: var(--gutter);
    gap: 8px;
  }
  .luces-hint {
    display: none;
  }
  .luz {
    padding: 8px 12px 8px 10px;
    font-size: 12px;
  }
  .cuarto-copy {
    left: 0;
    right: 0;
    width: auto;
    top: auto;
    bottom: 0;
    padding: 5vh var(--gutter) 12vh;
    background: linear-gradient(transparent, rgba(243, 238, 229, 0.92) 24%, rgba(243, 238, 229, 0.97));
  }
  body.noche .cuarto-copy {
    background: linear-gradient(transparent, rgba(12, 15, 22, 0.86) 24%, rgba(12, 15, 22, 0.95));
  }
  .cuarto-ventana {
    width: 62%;
    height: 46%;
    top: 12%;
  }
  .cuarto-cama {
    width: 96%;
    height: 30%;
  }
  .agenda-copy {
    width: auto;
    right: var(--gutter);
  }
  .agenda-marco {
    display: none;
  }
  .barra {
    font-size: 8px;
    gap: 12px;
  }
  .barra span:last-child {
    display: none;
  }
}

/* ---------------------------- Movimiento reducido ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Sin scroll ligado: las dos escenas se apilan y todo queda visible y quieto */
  .hero-wrap {
    height: auto;
  }
  .hero {
    position: relative;
    height: 184vh;
  }
  .hero-copy {
    top: 22vh;
    opacity: 1;
  }
  .escena {
    height: 92vh;
  }
  .cuarto {
    top: 92vh;
    height: 92vh;
    opacity: 1;
  }
  .cuarto-copy {
    top: 104vh;
    opacity: 1;
    transform: none;
  }
  .luces {
    bottom: 6vh;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav {
    position: absolute;
  }
  .nav.oculto {
    transform: none;
    opacity: 1;
  }
  .barra {
    position: absolute;
    bottom: auto;
    top: 88vh;
  }
}

/* Atelier refinement */
::selection{background:#7d826a;color:#fff}canvas{touch-action:pan-y}
