/* ══════════════════════════════════════════════════════════════
   ca.css · Design System Método Holístico™ · v1.0
   Fuente: index.html aprobado (patrón) + sentencia design-system v1.2
   Convención: BEM del patrón. Cambios SOLO vía sentencia.
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
html { scroll-behavior: smooth; }

/* ── Tokens ── */
:root {
  --navy:  #1a2332;
  --cream: #f7f7f2;
  --gold:  #c9a96e;
  --gold-hover: #b8975a;
  --text:  rgba(26, 35, 50, 0.62);
  --line:  rgba(26, 35, 50, 0.16);
  --error: #c0392b;
  --error-bg: rgba(192, 57, 43, 0.08);
  --success: #4a7c59;
  --disabled-ink: rgba(26, 35, 50, 0.30);
  --disabled-bg: rgba(26, 35, 50, 0.06);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --body:  'Zen Kaku Gothic New', sans-serif;
  /* espacio (sentencia: 4 tokens, base vw) */
  --space-section: clamp(60px, 8vw, 120px);
  --space-block:   clamp(36px, 5vw, 64px);
  --space-gap:     clamp(24px, 3vw, 40px);
  --space-inline:  clamp(24px, 5vw, 60px);
}

body {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--body);
  font-size: clamp(15px, 1.1vw, 20px);
  font-weight: 400;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(201, 169, 110, 0.15);
  overflow-x: hidden;
}

::selection { background: rgba(201, 169, 110, 0.25); color: var(--navy); }

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

/* ── Reveal ── */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.rv.vis { opacity: 1; transform: translateY(0); }

/* ── Tipografía ── */
.kicker {
  font-family: var(--body);
  font-size: clamp(10px, 0.9vw, 16px);
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--text);
  display: block;
  margin-bottom: clamp(20px, 3vw, 36px);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  color: var(--navy);
}

p { max-width: 52ch; color: var(--text); }
p + p { margin-top: 1em; }
em { font-style: italic; color: var(--navy); }

/* ── Botón (un tamaño, primary) ── */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 18px 52px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  cursor: pointer;
  transition: background 0.4s ease;
}
.btn:hover { background: var(--gold-hover); }
.btn[disabled], .btn.is-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  pointer-events: none;
}
@media (max-width: 600px) {
  .btn { width: 100%; text-align: center; }
}

/* ── Forms GHL · muestrario v5 (sentencia Q14) ── */
.form-field { margin-bottom: var(--space-gap); text-align: left; }
.form-field label {
  font-family: var(--body);
  font-size: clamp(10px, 0.9vw, 14px);
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--text);
  display: block;
  margin-bottom: 10px;
  transition: color 0.35s ease;
}
.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 16px; /* fijo — anti-zoom iOS */
  color: var(--navy);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  transition: border-color 0.35s ease;
}
.form-field input::placeholder { color: rgba(26, 35, 50, 0.35); }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.form-field:focus-within label { color: var(--gold); }
.form-field.is-error input { border-bottom-color: var(--error); background: var(--error-bg); }
.form-field.is-error .form-msg { color: var(--error); }
.form-field.is-ok input { border-bottom-color: var(--success); }
.form-msg { font-size: 13px; margin-top: 6px; display: block; }

/* ── Logo fijo (triforce + wordmark) ── */
.fixed-logo {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.5vw, 18px);
  text-decoration: none;
  pointer-events: auto;
  opacity: 0;
  transition: top 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 1.6s ease;
}
.fixed-logo.vis { opacity: 1; }
.fixed-logo.shrunk {
  top: clamp(16px, 2.5vw, 28px);
  transform: translate(-50%, 0%) scale(0.45);
}
@media (max-width: 600px) { .fixed-logo { top: 14%; } }
.fixed-logo__icon {
  width: clamp(46px, 4.5vw, 62px);
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
.fixed-logo__text--zen {
  font-family: var(--serif);
  font-size: clamp(10px, 0.85vw, 13px);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em;
  color: var(--gold);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3));
  transition: opacity 0.4s ease;
}
.fixed-logo.shrunk .fixed-logo__text--zen { opacity: 0; }

