/* ==========================================================================
   Grupo Rotonda — Landing inversores
   Tokens según BRAND.md (manual de marca + ajustes de la referencia web)
   ========================================================================== */

:root {
  /* Marca madre */
  --gr-black: #000000;
  --gr-white: #ffffff;
  --gr-gold: #ceb97d;          /* solo sobre negro o como decoración */
  --gr-gold-text: #807141;     /* gold oscuro legible sobre blanco (referencia) */
  --gr-highlight: #e9debe;     /* marcador de titulares (referencia) */
  --gr-cream: #f6f5f0;         /* fondo de sección (referencia) */

  /* Neutros de interfaz */
  --ink: #111111;
  --ink-soft: #3d3d3d;
  --ink-muted: #6b6b6b;
  --line: #cfcfcf;
  --line-strong: #111111;
  --danger: #ab2927;           /* rojo Real Estate, también sirve para errores */

  /* Tipografía */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Libre Caslon Text", Georgia, serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 72px;
  --radius-card: 16px;
  --radius-input: 8px;
}

/* --- Reset mínimo --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--gr-white);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
ul[role="list"] { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gr-gold-text); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gr-black); color: var(--gr-white);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Tipografía --- */
.display {
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.h2 {
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.h2--lg { font-size: clamp(2rem, 3.6vw, 3.125rem); }
.h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.lead { font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); color: var(--ink-soft); }
.lead strong { color: var(--ink); }
.eyebrow-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--gr-gold-text);
}
.fineprint { font-size: 0.75rem; color: var(--ink-muted); }

/* Marcador de titulares (manual: destacado sobre fondo tinte) */
.hl {
  background: var(--gr-highlight);
  color: inherit;
  font-weight: 600;
  padding: 0 0.12em;
  margin: 0 -0.06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--gr-black);
  font: 600 0.9375rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn--primary { background: var(--gr-black); color: var(--gr-white); }
