/* Presentación (index.html). Mismos tokens que la app (DESIGN.md) y que login.css; los papelitos son objetos, no interfaz. */
@font-face { font-family: Geist; src: url(geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url(permanent-marker.woff2) format("woff2"); font-display: swap; }
:root {
  color-scheme: light dark;
  --background: oklch(0.99 0.002 80);
  --shelf: oklch(0.965 0.003 75);
  --shelf-hover: oklch(0.955 0.004 75);
  --foreground: oklch(0.22 0.006 56);
  --muted-foreground: oklch(0.52 0.012 58);
  --border: oklch(0.915 0.004 60);
  --primary: oklch(0.52 0.09 190);
  --primary-foreground: oklch(0.99 0.01 190);
  --edge: 0 0 0 1px oklch(0 0 0 / 0.06), 0 1px 2px -1px oklch(0 0 0 / 0.06), 0 2px 4px 0 oklch(0 0 0 / 0.04);
  --edge-hover: 0 0 0 1px oklch(0 0 0 / 0.08), 0 1px 2px -1px oklch(0 0 0 / 0.08), 0 2px 4px 0 oklch(0 0 0 / 0.06);
  --shot-shadow: var(--edge);
  /* Papelitos: cuaderno, birome, resaltador. */
  --note-paper: oklch(0.975 0.03 95);
  --note-sticky: oklch(0.92 0.1 98);
  --note-rule: oklch(0.78 0.05 235 / 0.55);
  --note-margin: oklch(0.66 0.14 25 / 0.55);
  --note-ink: oklch(0.36 0.1 262);
  --note-red: oklch(0.5 0.17 27);
  --note-shadow: 0 1px 1px oklch(0.3 0.02 60 / 0.12), 0 12px 24px -10px oklch(0.3 0.02 60 / 0.35);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: 16px;
  --wide: 76rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.17 0.004 60);
    --shelf: oklch(0.24 0.006 60);
    --shelf-hover: oklch(0.27 0.006 60);
    --foreground: oklch(0.95 0.003 75);
    --muted-foreground: oklch(0.69 0.01 60);
    --border: oklch(1 0 0 / 9%);
    --primary: oklch(0.72 0.1 185);
    --primary-foreground: oklch(0.2 0.03 190);
    --edge: 0 0 0 1px oklch(1 0 0 / 0.08);
    --edge-hover: 0 0 0 1px oklch(1 0 0 / 0.13);
    --shot-shadow: var(--edge);
    --note-shadow: 0 12px 28px -10px oklch(0 0 0 / 0.7);
  }
  .note { filter: brightness(0.88); }
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font: 16px/1.6 Geist, ui-sans-serif, system-ui, sans-serif; font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in oklab, var(--primary) 22%, transparent); }
h1, h2, h3, p, figure, dl, dd, ol { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--primary) 50%, transparent); outline-offset: 2px; border-radius: 6px; }
.nowrap { white-space: nowrap; }
main { overflow-x: clip; } /* los papelitos asoman por los bordes */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px;
  border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), scale 150ms var(--ease-out);
}
.btn:active { scale: 0.97; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 90%, var(--background)); }
.btn-outline { background: var(--background); box-shadow: var(--edge); }
.btn-outline:hover { background: var(--shelf-hover); box-shadow: var(--edge-hover); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { scale: none; } }

/* Barra fija: "Ingresar" siempre a la vista. */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding: 0 var(--gutter);
  background: color-mix(in oklab, var(--background) 92%, transparent); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand img { display: block; }
.bar-links { display: flex; align-items: center; gap: 20px; }
.quiet { font-size: 14px; color: var(--muted-foreground); text-decoration: none; }
.quiet:hover { color: var(--foreground); }
@media (max-width: 420px) { .quiet { display: none; } }