/* ── Portada foto-fade (landing) ── */
.img-top { position: relative; height: 100vh; overflow: hidden; }
.img-top__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
}
.img-top::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 72%;
  background: linear-gradient(to top, transparent 0%,
    rgba(247,247,242,0.12) 30%, rgba(247,247,242,0.5) 60%, var(--cream) 100%);
  pointer-events: none; z-index: 3;
}
.img-top::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 70%;
  background: linear-gradient(to bottom, transparent 0%,
    rgba(247,247,242,0.03) 20%, rgba(247,247,242,0.12) 40%,
    rgba(247,247,242,0.35) 55%, rgba(247,247,242,0.65) 70%,
    rgba(247,247,242,0.88) 85%, var(--cream) 100%);
  pointer-events: none; z-index: 3;
}

/* ── Niebla (2 archivos WebP, 3 capas) ── */
.fog { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fog__layer {
  position: absolute; top: -10%; bottom: -10%; left: -40%; right: -40%; width: 180%;
  background-size: cover; background-repeat: no-repeat;
  will-change: transform;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.fog__layer--1 {
  background-image: url('assets/fog1.webp');
  background-position: center top;
  opacity: 0.85; filter: saturate(0.12) brightness(1.45);
  animation: fogA 30s linear infinite alternate;
}
.fog__layer--2 {
  background-image: url('assets/fog2.webp');
  background-position: center bottom;
  opacity: 0.75; filter: saturate(0.12) brightness(1.5);
  animation: fogB 44s linear infinite alternate;
}
.fog__layer--3 {
  background-image: url('assets/fog2.webp');
  background-position: center bottom;
  opacity: 0.45; filter: saturate(0.12) brightness(1.5);
  animation: fogA 58s linear infinite alternate-reverse;
}
@keyframes fogA { 0% { transform: translate3d(-42%, 0, 0); } 100% { transform: translate3d(4%, 0, 0); } }
@keyframes fogB { 0% { transform: translate3d(4%, 0, 0); }  100% { transform: translate3d(-42%, 0, 0); } }

/* ── Hero: título, sub, desliza, copyright ── */
.img-top__content {
  position: absolute; bottom: 22%; left: 0; right: 0;
  padding: 0 clamp(30px, 5vw, 80px);
  z-index: 4; text-align: center;
}
.img-top__title {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 400; font-style: italic;
  color: var(--cream);
  opacity: 0;
  max-width: 22ch; margin-inline: auto;
  letter-spacing: 0.02em; line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4), 0 0 30px rgba(0,0,0,0.15);
  transition: opacity 1.6s ease;
}
.img-top__title.vis { opacity: 0.95; }
.img-top__title em, .img-top__sub em { color: inherit; font-weight: 700; font-style: italic; }
.img-top__sub {
  font-family: var(--body);
  font-size: clamp(15px, 1.2vw, 20px);
  color: var(--cream); opacity: 0;
  margin-top: clamp(14px, 2vw, 24px);
  max-width: 36ch; margin-inline: auto; line-height: 1.6;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35), 0 0 20px rgba(0,0,0,0.1);
  transition: opacity 0.8s ease;
}
.img-top__sub.vis { opacity: 0.75; }

