/* Fresco · página de presentación (3.2). Dirección «La frase es la composición» (taste-skill, seed 457293972),
   con la paleta y la letra de la marca: verde bosque #163300, verde Fresco #38e54d, papel #f2f4f0, Inter. */
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f2f4f0; --surface: #ffffff; --tono: #e6eae3;
  --ink: #12160f; --muted: #50544d;
  --forest: #163300; --green: #38e54d; --soft: #dcf5cd; --deep: #0d2000;
  --accent: #38e54d; --accent-ink: #163300;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Cinco tamaños, nada más. */
  --s-small: 15px;
  --s-body: 18px;
  --s-statement: clamp(22px, 1.1rem + 1.4vw, 36px);
  --s-head: clamp(44px, 6.4vw, 104px);
  --s-display: clamp(60px, 10.5vw, 160px);
  --margin: clamp(20px, 3vw, 40px);
  --section: clamp(48px, 5vw, 64px);
  --alto: min(76svh, 640px); /* alto de la portada: no ocupa la pantalla completa */
  --pill: 9999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}
@media (max-width: 760px) { :root { --s-head: 11vw; --s-display: 14vw; --s-statement: 21px; --alto: min(64svh, 520px); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--s-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--green); color: var(--forest); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--pill); }
.saltar:focus { top: 12px; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color 180ms ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

/* Un solo botón para toda la página: píldora rellena. */
.boton { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.boton:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .boton:hover { background: #4ff064; } }
.boton.claro { background: var(--green); color: var(--forest); }

/* ---------- barra fija: toma la tinta del capítulo que pasa debajo ---------- */
.barra { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 14px var(--margin); color: var(--header-ink, var(--forest)); background: var(--header-bg, var(--bg)); transition: color 300ms ease, background-color 300ms ease; }
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: var(--s-body); font-weight: 800; letter-spacing: -0.03em; margin-right: auto; }
.marca img { width: 32px; height: 32px; border-radius: 9px; }
.enlaces { display: flex; gap: 26px; font-size: var(--s-small); font-weight: 600; }
@media (max-width: 760px) { .enlaces a:not(:last-child) { display: none; } .barra { gap: 18px; } }

/* ---------- portada: dos campos que se encuentran a media altura ---------- */
.portada { position: relative; height: var(--alto); min-height: 520px; background: var(--bg); overflow: hidden; }
.campo-abajo { position: absolute; left: 0; right: 0; top: calc(var(--alto) * 0.5); bottom: 0; background: var(--forest); }
/* La segunda línea queda cortada en su tercio superior por el borde: el borde cae a 1,17em del techo de la frase. */
.frase { --fs: var(--s-display); z-index: 1; position: absolute; left: 0; right: 0; top: calc(var(--alto) * 0.5 - 1.17 * var(--fs)); height: calc(1.8 * var(--fs)); }
.frase .copia { position: absolute; inset: 0 auto auto 0; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
  font-size: var(--fs); font-weight: 900; line-height: 0.88; letter-spacing: -0.05em; white-space: nowrap; }
.copia.arriba { color: var(--forest); }
.copia.abajo { color: var(--green); }
.l1, .l2 { display: block; }
.l2 { display: inline-flex; align-items: center; gap: 0.18em; }
/* El hueco: un recuadro del alto de una línea con la tasa de hoy, en lugar de la palabra «día». */
.hueco { display: inline-block; height: 0.8em; width: 2.45em; border-radius: 0.2em; overflow: hidden; position: relative; vertical-align: baseline; transform: translateY(0.02em); }
.arriba .hueco { background: var(--forest); color: var(--green); }
.abajo .hueco { background: var(--green); color: var(--forest); }
.tasa { position: absolute; inset: 0; }
.tasa span { position: absolute; inset: 0; height: calc(var(--fs) * 0.8); display: flex; align-items: center; justify-content: center; font-size: calc(var(--fs) * 0.25); letter-spacing: -0.02em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.apoyo { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(560px, calc(100% - 2 * var(--margin))); text-align: center; color: #e9f3e3; font-size: var(--s-body); line-height: 1.5; z-index: 1; }
/* La frase se divide en el borde: arriba tinta bosque sobre papel, abajo verde sobre bosque. */
.copia.arriba { clip-path: polygon(0 0, 100% 0, 100% 1.17em, 0 1.17em); }
.copia.abajo { clip-path: polygon(0 1.17em, 100% 1.17em, 100% 100%, 0 100%); }
@media (max-width: 760px) {
  .campo-abajo { top: calc(var(--alto) * 0.46); }
  .frase { --fs: var(--s-display); top: calc(var(--alto) * 0.46 - 1.17 * var(--fs)); }
  .hueco { width: 2.6em; }
  .tasa span { font-size: calc(var(--fs) * 0.3); }
  .apoyo { max-width: 28ch; bottom: 28px; }
}

/* ---------- intro: la idea y cuatro pantallas reales, todas a la vista ---------- */
.intro { padding: var(--section) var(--margin); background: var(--bg); }
.intro-fija { margin-bottom: 28px; }
.declaracion { max-width: 30ch; font-size: var(--s-statement); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--forest); }
.intro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); align-items: start; }
.intro-fija { grid-column: 1 / -1; }
.pasa { margin: 0; aspect-ratio: 390 / 844; overflow: hidden; border-radius: 24px; background: var(--tono); }
.pasa img, .pasa video { width: 100%; height: 100%; object-fit: cover; display: block; }
.p2, .p4 { margin-top: 40px; }
@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr 1fr; }
  .declaracion { font-size: 22px; }
  .pasa { border-radius: 18px; }
  .p2, .p4 { margin-top: 28px; }
}