.btn--primary:hover { background: #2a2a2a; }
.btn--outline { background: transparent; color: var(--gr-black); }
.btn--outline:hover { background: var(--gr-black); color: var(--gr-white); }
.btn--sm { min-height: 40px; padding: 8px 20px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: #ececec; }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.site-header__logo img { width: 164px; height: auto; }
[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* --- Onda de marca como máscara de imagen --- */
.wave-mask {
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
/* bump blanco que entra desde el borde derecho */
.wave-mask--right {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V52C100 57 96.5 59 96.5 66S100 75 100 80V100H0Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V52C100 57 96.5 59 96.5 66S100 75 100 80V100H0Z'/%3E%3C/svg%3E");
}
/* bump blanco que entra desde el borde izquierdo */
.wave-mask--left {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100 0H0V28C0 36 7 42 7 52S0 66 0 76V100H100Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100 0H0V28C0 36 7 42 7 52S0 66 0 76V100H100Z'/%3E%3C/svg%3E");
}

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(520px, 44vw, 660px);
}
.hero__media {
  display: grid;
  grid-template-columns: 56fr 44fr;
  min-height: 100%;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__content {
  display: flex; flex-direction: column; justify-content: center;
  gap: 20px;
  padding: 48px var(--gutter) 40px clamp(32px, 4vw, 64px);
  max-width: calc(var(--container) / 2 + var(--gutter));
}
.hero .display { margin-bottom: 4px; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; margin-top: 8px; }
.cta-row__note { font-size: 0.875rem; font-weight: 600; }

/* --- Banda negra --- */
.band { background: var(--gr-black); color: var(--gr-white); }
.band__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding-block: 14px;
}
.band__text {
  font-size: 0.8125rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.band__url { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; white-space: nowrap; }

/* --- Secciones genéricas --- */
.section { padding-block: clamp(64px, 8vw, 112px); }
.section--cream { background: var(--gr-cream); }
.section__head { display: grid; gap: 16px; margin-bottom: clamp(32px, 4vw, 48px); }
.section__head p { color: var(--ink-soft); }

/* --- Formulario --- */
.form-section {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.form-section__intro { display: grid; gap: 20px; color: var(--ink-soft); max-width: 30rem; }
.form-section__intro .h2 { color: var(--ink); margin-bottom: 4px; }
.form-section__intro strong { color: var(--ink); }

.form-card {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 28px);
  background: var(--gr-white);
}
#lead-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.field { display: grid; gap: 6px; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.8125rem; font-weight: 600; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--gr-white);
  font: 400 0.9375rem var(--font-sans);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23111' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field select:invalid { color: var(--ink-muted); }
.field select option { color: var(--ink); }
.field input:hover, .field select:hover { border-color: #999; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gr-black);
  box-shadow: 0 0 0 3px var(--gr-highlight);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--danger); }
.field__error { min-height: 1.25em; font-size: 0.75rem; color: var(--danger); }

.field--check { margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8125rem !important; font-weight: 400 !important; color: var(--ink-soft); cursor: pointer; }
.check input {
  flex: none; width: 18px; height: 18px; margin: 1px 0 0;
  accent-color: var(--gr-black);
}

.form-status {
  grid-column: 1 / -1;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  background: #f8e9e9;
  color: var(--danger);
  font-size: 0.875rem;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { display: grid; justify-items: start; gap: 14px; padding: 12px 4px; color: var(--ink-soft); }
.form-success:focus { outline: none; }
.form-success .h3 { color: var(--ink); font-size: 1.5rem; font-weight: 500; }

/* --- Opciones --- */
.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.option {
  background: var(--gr-white);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.option img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.option__body { display: grid; gap: 8px; padding: 20px 20px 24px; }
.option__body p { font-size: 0.9375rem; color: var(--ink-soft); }
.options__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 3vw, 40px);
  font-size: 0.9375rem;
}

/* --- Opciones (versión con máscaras de onda) --- */
.ways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.2vw, 48px);
  align-items: start;
  list-style: none; margin: 0; padding: 0;
}
.way__media { aspect-ratio: 1 / 1.08; overflow: hidden; }
.way__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out, ease-out); }
.way__body { display: grid; gap: 8px; padding-top: 22px; }
.way__body p { font-size: 0.9375rem; color: var(--ink-soft); max-width: 30ch; }
.way__num {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.125rem; line-height: 1;
  color: var(--gr-gold-text);
  display: flex; align-items: center; gap: 12px;
}
.way__num::after { content: ""; width: 40px; height: 1px; background: var(--gr-gold); }
@media (hover: hover) {
  .way:hover .way__media img { transform: scale(1.05); }
}
/* cada imagen con la onda en un lugar distinto, como en el manual */
.way--1 .way__media { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V86C88 86 82 100 64 100C46 100 40 92 24 92C12 92 6 96 0 98Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V86C88 86 82 100 64 100C46 100 40 92 24 92C12 92 6 96 0 98Z'/%3E%3C/svg%3E"); }
.way--2 .way__media { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100H100V2C94 4 88 8 76 8C60 8 54 0 36 0C18 0 12 14 0 14Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100H100V2C94 4 88 8 76 8C60 8 54 0 36 0C18 0 12 14 0 14Z'/%3E%3C/svg%3E"); }
.way--3 .way__media { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V98C94 96 88 92 76 92C60 92 54 100 36 100C18 100 12 86 0 86Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V98C94 96 88 92 76 92C60 92 54 100 36 100C18 100 12 86 0 86Z'/%3E%3C/svg%3E"); }
.way--2 { margin-top: clamp(0px, 4.5vw, 64px); }

/* --- Historia --- */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(460px, 39vw, 600px);
}
.story__content {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 24px;
  padding: clamp(56px, 6vw, 80px) clamp(32px, 4vw, 64px) clamp(56px, 6vw, 80px) var(--gutter);
  width: 100%;
  max-width: calc(var(--container) / 2 + var(--gutter));
  justify-self: end;
}
.story__content .h2 { max-width: 10em; }
.story__media img { width: 100%; height: 100%; object-fit: cover; }

/* --- Footer --- */
.site-footer { background: var(--gr-black); color: var(--gr-white); padding-block: 48px 32px; }
.site-footer__top {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 32px;
}
.site-footer__top img { width: 150px; height: auto; }
.site-footer__tagline {
  margin-top: 14px;
  font-family: var(--font-serif); font-style: italic;
  color: var(--gr-gold);
}
.site-footer__info { font-style: normal; font-size: 0.875rem; line-height: 1.7; }
.site-footer__info a:hover { color: var(--gr-gold); }
.site-footer__legal { margin-top: 48px; font-size: 0.75rem; color: #a3a3a3; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Desktop ancho: el hero alinea su texto con el contenedor */
@media (min-width: 1261px) {
  .hero__content { padding-right: calc((100vw - var(--container)) / 2); max-width: none; }
}

@media (max-width: 960px) {
  .hero, .story { grid-template-columns: 1fr; min-height: 0; }
  .hero__media { height: clamp(260px, 62vw, 460px); }
  .hero__content, .story__content { max-width: none; padding: 40px var(--gutter) 48px; }
  .story__media { order: -1; height: clamp(260px, 62vw, 460px); }

  /* en mobile la onda pasa al borde inferior / superior */
  .wave-mask--right {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100H78C72 100 70 94 62 94S52 100 46 100H0Z'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100H78C72 100 70 94 62 94S52 100 46 100H0Z'/%3E%3C/svg%3E");
  }
  .wave-mask--left {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100H64C58 100 56 94 48 94S38 100 32 100H0Z'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100H64C58 100 56 94 48 94S38 100 32 100H0Z'/%3E%3C/svg%3E");
  }

  .form-section { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; max-width: 560px; }
  .ways { grid-template-columns: 1fr; max-width: 560px; gap: 40px; }
  .way--2 { margin-top: 0; }
  .way__media { aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .site-header__logo img { width: 132px; }
  .site-header .btn { padding-inline: 14px; font-size: 0.8125rem; }
  .band__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .band__text { font-size: 0.75rem; }
  #lead-form { grid-template-columns: 1fr; }
  .cta-row .btn, .options__foot .btn, .story__content .btn { width: 100%; }
  .site-footer__legal { margin-top: 32px; }
}

/* ==========================================================================
   Movimiento
   Solo se activa con JS (clase .js en <html>); sin JS todo se ve estático.
   ========================================================================== */
:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* Hero: entrada escalonada al cargar */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1); } }

.js [data-anim="hero"] { animation: rise .9s var(--ease-out) var(--d, 0s) both; }
.js [data-anim="hero-media"] img {
  animation: wipe 1.1s var(--ease-out) both, settle 2.2s var(--ease-out) both;
}
.js [data-anim="hero-media"] img + img { animation-delay: .15s, .15s; }

/* Aparición al hacer scroll */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease var(--d, 0s), transform .9s var(--ease-out) var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js [data-reveal="zoom"] { transform: none; overflow: hidden; }
.js [data-reveal="zoom"] img { transform: scale(1.1); transition: transform 1.6s var(--ease-out); }
.js [data-reveal="zoom"].is-in img { transform: scale(1); }

/* Marcador que se "pinta" de izquierda a derecha */
.js .hl {
  background: linear-gradient(var(--gr-highlight), var(--gr-highlight)) no-repeat 0 0 / 0% 100%;
  transition: background-size .9s var(--ease-out) .35s;
}
.js .hl.is-in { background-size: 100% 100%; }
.js .hero .hl { transition-delay: .9s; }

/* Hover de tarjetas */
.option { transition: translate .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.js .option[data-reveal] {
  transition: opacity .8s ease var(--d, 0s), transform .9s var(--ease-out) var(--d, 0s),
              translate .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.option img { transition: transform .8s var(--ease-out); }
@media (hover: hover) {
  .option:hover { translate: 0 -6px; }
  .option:hover { box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .35); }
  .option:hover img { transform: scale(1.05); }
  .btn--primary:hover { transform: translateY(-2px); }
}

/* Respetar "reducir movimiento" del sistema */
@media (prefers-reduced-motion: reduce) {
  .js [data-anim], .js [data-anim] img,
  .js [data-reveal], .js [data-reveal] img {
    animation: none !important; transition: none !important;
    opacity: 1 !important; transform: none !important; clip-path: none !important;
  }
  .js .hl { transition: none; background-size: 100% 100%; }
  .option, .option img, .way__media img, .btn { transition: none; }
}
