/* =========================================================
   SAUNA — styles
   Negro / blanco. Cristal empañado. Poco texto, mucho aire.
   Titulares: Format Regular · Cuerpo: Instrument Serif · Técnico/pequeño: Tecnica
   ========================================================= */

/* ---------- Tipografías (todas SIL OFL — ver assets/fonts/*-OFL.txt) ---------- */
@font-face {
  font-family: "Format";
  src: url("assets/fonts/Format-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Tecnica";
  src: url("assets/fonts/Tecnica-55.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --black: #000;
  --white: #fff;
  --soft: rgba(255, 255, 255, .72);
  --line: rgba(255, 255, 255, .24);

  --display: "Format", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --tech: "Tecnica", ui-monospace, monospace;

  --gutter: clamp(20px, 4vw, 64px);
  --space: clamp(140px, 22vw, 320px);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--black); }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
em { font-style: italic; }
::selection { background: var(--white); color: var(--black); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Texto técnico: about, etiquetas, detalles */
.tech {
  font-family: var(--tech);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.label { color: var(--soft); margin-bottom: clamp(28px, 4vw, 56px); }

/* =========================================================
   CRISTAL (canvas WebGL fijo detrás de todo)
   ========================================================= */
.glass {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.glass-ready .glass { opacity: 1; }
/* Sin WebGL: la foto, desenfocada como si estuviera empañada */
.no-webgl body {
  background: #111 url("assets/sauna.jpg") center / cover fixed;
}
.no-webgl body::before {
  content: ""; position: fixed; inset: 0;
  backdrop-filter: blur(24px) grayscale(1) brightness(.7);
  -webkit-backdrop-filter: blur(24px) grayscale(1) brightness(.7);
}

main, .footer { position: relative; z-index: 1; }
section { position: relative; padding: var(--space) var(--gutter); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--gutter);
}
.nav__logo img { height: 22px; width: auto; }
.nav__links { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav__links a {
  font-family: var(--tech);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .02em;
  opacity: .85;
  transition: opacity .3s var(--ease);
}
.nav__links a.is-active { opacity: 1; }
.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__toggle {
    display: grid; gap: 7px;
    background: none; border: 0; padding: 8px; margin-right: -8px;
    cursor: pointer; color: var(--white);
  }
  .nav__toggle span { display: block; width: 26px; height: 1px; background: currentColor; transition: transform .4s var(--ease); }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none;
    transition: opacity .5s var(--ease);
  }
  .nav__links a { font-family: var(--display); font-size: 34px; text-transform: none; opacity: 1; }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; }
}

/* =========================================================
   HOME — el cristal es el protagonista
   ========================================================= */
.home {
  height: 100svh;
  min-height: 560px;
  padding: 0;
  pointer-events: none;           /* el cursor limpia el cristal, no selecciona texto */
}
.home__title {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(88px, 12vh, 140px);
  font-size: clamp(44px, 8.4vw, 150px);
  line-height: .95;
  letter-spacing: -.035em;
}
.home__title > span { display: block; }
/* Primera línea en Instrument Serif; la segunda en Format con el logotipo */
/* “It’s” en Instrument Serif en ambas líneas */
.home__not, .home__serif { font-family: var(--serif); font-style: italic; letter-spacing: -.02em; }

/* El nombre SAUNA siempre es el logotipo SVG, a la altura de las mayúsculas */
.logo-inline {
  display: inline-block;
  height: .7em;
  width: auto;
  vertical-align: baseline;
}

.home__def {
  position: absolute;
  left: var(--gutter);
  bottom: 36px;
}
.home__hint {
  position: absolute;
  right: var(--gutter);
  bottom: 36px;
  color: var(--soft);
  animation: hint 2.4s ease-in-out 3s infinite;
  transition: opacity .8s var(--ease);
}
.home__hint::before { content: "↖ "; }
.is-wiped .home__hint { animation: none; opacity: 0; }
@keyframes hint { 50% { opacity: .25; } }

/* El contenido del home emerge del vaho */
.emerge {
  opacity: 0;
  filter: blur(40px);
  animation: emerge 2.8s var(--ease) forwards;
  animation-delay: calc(1.2s + var(--i) * .25s);
}
@keyframes emerge { to { opacity: 1; filter: blur(0); } }

/* =========================================================
   REVEAL — cada bloque se condensa al entrar
   ========================================================= */
.reveal {
  opacity: 0;
  filter: blur(32px);
  transform: translateY(24px);
  transition: opacity 1.8s var(--ease), filter 1.8s var(--ease), transform 1.8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.reveal.is-in { opacity: 1; filter: blur(0); transform: none; }

/* =========================================================
   ABOUT
   ========================================================= */
.about__text { max-width: 44ch; font-size: 18px; }
.about__title {
  margin-top: clamp(80px, 12vw, 180px);
  font-size: clamp(44px, 8vw, 140px);
  line-height: .95;
  letter-spacing: -.035em;
  text-align: right;
}

/* =========================================================
   SERVICES
   ========================================================= */
.services__title {
  font-size: clamp(34px, 6.4vw, 112px);
  line-height: .98;
  letter-spacing: -.035em;
}
.list { margin-top: clamp(56px, 8vw, 120px); border-top: 1px solid var(--line); }
.list li {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  align-items: baseline;
  gap: 16px;
  padding: clamp(18px, 2vw, 28px) 0;
  border-bottom: 1px solid var(--line);
}
.list span { color: var(--soft); }
.list h3 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 58px);
  line-height: 1;
  letter-spacing: -.01em;
}
.list p { color: var(--soft); text-align: right; }

@media (max-width: 700px) {
  .list li { grid-template-columns: 36px 1fr; }
  .list p { grid-column: 2; text-align: left; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.contact__title { font-size: clamp(48px, 10vw, 180px); line-height: .92; letter-spacing: -.045em; }
.contact__sub { margin-top: 20px; font-size: clamp(24px, 2.6vw, 42px); }
.contact__mail {
  align-self: flex-start;
  margin-top: clamp(48px, 6vw, 90px);
  font-size: clamp(24px, 2.6vw, 42px);
  border-bottom: 1px solid currentColor;
  word-break: break-word;
}


/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 32px var(--gutter);
  color: var(--soft);
  border-top: 1px solid var(--line);
}

/* =========================================================
   CURSOR — el logotipo de escalera de sauna (mismo que el favicon)
   ========================================================= */
html, body, a, button, label { cursor: url("assets/cursor.svg?v=2") 1 1, auto; }

/* =========================================================
   HOVER — el texto se empaña, como si le cayera vaho
   ========================================================= */
@media (hover: hover) {
  .nav__logo, .nav__links a, .list h3, .list p, .contact__mail.is-in {
    transition: filter .7s var(--ease), opacity .7s var(--ease);
  }
  .nav__logo:hover,
  .nav__links a:hover,
  .list li:hover h3,
  .list li:hover p,
  .contact__mail.is-in:hover {
    filter: blur(4px);
    opacity: .75;
  }
}

/* =========================================================
   Movimiento reducido
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .emerge, .reveal { animation: none; opacity: 1; filter: none; transform: none; transition: none; }
  .home__hint { animation: none; }
}
