/* ==========================================================================
   BASE · Tokens de marca (Quiet Luxury), reset, tipografía, layout y botones
   Orden de carga: base.css → components.css → modals.css
   ========================================================================== */

/* ---------- 0. FUENTES (auto-hospedadas, antes en Google Fonts) ---------- */
/* Cormorant Garamond y Plus Jakarta Sans son variable fonts: Google sirve el
   mismo archivo .woff2 para varios pesos estáticos; el navegador selecciona
   la instancia correcta según el font-weight declarado en cada regla. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-normal.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- 1. TOKENS ---------- */
:root {
  /* Color */
  --obsidian: #090a0c;
  --onyx: #111316;
  --charcoal: #17191e;
  --alabaster: #f4f1e9;
  --ivory: #fcfbf8;
  --stone: #9a9893;
  --gold: #c5b191;
  --gold-light: #d4c2a4;
  --viridian: #3f7964;
  --hairline: rgba(210, 194, 168, 0.14);
  --hairline-strong: rgba(210, 194, 168, 0.25);
  --gold-tint: rgba(197, 177, 145, 0.1);
  --gold-muted: rgba(197, 177, 145, 0.4);
  --danger: #f87171;

  /* Tipografía */
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --container: 1280px;
  --gutter: 16px;
  --section-pad: 72px; /* relleno vertical de cada sección */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --section-pad: 96px; }
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--alabaster);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, p, blockquote, figure { margin: 0; font-size: inherit; font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: transparent; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--obsidian); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Iconos: sprite incrustado al inicio de <body> en index.html */
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 14px; height: 14px; }
.icon--gold { color: var(--gold); }

/* Párrafos: tamaño y altura de línea base de todo el sitio (como en producción).
   Las clases de componente no redefinen estos dos valores en un <p>. */
p { font-size: 17px; line-height: 1.65; }

/* ---------- 3. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Sección estándar. Variantes: --obsidian / --onyx, --clip (fondos fijos) */
.section {
  position: relative;
  width: 100%;
  overflow: hidden;
  overflow: clip; /* recorta exacto al píxel y no impide position: sticky (ver .bg-layer) */
}
/* Línea divisoria superior: va como pseudo-elemento sobre el velo. Con border-top quedaba fuera del velo
   y dejaba ver 1 px de la imagen de fondo fija sin oscurecer. */
.section::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  height: 1px;
  background: var(--hairline);
  pointer-events: none;
}
.section--obsidian { background: var(--obsidian); }
/* Las secciones onyx nacen y terminan en obsidian, para que no haya un salto de color entre secciones */
.section--onyx { background: linear-gradient(to bottom, var(--obsidian), var(--onyx) 160px, var(--onyx) calc(100% - 160px), var(--obsidian)); }
.section--visible { overflow: visible; } /* necesario para position: sticky dentro de la sección */
.section--ambient {
  background-image:
    radial-gradient(circle at 80% 20%, rgba(197, 177, 145, 0.08) 0%, rgba(17, 19, 22, 0) 50%),
    radial-gradient(circle at 15% 85%, rgba(63, 121, 100, 0.06) 0%, rgba(9, 10, 12, 0) 45%);
  background-attachment: fixed;
}

/* Contenido de sección: apila bloques con separación amplia */
.section__inner {
  position: relative;
  z-index: 10;
  padding-block: var(--section-pad); /* el relleno va aquí y no en <section>, para que .bg-layer cubra toda la sección */
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* Cabecera de sección: eyebrow + título + texto */
.section-head { display: flex; flex-direction: column; gap: 16px; }
.section-head--narrow { max-width: 672px; }
.section-head--medium { max-width: 760px; }
.section-head--center { align-items: center; text-align: center; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10.9px;
  line-height: 16.32px;
  letter-spacing: 3.482px;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  flex-shrink: 0;
  background: var(--gold);
}
.eyebrow--muted { color: var(--stone); }
.eyebrow--muted::before { display: none; }

.title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  color: var(--alabaster);
}
.title em, .title-accent { font-style: italic; color: var(--gold); }
@media (min-width: 640px) { .title { font-size: 52px; } }
@media (min-width: 1024px) { .title { font-size: 60px; } }

