/* ============================================================
   4E · CUATRO ENCUENTROS — shared design system
   Used by: Landing 4E.html, Contacto.html, Gracias.html
   ============================================================ */

/* INTRO RUST — display face (rough / distressed).
   Production: replace this CDN @font-face with the official licensed
   webfont kit from Fontfabric and self-host the .woff2. */
@font-face {
  font-family: 'Intro Rust';
  src: url('https://db.onlinewebfonts.com/t/3d9baeab120f944c61f043b21730bb51.woff2') format('woff2'),
       url('https://db.onlinewebfonts.com/t/3d9baeab120f944c61f043b21730bb51.woff') format('woff');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:        #0D0C0A;   /* warm near-black */
  --fg:        #F0EDE6;   /* warm white */
  --muted:     #8A8580;   /* warm grey */
  --rule:      #2E2C2A;   /* separators */
  --btn-bg:    #F0EDE6;
  --btn-fg:    #0D0C0A;

  --font-display: 'Intro Rust', 'Arial Black', system-ui, sans-serif;
  --font-body:    'Geist', system-ui, -apple-system, sans-serif;

  --maxw: 720px;
  --gutter: clamp(22px, 6vw, 48px);
  --grain-opacity: 0.55;
  --label: 11px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: 0.005em;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- FILM GRAIN ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  will-change: transform;
  animation: grainShift 0.6s steps(3) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -2%); }
  100% { transform: translate(-1%, 1%); }
}