/* ---------- calcula: el título es un campo donde se escribe ---------- */
.calcula { padding: var(--section) var(--margin); background: var(--surface); }
.calc-ui { width: 100%; }
.calc-in { display: block; width: 100%; border: 0; background: none; padding: 0; color: var(--forest); font-size: var(--s-head); font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; caret-color: var(--green); caret-shape: block; }
.calc-in:focus-visible { outline: none; }
.calc-ui:focus-within .calc-in { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
.calc-res { margin-top: 24px; max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.fila { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; padding: 14px 18px; border-radius: 16px; background: var(--bg); font-size: var(--s-body); }
.fila b { font-size: var(--s-statement); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--forest); white-space: nowrap; }
.fila:first-child { background: var(--forest); color: #dfe9da; }
.fila:first-child b { color: var(--green); }
.calc-nota { margin-top: 16px; max-width: 560px; color: var(--muted); font-size: var(--s-small); }
.ejemplos { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ejemplos button { font-size: var(--s-body); font-weight: 600; color: var(--forest); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; cursor: pointer; transition: text-decoration-color 180ms ease, transform 140ms var(--ease-out); }
.ejemplos button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .ejemplos button:hover { text-decoration-color: currentColor; } }
@media (max-width: 760px) {

  .calc-res { margin-top: 28px; }
  .fila { flex-direction: column; gap: 2px; }
  .ejemplos { gap: 8px; }
  .ejemplos button { min-height: 44px; padding: 0 16px; border-radius: var(--pill); background: var(--bg); text-decoration: none; }
}

/* ---------- cómo empezar: la barra de progreso agrandada ---------- */
.como { padding: var(--section) var(--margin); background: var(--bg); }
.titulo-seccion { font-size: var(--s-head); font-weight: 900; letter-spacing: -0.045em; line-height: 0.95; color: var(--forest); margin-bottom: 28px; }
.etapas { display: flex; gap: 6px; height: 22vh; min-height: 150px; }
.etapa { flex: var(--g) 1 0; min-width: 15%; border-radius: 20px; padding: 18px 16px; transform-origin: left center; overflow: hidden; }
.clausula { display: none; }
.dura { font-size: var(--s-statement); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.e1 { background: var(--forest); color: var(--green); }
.e2 { background: var(--green); color: var(--forest); }
.e3 { background: var(--soft); color: var(--forest); }
.e4 { background: var(--forest); color: #fff; }
.pasos { display: flex; gap: 6px; margin-top: 18px; }
.pasos li { flex: var(--g) 1 0; min-width: 15%; font-size: var(--s-body); line-height: 1.4; color: var(--ink); padding-right: 12px; max-width: none; }
@media (max-width: 1000px) {
  .etapas { flex-direction: column; height: auto; }
  .etapa { min-height: 96px; flex: none; }
  .e1 { min-height: 96px; } .e2 { min-height: 150px; } .e3 { min-height: 96px; } .e4 { min-height: 210px; }
  .pasos { display: none; }
  .clausula { display: block; margin-top: 8px; font-size: var(--s-body); font-weight: 500; line-height: 1.35; max-width: 34ch; }
}

/* ---------- campos de color ---------- */
.campos { display: grid; grid-template-columns: 1fr 1fr; }
.campo { position: relative; overflow: hidden; min-height: clamp(300px, 34vw, 440px); padding: 28px var(--margin); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.c1 { background: var(--forest); color: #fff; }
.c2 { background: var(--green); color: var(--forest); }
.c3 { background: var(--soft); color: var(--forest); }
.c4 { background: var(--deep); color: #fff; }
.explica { font-size: var(--s-body); line-height: 1.5; max-width: 34ch; }
.frase-campo { font-size: var(--s-head); font-weight: 900; line-height: 0.92; letter-spacing: -0.045em; }
.c1 .frase-campo, .c4 .frase-campo { color: var(--green); }
.espejo .explica { margin-left: auto; text-align: right; }
.espejo .frase-campo { text-align: right; }
@media (max-width: 760px) {
  .campos { grid-template-columns: 1fr; }
  .campo { min-height: 0; padding: 32px var(--margin); }
  .explica, .espejo .explica { max-width: none; margin-left: 0; text-align: left; }
  .frase-campo, .espejo .frase-campo { text-align: left; }
}

/* ---------- preguntas: todas abiertas ---------- */
.preguntas { padding: var(--section) var(--margin); background: var(--bg); display: flex; flex-direction: column; gap: 36px; }
.par { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); align-items: baseline; }
.preg { grid-column: 1 / span 6; font-size: var(--s-statement); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; color: var(--forest); }
.preg.suave { color: var(--muted); }
.resp { grid-column: 8 / span 5; max-width: 40ch; font-size: var(--s-body); line-height: 1.55; }
@media (max-width: 760px) {
  .preguntas { gap: 32px; }
  .par { display: block; }
  .resp { margin-top: 12px; }
}

/* ---------- cierre: la frase con un hueco ---------- */
.cierre { padding: var(--section) var(--margin); background: var(--surface); }
.frase-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2em 0.28em; font-size: var(--s-head); font-weight: 900; letter-spacing: -0.045em; line-height: 1.05; color: var(--forest); max-width: 15em; }
.frase-form input { height: 1.05em; width: 5.4em; padding: 0 0.3em; border: 0; border-radius: 0.22em; background: var(--tono); font-weight: 700; letter-spacing: -0.03em; color: var(--forest); }
.frase-form input::placeholder { color: var(--muted); }
.frase-form input:focus-visible { outline: 3px solid var(--green); outline-offset: 0; }
.ultima { height: 1.05em; padding: 0 0.32em; border-radius: 0.22em; background: var(--accent); color: var(--accent-ink); font-weight: 900; letter-spacing: -0.045em; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.ultima:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .ultima:hover { background: #4ff064; } }
.cierre-nota { margin-top: 18px; color: var(--muted); font-size: var(--s-small); }
@media (max-width: 760px) { .frase-form { font-size: var(--s-head); } .frase-form input { flex: 1; width: auto; min-width: 0; } }

/* ---------- pie: invitación sobre el nombre recortado ---------- */
.pie { position: relative; overflow: hidden; background: var(--forest); color: #fff; padding: var(--section) var(--margin) 0; display: flex; flex-direction: column; }
.pie-arriba { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.pie-inv { grid-column: 1 / span 7; }
.invita { font-size: var(--s-head); font-weight: 900; letter-spacing: -0.045em; line-height: 0.95; margin-bottom: 28px; max-width: 8em; }
.pie-links { grid-column: 10 / span 3; display: flex; flex-direction: column; gap: 10px; font-size: var(--s-body); }
.pie-legal { margin-top: 48px; display: flex; justify-content: space-between; gap: 16px; font-size: var(--s-small); color: #c9d8c1; padding-bottom: 10px; }
.pie-nombre { font-size: 24vw; font-weight: 900; letter-spacing: -0.06em; line-height: 0.8; color: var(--green); white-space: nowrap; transform: translateY(24%); margin-left: -0.04em; }
@media (max-width: 760px) {
  .pie-arriba { display: block; }

  .pie-inv .boton { width: 100%; }
  .pie-links { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; margin-top: 32px; font-size: var(--s-small); }
  .pie-nombre { font-size: 34vw; }
}

/* ---------- movimiento (el contenido se ve igual sin JavaScript) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .copia .l1, .js .copia .l2 { opacity: 0; transform: translateY(0.25em); animation: sube 900ms var(--ease-out) forwards; }
  .js .copia .l2 { animation-delay: 120ms; }
  .js .apoyo { opacity: 0; animation: aparece 800ms var(--ease-out) 420ms forwards; }
  .js .tasa span + span { opacity: 0; }
  .js .tasa span { animation: turno 9s var(--ease-out) infinite; }
  .js .tasa span:nth-child(1) { animation-delay: 1.6s; }
  .js .tasa span:nth-child(2) { animation-delay: 4.6s; }
  .js .tasa span:nth-child(3) { animation-delay: 7.6s; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .etapas[data-reveal] { opacity: 1; transform: none; }
  .js .etapas[data-reveal] .etapa { transform: scaleX(0.02); transition: transform 1000ms var(--ease-out); transition-delay: calc(var(--i, 0) * 140ms); }
  .js .etapas[data-reveal].is-in .etapa { transform: none; }
  .js .frase-campo[data-reveal] { transform: translateY(24px); }
  .js .fila { transition: background-color 240ms ease; }
  .js .fila.cambia b { animation: aparece 420ms var(--ease-out); }
}
@media (hover: hover) and (pointer: fine) { .pasa img, .pasa video { transition: transform 600ms var(--ease-out); } .pasa:hover img, .pasa:hover video { transform: scale(1.03); } }
@keyframes sube { to { opacity: 1; transform: none; } }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
/* La tasa del recuadro cambia sola: BCV → USDT → euro, como una ruleta. */
/* Las tres tasas se turnan en el mismo lugar: entra desde abajo, se queda, sale por arriba. */
@keyframes turno { 0% { opacity: 0; transform: translateY(35%); } 5%, 30% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; transform: translateY(-35%); } }