.lead {
  padding-top: 8px;
  font-weight: 300;
  color: var(--stone);
}

/* Capa de fondo "fijo" (efecto parallax) detrás de una sección: pegajosa (sticky) al viewport mientras la
   sección pasa. Va dentro de la sección, así el recorte es exacto y no se escapa un píxel de imagen en los bordes.
   Cada sección define su imagen y opacidad en components.css. */
.bg-layer {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  margin-bottom: -100vh; /* no ocupa espacio: el contenido va encima */
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.65s var(--ease);
  will-change: opacity;
}
.bg-layer.bg-is-visible { opacity: var(--bg-opacity, 1); }

/* Velo degradado que funde el fondo con el color de la sección */
.veil { position: absolute; inset: 0; pointer-events: none; }
.veil--obsidian { background: linear-gradient(to bottom, var(--obsidian), rgba(9, 10, 12, 0.75), var(--obsidian)); }
.veil--onyx { background: linear-gradient(to bottom, var(--obsidian) 0, rgba(17, 19, 22, 0.75) 30%, rgba(17, 19, 22, 0.75) 70%, var(--obsidian) 100%); }

/* ---------- 4. BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--gold { background: var(--gold); color: var(--obsidian); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.btn--gold:hover { background: var(--gold-light); }

.btn--outline {
  height: 50px;
  font-weight: 400;
  color: var(--alabaster);
  border: 1px solid var(--gold-muted);
  background: rgba(9, 10, 12, 0.4);
}
.btn--outline:hover { border-color: var(--gold); background: var(--gold-tint); }

.btn--small { height: auto; padding: 14px 32px; font-size: 12px; letter-spacing: 0.16em; font-weight: 600; }
.btn--block { width: 100%; }

/* ---------- 5. FORMULARIOS ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 10.5px;
  line-height: 15px;
  letter-spacing: 3.2px;
  text-transform: uppercase;
  color: var(--stone);
}
.field__input {
  width: 100%;
  height: 42px;
  padding: 10px 15px;
  font-size: 14px;
  color: var(--alabaster);
  background: var(--obsidian);
  border: 1px solid var(--hairline);
  outline: none;
  transition: border-color 0.2s;
}
.field__input:focus { border-color: var(--gold); }
textarea.field__input { height: 68px; resize: none; }

/* Trampa anti-spam: invisible para personas */
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Elementos que inyecta js/leads.js (consentimiento y estado) */
.drg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.drg-consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 8px; font-size: 11.5px; line-height: 1.5; color: var(--stone); text-align: left; }
.drg-consent input { flex: none; width: 15px; height: 15px; margin-top: 3px; accent-color: var(--gold); }
.drg-consent a { color: var(--gold); text-decoration: underline; }
.drg-estado { margin: 6px 0 0; font-size: 12.5px; font-weight: 500; color: var(--danger); }
.drg-estado a { color: var(--gold); text-decoration: underline; }

/* ---------- 6. EFECTOS DE MOVIMIENTO ---------- */
/* Aparición progresiva al hacer scroll (js/main.js añade .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  will-change: opacity, transform;
}
.reveal--left { transform: translateX(-36px); }
.reveal.is-visible { opacity: 1; transform: none; }

.parallax { will-change: transform; transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .bg-layer { transition: none; }
}

/* ---------- 7. SCROLLBAR ---------- */
.scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.scrollbar::-webkit-scrollbar-track { background: var(--obsidian); }
.scrollbar::-webkit-scrollbar-thumb { background: rgba(197, 177, 145, 0.3); border-radius: 999px; }
.scrollbar::-webkit-scrollbar-thumb:hover { background: var(--gold); }