/* ---------- LAYOUT PRIMITIVES ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
section { position: relative; }
.rule { border: 0; border-top: 1px solid var(--rule); width: 100%; }
.section-pad { padding: clamp(76px, 13vh, 132px) 0; }

/* ---------- SECTION HEAD: icon + eyebrow + headline ---------- */
.sec-head { margin-bottom: 40px; }
.sec-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--muted);
  margin-bottom: 22px;
}
.sec-icon svg { display: block; width: 100%; height: 100%; }
.label {
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.headline {
  font-size: clamp(27px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-wrap: balance;
  margin-top: 16px;
}
.sec-head .label + .headline { margin-top: 16px; }

/* ---------- TEXT ---------- */
.lede {
  font-size: clamp(19px, 2.3vw, 23px);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.005em;
}
.lede + .lede { margin-top: 1.5em; }
.body-text {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 300;
  color: var(--fg);
  line-height: 1.66;
}
.body-text + .body-text { margin-top: 1.4em; }
.muted { color: var(--muted); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 17px 30px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.btn--ghost {
  background: transparent;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.16em;
  padding: 15px 30px;
  box-shadow: inset 0 0 0 1px rgba(240,237,230,0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.btn--ghost:hover { background: rgba(240,237,230,0.06); color: var(--fg); box-shadow: inset 0 0 0 1px rgba(240,237,230,0.7); }

/* small/subtle modifier — used for the hero "conocé la propuesta" link */
.btn--sm {
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 11px 22px;
  font-weight: 500;
}

/* ambient scroll cue at the bottom of the first viewport */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  z-index: 3;
}
.hero-cue:hover { color: var(--fg); }
.hero-cue .chev { width: 22px; height: 22px; animation: cueBob 1.9s ease-in-out infinite; }
@keyframes cueBob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; width: 100%; text-align: center; overflow: hidden; }
.hero-bg { position: relative; width: 100%; z-index: 0; overflow: hidden; }
.hero-bg img {
  display: block;
  width: 100%;
  height: clamp(700px, 205svh, 1860px);
  object-fit: cover;
  object-position: 50% 26%;
  opacity: 0.95;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(82% 42% at 50% 23%, rgba(13,12,10,0.55) 0%, rgba(13,12,10,0.12) 48%, rgba(13,12,10,0) 66%),
    linear-gradient(to bottom, rgba(13,12,10,0.38) 0%, rgba(13,12,10,0) 16%, rgba(13,12,10,0) 100%);
}
/* reliable bottom dissolve into the page (real element renders consistently) */
.hero-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(13,12,10,0) 0%,
    rgba(13,12,10,0.5) 48%,
    rgba(13,12,10,0.9) 80%,
    var(--bg) 100%);
}
.hero-inner {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px var(--gutter);
  z-index: 2;
  text-shadow: 0 2px 28px rgba(13,12,10,0.6);
}
.hero-lockup { margin: 0 0 40px; line-height: 0; }
.hero-lockup img {
  display: block;
  width: auto;
  height: clamp(300px, 56vh, 460px);
  max-width: 82vw;
  object-fit: contain;
}
.hero-tagline {
  font-size: clamp(17px, 2.2vw, 19px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  max-width: 600px;
  text-wrap: balance;
  margin-bottom: 42px;
}

/* ============================================================
   QUÉ TE LLEVÁS — 2×2
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px 52px; }
.take-item .ti-icon { display: block; width: 26px; height: 26px; color: var(--muted); margin-bottom: 16px; }
.take-item .ti-icon svg { display: block; width: 100%; height: 100%; }
.take-item .num {
  font-size: 13px; font-weight: 500; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px;
}
.take-item h3 {
  font-size: clamp(20px, 2.3vw, 23px); font-weight: 600; line-height: 1.18;
  letter-spacing: -0.01em; margin-bottom: 14px;
}
.take-item p { font-size: 16px; font-weight: 300; line-height: 1.6; color: var(--muted); }

/* ============================================================
   CÓMO FUNCIONA — number + text
   ============================================================ */
.subhead { font-size: clamp(18px, 2.1vw, 21px); font-weight: 400; line-height: 1.45; margin: 36px 0 8px; letter-spacing: -0.01em; }
.steps { margin-top: 22px; }
.step {
  display: grid; grid-template-columns: 78px 1fr; gap: 24px; align-items: start;
  padding: 24px 0; border-top: 1px solid var(--rule);
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step .step-n {
  font-family: 'Montserrat', var(--font-body);
  font-weight: 600; font-size: clamp(36px, 4.8vw, 48px); line-height: 1; letter-spacing: 0; color: var(--fg);
}
.step .step-body h4 { font-size: clamp(19px, 2.2vw, 22px); font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.step .step-body p { font-size: 16px; font-weight: 300; color: var(--muted); line-height: 1.6; }

/* ============================================================
   FACILITADORES
   ============================================================ */
.facis { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.faci { padding: 0 40px; }
.faci:first-child { padding-left: 0; }
.faci:last-child { padding-right: 0; border-left: 1px solid var(--rule); }
.faci-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 26px;
  background: #161412;
}
.faci .name { font-size: clamp(22px, 2.6vw, 27px); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 20px; }
.faci .bio { font-size: 15.5px; font-weight: 300; line-height: 1.62; color: var(--muted); white-space: pre-line; }
.faci .bio .lead-in { color: var(--fg); }

/* ============================================================
   CENTERED / CLOSING
   ============================================================ */
.center { text-align: center; }
.center .body-text { max-width: 520px; margin-left: auto; margin-right: auto; }
.center .sec-icon { margin-left: auto; margin-right: auto; }
.center .btn { margin-top: 38px; }
.closing-quote {
  font-family: var(--font-body); font-weight: 300; font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.28; letter-spacing: -0.015em; color: var(--fg); max-width: 820px; margin: 0 auto;
  text-wrap: balance; text-indent: -0.4em;
}
.closing-cite {
  display: block; margin-top: 30px; font-size: 12px; font-weight: 500; font-style: normal;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

/* ============================================================
   ENCUADRE — key/value
   ============================================================ */
.facts { margin-top: 8px; }
.fact {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; padding: 22px 0;
  border-top: 1px solid var(--rule); align-items: baseline;
}
.fact:last-child { border-bottom: 1px solid var(--rule); }
.fact .k { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-size: clamp(16px, 2vw, 18px); font-weight: 400; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 40px 0 56px; border-top: 1px solid var(--rule); }
.footer-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px 32px;
  flex-wrap: wrap; font-size: 12px; letter-spacing: 0.04em; color: var(--muted);
}
.footer-row .left { color: var(--fg); font-weight: 500; }
.footer-row a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-row a:hover { color: var(--fg); }

/* ============================================================
   SUBPAGE HEADER (Contacto / Gracias) — small back-to-home bar
   ============================================================ */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--fg);
}
.topbar .brand img { height: 30px; width: auto; display: block; }
.topbar .brand .brand-tx { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.topbar .back {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.topbar .back:hover { color: var(--fg); }
.topbar .back svg { width: 16px; height: 16px; }

/* ============================================================
   FORM
   ============================================================ */
.form-wrap { max-width: 600px; }
.form-intro { margin-bottom: 52px; }
.field { margin-bottom: 38px; }
.field > label, .field > .q {
  display: block; font-size: 15px; font-weight: 500; color: var(--fg);
  margin-bottom: 14px; letter-spacing: -0.005em; line-height: 1.4;
}
.field .hint { color: var(--muted); font-weight: 300; font-size: 14px; margin-left: 2px; }
.req { color: var(--muted); }

.input, .textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 300;
  padding: 12px 2px;
  transition: border-color 0.2s ease;
}
.input::placeholder, .textarea::placeholder { color: #555049; }
.input:focus, .textarea:focus { outline: none; border-bottom-color: var(--fg); }
.textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.field.invalid .input, .field.invalid .textarea { border-bottom-color: #C2562F; }
.err-msg { display: none; color: #C2562F; font-size: 13px; margin-top: 8px; }
.field.invalid .err-msg { display: block; }

/* radio group */
.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-opt { position: relative; }
.radio-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border: 1px solid var(--rule); color: var(--muted);
  font-size: 14px; letter-spacing: 0.02em; cursor: pointer; transition: all 0.2s ease; user-select: none;
}
.radio-opt input:hover + span { border-color: rgba(240,237,230,0.4); color: var(--fg); }
.radio-opt input:checked + span { border-color: var(--fg); color: var(--bg); background: var(--fg); }
.radio-opt input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }

.dyn-field { display: none; margin-top: 26px; }
.dyn-field.show { display: block; animation: fadeInUp 0.4s ease both; }

.privacy { font-size: 13px; color: var(--muted); font-weight: 300; margin: 8px 0 36px; line-height: 1.5; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-submit { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* ============================================================
   GRACIAS
   ============================================================ */
.gracias {
  min-height: calc(100vh - 84px);
  min-height: calc(100svh - 84px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px var(--gutter);
}
.gracias .g-icon { display: block; width: 56px; height: 56px; color: var(--fg); margin: 0 auto 34px; }
.gracias .g-icon svg { display: block; width: 100%; height: 100%; }
.gracias h1 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 8vw, 72px);
  line-height: 0.95; letter-spacing: 0.01em; text-transform: uppercase; margin-bottom: 26px;
}
.gracias p { font-size: clamp(17px, 2.2vw, 20px); font-weight: 300; color: var(--muted); max-width: 460px; margin: 0 auto 40px; line-height: 1.6; }

/* ============================================================
   ANIMATIONS — entrance + scroll reveal
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* scroll reveal: hidden ONLY when JS is present (html.js-anim).
   Without JS, content stays fully visible (progressive enhancement). */
.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(.22,.61,.36,1), transform 0.7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js-anim [data-reveal].is-visible { opacity: 1; transform: none; }

/* hero entrance — hidden only under js-anim, animates in once body.ready */
.js-anim .hero-lockup, .js-anim .hero-tagline, .js-anim .hero .btn { opacity: 0; }
.js-anim body.ready .hero-lockup { animation: heroRise 0.9s cubic-bezier(.22,.61,.36,1) 0.1s both; }
.js-anim body.ready .hero-tagline { animation: fadeInUp 0.8s ease 0.55s both; }
.js-anim body.ready .hero .btn { animation: fadeInUp 0.8s ease 0.75s both; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.hero-bg img { animation: heroBgSettle 1.6s ease both; }
@keyframes heroBgSettle {
  from { transform: scale(1.05); }
  to   { transform: scale(1); }
}

/* ============================================================
   RESPONSIVE  (mobile: body text -1px)
   ============================================================ */
@media (max-width: 600px) {
  :root { --label: 10.5px; }
  body { font-size: 15px; }
  .body-text { font-size: 15px; }
  .lede { font-size: 17px; }
  .take-item p, .step .step-body p, .faci .bio { font-size: 14.5px; }
  .grid-2 { grid-template-columns: 1fr; gap: 44px; }
  .facis { grid-template-columns: 1fr; gap: 0; }
  .faci { padding: 0; }
  .faci:last-child { padding: 44px 0 0; border-left: 0; border-top: 1px solid var(--rule); }
  .step { grid-template-columns: 56px 1fr; gap: 16px; }
  .fact { grid-template-columns: 1fr; gap: 6px; }
  .sec-head { margin-bottom: 32px; }
  .topbar .brand .brand-tx { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .hero-cue .chev { animation: none; }
  .js-anim [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js-anim .hero-lockup, .js-anim .hero-tagline, .js-anim .hero .btn { opacity: 1 !important; animation: none !important; }
  .hero-bg img { animation: none !important; }
  .dyn-field.show { animation: none; }
}