/* Hero: texto a la izquierda, el video vertical a la derecha (abajo en el celular). */
.hero {
  display: grid; gap: 48px; padding: 56px var(--gutter) 72px;
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto;
}
.hero-text { display: grid; gap: 20px; align-content: center; max-width: 34rem; }
h1 { font-size: clamp(2.75rem, 2rem + 2.5vw, 4rem); line-height: 1; letter-spacing: -0.04em; }
.lead { font-size: 20px; line-height: 1.5; color: var(--muted-foreground); }
/* El acompañamiento es parte de lo que se vende: arriba, junto al pedido de demo. */
.promise { font-size: 17px; line-height: 1.5; font-weight: 500; color: var(--foreground); }
.cta { display: grid; gap: 12px; justify-items: start; margin-top: 8px; }
.shot { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shot-shadow); background: var(--shelf); }
.hero-video { justify-self: center; width: min(100%, 360px); }
.video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 12px; box-shadow: var(--shot-shadow); background: oklch(0.17 0.004 60); }
.hero-video figcaption { text-align: center; }
figcaption { margin-top: 12px; font-size: 12px; color: var(--muted-foreground); }
/* El celular lee la versión corta de los textos de arriba (.m-only); el escritorio, la larga (.d-only). */
.m-only { display: none; }
@media (max-width: 520px) {
  .d-only { display: none; }
  .m-only { display: revert; }
  .hero { gap: 40px; padding-top: 40px; padding-bottom: 56px; }
  .hero-text { gap: 18px; }
  .lead { font-size: 19px; line-height: 1.45; color: var(--foreground); }
  .perks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 16px; font-weight: 500; }
  .perks li { display: flex; align-items: center; gap: 10px; }
  .perk-icon {
    flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%;
    background: color-mix(in oklab, var(--primary) 14%, var(--background)); color: var(--primary);
    fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  }
  .cta { justify-items: stretch; gap: 10px; margin-top: 6px; }
  .cta .btn { height: 48px; }
}
/* Entrada del hero, una vez al cargar: los textos suben de a uno y después el video, como en las secciones.
   Por CSS y no con .armed: el JS llega después del primer cuadro y el hero ya se habría visto quieto. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; translate: 0 14px; } }
  @keyframes rise-shot { from { opacity: 0; translate: 0 32px; scale: 0.94; } }
  .hero-text > * { animation: rise 620ms var(--ease-out) both; }
  .hero-text > :nth-child(2) { animation-delay: 60ms; }
  .hero-text > :nth-child(3) { animation-delay: 120ms; }
  .hero-text > :nth-child(4) { animation-delay: 180ms; }
  .hero-text > :nth-child(5) { animation-delay: 240ms; }
  .hero-text > :nth-child(6) { animation-delay: 300ms; }
  .hero-video { animation: rise-shot 700ms var(--ease-out) 260ms both; }
}
@media (min-width: 960px) {
  /* Texto y video juntos al centro: con 1fr el texto se quedaba con todo el ancho sobrante y, en pantallas bajas
     (el video se achica con el alto), el video quedaba lejos del texto. */
  .hero { grid-template-columns: minmax(0, 34rem) auto; justify-content: center; gap: clamp(56px, 7vw, 112px); padding-top: 72px; padding-bottom: 112px; }
  /* Entra entero en la pantalla junto a la barra. */
  .hero-video { width: min(400px, calc((100svh - 140px) * 9 / 16)); }
}

/* Papelitos */
.note {
  position: absolute; z-index: 2; font: 16px/1.5 "Permanent Marker", "Comic Sans MS", cursive; color: var(--note-ink);
  background: var(--note-paper); box-shadow: var(--note-shadow); padding: 14px 16px;
}
.note p { display: flex; justify-content: space-between; gap: 16px; white-space: nowrap; }
.note-head { color: var(--note-red); }
.note-total { border-top: 2px solid var(--note-ink); margin-top: 4px; padding-top: 4px; }
.struck { text-decoration: line-through 2px var(--note-red); }
.note-ruled {
  padding-left: 36px;
  background:
    linear-gradient(to right, transparent 26px, var(--note-margin) 26px 28px, transparent 28px),
    repeating-linear-gradient(to bottom, transparent 0 23px, var(--note-rule) 23px 24px) 0 14px / 100% calc(100% - 14px) no-repeat,
    var(--note-paper);
}
.note-sticky { background: var(--note-sticky); }
.note-grid { background: oklch(0.99 0.005 95); padding: 0; font-size: 14px; }
.note-grid p { padding: 6px 12px; border-bottom: 1px solid var(--note-rule); }
.note-grid p:last-child { border-bottom: 0; }
.note-grid p span:first-child { padding-right: 12px; border-right: 1px solid var(--note-rule); min-width: 9.5em; }
.note s { text-decoration: line-through 2px var(--note-red); }
.note-calendar { background: oklch(0.99 0.005 95); padding: 0 0 12px; font-size: 14px; line-height: 1.6; }
.note-calendar .note-head { background: var(--note-red); color: oklch(0.98 0.01 95); padding: 6px 14px; }
.note-calendar ol { list-style: none; display: grid; grid-template-columns: repeat(7, 1.9em); gap: 2px; padding: 8px 12px 6px; font-family: Geist, sans-serif; font-weight: 600; color: color-mix(in oklab, var(--note-ink) 80%, var(--note-paper)); }
.note-calendar li { text-align: center; }
.note-calendar .circled { color: var(--note-ink); border-radius: 50%; box-shadow: 0 0 0 2px var(--note-ink); }
.note-calendar > p { padding: 0 14px; }