.hero-desliza {
  margin-top: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-desliza.vis { opacity: 0.85; }
.hero-desliza.hidden { opacity: 0; transition: opacity 0.4s ease; }
.hero-desliza span {
  font-family: var(--body);
  font-size: clamp(12px, 1vw, 15px); font-weight: 500;
  letter-spacing: 0.3em; text-transform: lowercase;
  color: var(--cream); text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.hero-desliza svg {
  width: 22px; height: 22px;
  stroke: var(--cream); stroke-width: 2;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
  animation: bounce-down 2s ease-in-out infinite;
}
@keyframes bounce-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.hero-copyright {
  position: absolute;
  bottom: clamp(20px, 3vw, 40px); right: var(--space-inline);
  z-index: 4;
  font-family: var(--body);
  font-size: clamp(9px, 0.7vw, 11px); letter-spacing: 0.2em;
  color: var(--cream); text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.6s ease;
}
.hero-copyright.vis { opacity: 0.5; }
.hero-copyright.hidden { opacity: 0; }

/* ── Contenido sobre crema ── */
.content { position: relative; z-index: 5; background: var(--cream); }
.content__section {
  max-width: 860px; margin: 0 auto;
  padding: var(--space-section) var(--space-inline);
}
.content__section + .content__section { border-top: 1px solid var(--line); }
.content__section:first-child { border-top: none; }
.content__section h2 {
  font-size: clamp(26px, 3vw, 48px);
  margin-bottom: var(--space-gap);
}
.content::before {
  content: ''; position: absolute; top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%; height: 40%;
  background: radial-gradient(ellipse at center, rgba(26,35,50,0.012) 0%, transparent 70%);
  pointer-events: none;
}

.feature { padding: var(--space-block) 0; border-top: 1px solid var(--line); }
.feature h3 {
  font-size: clamp(20px, 2vw, 32px);
  color: var(--navy);
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.content__cta { text-align: center; position: relative; }
.content__cta::after {
  content: ''; position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50%; height: 60%;
  background: radial-gradient(ellipse at center, rgba(201,169,110,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.content__cta h2 { max-width: 16ch; margin-inline: auto; margin-bottom: clamp(16px, 2vw, 28px); }
.content__cta p { margin-inline: auto; margin-bottom: clamp(28px, 3vw, 44px); }

.disclaimer {
  font-size: clamp(10px, 0.8vw, 13px);
  color: var(--text); opacity: 0.5;
  max-width: 42ch;
  margin: clamp(20px, 2vw, 30px) auto 0;
  line-height: 1.5;
}

/* ── Cierre foto (crema → foto → crema) ── */
.img-bottom {
  position: relative; height: 60vh; overflow: hidden;
  background: var(--cream); margin-bottom: -1px;
}
.img-bottom__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 100%;
}
.img-bottom::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60%;
  background: linear-gradient(to top, transparent 0%,
    rgba(247,247,242,0.12) 30%, rgba(247,247,242,0.5) 60%, var(--cream) 100%);
  pointer-events: none; z-index: 1;
}
.img-bottom::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(to bottom, transparent 0%,
    rgba(247,247,242,0.35) 55%, rgba(247,247,242,0.8) 80%, var(--cream) 100%);
  pointer-events: none; z-index: 1;
}

/* ── Footer ── */
.footer {
  background: var(--cream); color: var(--navy);
  padding: clamp(40px, 5vw, 60px);
  text-align: center;
  font-size: clamp(10px, 0.85vw, 14px);
  letter-spacing: 0.1em;
  opacity: 0.6;
}
.footer a { color: var(--navy); text-decoration: none; }
.footer a:hover { color: var(--gold-hover); }

/* ── Failsafe anti-blank (sentencia robustez v2.1) ──
   Si el JS no "arma" la página (ca.js no carga, o JS desactivado),
   TODO el contenido revelable se muestra completo, sin animación.
   El estado oculto (opacity:0) solo aplica con <html class="js-armed">,
   que el inline del <head> pone al instante y quita a los 2.5s si ca.js murió. */
html:not(.js-armed) .rv,
html:not(.js-armed) .img-top__title,
html:not(.js-armed) .img-top__sub,
html:not(.js-armed) .fixed-logo,
html:not(.js-armed) .hero-desliza,
html:not(.js-armed) .hero-copyright {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Reduced motion (COMPLETO — sentencia) ── */
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .fog__layer { animation: none !important; }
  .hero-desliza svg { animation: none !important; }
  html { scroll-behavior: auto; }
}