/* Del papel a la pantalla */
.swap { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); border-top: 1px solid var(--border); }
.swap-note { margin-top: 8px; font-size: 14px; color: var(--muted-foreground); }
.swap-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; max-width: 22ch; padding-top: 72px; }
.row { display: grid; gap: 28px; padding: 56px 0 72px; }
.row-text { display: grid; gap: 10px; align-content: center; max-width: 30rem; }
h3 { font-size: 20px; line-height: 1.4; letter-spacing: -0.02em; }
.row-text p { color: var(--muted-foreground); }
.row-media { position: relative; padding-bottom: 56px; }
.row-media .note { left: 0; bottom: 0; rotate: -2.5deg; }
.row-flip .row-media .note { left: auto; right: 0; rotate: 2deg; }
@media (min-width: 960px) {
  .row { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; padding: 80px 0; }
  .row-flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .row-flip .row-text { order: 2; }
  .row-media { padding: 0 0 0 64px; }
  .row-flip .row-media { padding: 0 64px 0 0; }
  .row-media .note { bottom: -32px; }
}
@media (max-width: 520px) {
  /* En el celular van capturas del celular (<source> de 520px), recortadas a lo de arriba. */
  .shot { aspect-ratio: 390 / 560; object-fit: cover; object-position: 0 0; }
  .note { font-size: 12px; padding: 10px 12px; }
  /* El papelito cuelga debajo de la captura y solo pisa su borde, no los datos. */
  .row-media { display: flex; flex-direction: column; padding-bottom: 0; }
  .row-media .note { position: relative; order: 2; inset: auto; margin-top: -20px; align-self: flex-start; }
  .row-flip .row-media .note { align-self: flex-end; }
  .note-grid p { padding: 4px 10px; }
}

/* Servicio y cierre */
.service {
  display: grid; gap: 24px; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 40px auto 0; padding: 72px var(--gutter);
  border-top: 1px solid var(--border);
}
.service h2, .close h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; }
.service-body { display: grid; gap: 28px; max-width: 40rem; }
.fit { display: grid; gap: 20px; }
.fit dt { font-weight: 600; }
.fit dd { color: var(--muted-foreground); }
.fit-icon {
  display: block; width: 40px; height: 40px; margin-bottom: 12px; padding: 9px; border-radius: 10px;
  background: color-mix(in oklab, var(--primary) 14%, var(--background)); color: var(--primary);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.aside { font-size: 14px; color: var(--muted-foreground); }
@media (max-width: 520px) {
  .service { gap: 20px; margin-top: 0; padding-top: 56px; padding-bottom: 56px; }
  .service-body { gap: 16px; }
  .fit { gap: 10px; }
  .fit > div {
    display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
    padding: 14px 16px; border-radius: 12px; background: var(--shelf);
  }
  .fit-icon { grid-row: span 2; margin-bottom: 0; }
  .fit dt { line-height: 1.35; }
  .fit dd { font-size: 14px; line-height: 1.4; }
  .aside { font-size: 13px; }
}
@media (min-width: 960px) {
  .service { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
  .service-body { padding-left: 64px; }
  .fit { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
.close {
  display: grid; justify-items: center; gap: 16px; text-align: center;
  padding: 96px var(--gutter) 112px; background: var(--shelf);
}
.close > p:not(.close-mail) { color: var(--muted-foreground); max-width: 32rem; }
.close .btn { margin-top: 8px; }
.close-mail { font-size: 14px; color: var(--muted-foreground); }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 24px var(--gutter); font-size: 14px; color: var(--muted-foreground); border-top: 1px solid var(--border);
}
.foot nav { display: flex; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--foreground); }

/* Escenas al hacer scroll: cada sección se arma UNA vez al entrar (~1,3 s, por tiempo) y queda armada.
   Sin JS o con movimiento reducido no se arma (scroll.js no pone .armed): se ve terminada. */
.total-swap { display: inline-grid; }
.total-swap > * { grid-area: 1 / 1; text-align: right; }
.row-media { container-type: inline-size; }

.total-swap .q { opacity: 0; }
/* El remate del presupuesto: el total de la pantalla, en grande, al lado del "¿?" del papel. */
.lens {
  display: grid; justify-items: end; gap: 2px; position: absolute; z-index: 3; right: -12px; bottom: 9%;
  padding: 10px 16px; border-radius: 10px; font-variant-numeric: tabular-nums;
  background: color-mix(in oklab, var(--primary) 7%, var(--background));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 45%, transparent), 0 18px 36px -14px oklch(0.3 0.02 60 / 0.45);
}
.lens span { font-size: 12px; color: var(--muted-foreground); }
.lens strong { font-size: clamp(22px, 1.2rem + 1vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
@media (max-width: 520px) { .lens { bottom: 72px; right: 8px; } }

/* Dónde arranca el papel: grande y en el centro de la captura. */
.row-media .note { --from-x: calc(50cqw - 50%); --from-y: calc(-31.25cqw + 50% + 32px); --from-rot: -7deg; }
.row-flip .row-media .note { --from-x: calc(-50cqw + 50%); --from-rot: 6deg; }
@media (max-width: 959px) { .row-media .note { --from-y: calc(-31.25cqw + 50% + 56px); } }
/* En el celular el papelito cuelga debajo del clip (16:10, alto 62,5cqw) y sube 20px: arranca centrado sobre el clip. */
@media (max-width: 520px) { .row-media .note { --from-y: calc(-31.25cqw + 20px - 50%); } }

/* Estado "todavía no se vio". Solo existe con .armed (lo pone el JS). */
.armed .row:not(.played) .shot { opacity: 0; translate: 0 32px; scale: 0.94; }
.armed .row:not(.played) .row-media .note { translate: var(--from-x) var(--from-y); scale: 1.35; rotate: var(--from-rot); }
.armed .row:not(.played) .row-text > * { opacity: 0; translate: 0 14px; }
.armed .row-quote:not(.solved) .total-swap .real { opacity: 0; }
.armed .row-quote:not(.solved) .total-swap .q { opacity: 1; }
.armed .row-quote:not(.solved) .lens { opacity: 0; scale: 0.7; translate: 24px 12px; }
.armed .row:not(.played) .note s { background-size: 0 2px; }
.armed .row:not(.played) .note-calendar .circled { box-shadow: 0 0 0 2px transparent; scale: 0.6; }
.armed .swap:not(.played) > :is(.swap-title, .swap-note) { opacity: 0; translate: 0 14px; }

/* La escena. Duraciones y retrasos en un solo lugar. */
.armed .shot { transition: opacity 450ms var(--ease-out), translate 700ms var(--ease-out), scale 700ms var(--ease-out); }
.armed .row-media .note { transition: translate 750ms var(--ease-out) 300ms, scale 750ms var(--ease-out) 300ms, rotate 750ms var(--ease-out) 300ms; }
.armed .row-text > * { transition: opacity 620ms var(--ease-out) 380ms, translate 620ms var(--ease-out) 380ms; }
.armed .row-text > :nth-child(2) { transition-delay: 440ms; }
.armed .total-swap > * { transition: opacity 200ms var(--ease-out) 1000ms; }
.armed .lens { transition: opacity 300ms var(--ease-out) 950ms, scale 450ms var(--ease-out) 950ms, translate 450ms var(--ease-out) 950ms; }
.armed .swap > :is(.swap-title, .swap-note) { transition: opacity 620ms var(--ease-out), translate 620ms var(--ease-out); }
.armed .swap > .swap-note { transition-delay: 60ms; }
/* Tachaduras de birome que se trazan, y círculos que se marcan, uno tras otro. */
.note s { text-decoration: none; background: linear-gradient(var(--note-red), var(--note-red)) no-repeat 0 55% / 100% 2px; }
.armed .note s { transition: background-size 260ms var(--ease-out) 950ms; }
.armed .note s + s { transition-delay: 1150ms; }
.armed .note-calendar .circled { transition: box-shadow 220ms var(--ease-out) 950ms, scale 220ms var(--ease-out) 950ms; }
.armed .note-calendar .circled + .circled { transition-delay: 1080ms; }
.armed .note-calendar .circled + .circled + .circled { transition-delay: 1210ms; }
/* Lo que ya pasó de largo al cargar (recarga a mitad de página, #contacto) aparece armado, sin escena. */
.instant, .instant * { transition: none !important; }

/* Flechas a mano entre textos (las agrega el JS, solo en escritorio). */
.swap { position: relative; }
.trail { opacity: 0.9; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 4; }
.trail path { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trail .head { opacity: 0; transition: opacity 400ms var(--ease-out); }
.trail .head.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .trail .head { transition: none; } }

/* Clips de la app en uso: en lugar de la captura, solo con movimiento. En el celular, los mismos, enteros
   (pisa el recorte de las capturas de celular); un clip grabado a lo ancho del celular se descartó (rama prototype/landing-movil). */
.clip { display: none; }
.armed .clip { display: block; aspect-ratio: 1440 / 900; }
.armed .row-media:has(.clip) picture { display: none; }
/* El clip ya termina con el total de cerca: la tarjeta repetida se le encima. */
.armed .row-media:has(.clip) .lens { display: none; }
/* El total del presupuesto se revela cuando el clip termina de armarlo. */
.armed .late :is(.lens, .total-swap > *) { transition-delay: 100ms; }
