:root {
  --bg: #F3ECDD;
  --paper: #FAF5E8;
  --shot: #FFFDF6;
  --ink: #2A1F18;
  --muted: #5E4F44;
  --line: #D9CCB0;
  --field: #8A7758;
  --burgundy: #6B231C;
  --gold: #D9A94A;
  --on-gold: #2A1F18;
  --violet: #6A4C9C;
  --btn-bg: #6B231C;
  --btn-ink: #FBF3E2;
  --focus: #6A4C9C;
  --ok: #2F6B3A;
  --err: #A32A1E;
  --band-bg: #6B231C;
  --band-ink: #F6EBD3;
  --band-accent: #E9BE62;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1310;
    --paper: #241A15;
    --shot: #33261F;
    --ink: #F1E8D6;
    --muted: #BDAF9B;
    --line: #43342B;
    --field: #8F7B6B;
    --burgundy: #E9B9A6;
    --gold: #D9A94A;
    --violet: #B9A0E6;
    --btn-bg: #D9A94A;
    --btn-ink: #24150F;
    --focus: #D9A94A;
    --ok: #8FD19B;
    --err: #FF9A8C;
    --band-bg: #0E0907;
    --band-ink: #F1E8D6;
    --band-accent: #D9A94A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--violet); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* El oro del cofre: subrayado a mano */
.gold-line {
  background: linear-gradient(var(--gold), var(--gold)) 0 94% / 100% .14em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding-bottom: .05em;
}

/* Cabecera */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--wrap); margin: 0 auto; padding: 12px 16px;
}
.brand { text-decoration: none; color: var(--burgundy); }
.brand-word { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; letter-spacing: .01em; }
.langs { display: inline-flex; gap: 2px; }
.lang-btn {
  font: 600 .85rem var(--sans); letter-spacing: .06em; color: var(--muted);
  background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  padding: 8px 8px 5px; min-height: 44px; min-width: 44px; cursor: pointer;
}
.lang-btn[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--gold); }

/* Hero */
.hero {
  max-width: var(--wrap); margin: 0 auto; padding: 12px 16px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
}
.headline {
  margin: 0; font-family: var(--serif); font-weight: 700; color: var(--burgundy);
  font-size: clamp(2.6rem, 12.5vw, 7rem); line-height: 1; letter-spacing: -.025em;
}
.hl-a, .hl-b { display: block; }
.hl-b { margin-top: .04em; }
.hero-icon-wrap { justify-self: end; margin: 16px 6px 0 0; }
.hero-icon {
  display: block; width: min(38vw, 160px); height: auto; border-radius: 22.5%;
  transform: rotate(4deg);
  box-shadow: 0 26px 36px -22px rgba(60, 20, 10, .6);
}
.hero-copy { max-width: 560px; margin-top: 8px; }
.tagline {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.2rem, 4.4vw, 1.6rem); line-height: 1.3; margin: 0 0 16px; max-width: 18em;
}
.lead { color: var(--muted); margin: 0 0 26px; max-width: 54ch; }

/* Formulario */
.form { max-width: 540px; }
.form-row { display: flex; flex-direction: column; gap: 10px; }
input[type="email"] {
  width: 100%; min-height: 52px; font: 400 1rem var(--sans); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--field); border-radius: 10px; padding: 0 16px;
}
input[type="email"]::placeholder { color: var(--muted); opacity: .85; }
input[aria-invalid="true"] { border-color: var(--err); }
.btn {
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  font: 600 1rem var(--sans); color: var(--btn-ink); background: var(--btn-bg);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .7; cursor: progress; }
/* Plataforma: dos casillas ligeras junto al email */
.platforms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 0; }
.plat-label { font-size: .92rem; color: var(--muted); margin-right: 2px; }
.pchip { position: relative; display: inline-flex; }
.pchip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pchip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
  border: 1.5px solid var(--field); border-radius: 10px; background: var(--paper); color: var(--ink);
  font-weight: 500; font-size: .98rem; cursor: pointer; transition: background-color .15s ease, border-color .15s ease;
}
.pchip span::before {
  content: ""; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--field); background: transparent;
  flex: none; transition: background-color .15s ease;
}
.pchip input:checked + span { border-color: var(--burgundy); background: color-mix(in srgb, var(--gold) 26%, var(--paper)); }
.pchip input:checked + span::before {
  border-color: var(--burgundy); background-color: var(--burgundy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%23FBF3E2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.pchip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  .pchip input:checked + span { border-color: var(--gold); }
  .pchip input:checked + span::before {
    border-color: var(--gold); background-color: var(--gold);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%2324150F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
@media (prefers-reduced-motion: reduce) { .pchip span, .pchip span::before { transition: none; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.6em; margin: 8px 2px 0; font-weight: 600; font-size: .98rem; }
.form-msg.is-ok { color: var(--ok); }
.form-msg.is-error { color: var(--err); }
.form-msg.is-ok .who b { color: var(--ink); }
.soon { margin: 6px 0 8px; font-weight: 500; max-width: 46ch; }
.micro { margin: 6px 2px 0; font-size: .86rem; color: var(--muted); max-width: 52ch; }

/* El dragon firma lo que dice: avatar en linea + nombre, sin burbuja */
.who { white-space: nowrap; }
.av { width: 30px; height: 30px; border-radius: 50%; vertical-align: -9px; margin-right: 7px; }
/* Kip asoma por encima de lo que dice, agarrado con las patas a una linea fina (no es un avatar recortado) */
.says { position: relative; border-top: 1.5px solid var(--line); padding-top: 12px; margin-top: 56px; }
.says .av { position: absolute; left: 4px; top: calc(-1.5px - 45px); width: 101px; height: 47px; border-radius: 0; margin: 0; vertical-align: 0; }
.scenes-lead.says .av { width: 123px; height: 57px; top: calc(-1.5px - 55px); }
.scenes-lead.says { margin-top: 68px; }
.who b { font-family: var(--sans); font-style: normal; font-weight: 600; font-size: .92em; letter-spacing: .01em; color: inherit; }
.scenes-lead .who b { font-size: .68em; }

/* Titulares de seccion */
.h2 {
  margin: 0; font-family: var(--serif); font-weight: 700; color: var(--burgundy);
  font-size: clamp(2.2rem, 8vw, 4.4rem); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance;
}
.h2-sm { font-size: clamp(1.7rem, 4.4vw, 2.5rem); letter-spacing: -.01em; }

/* Escenas */
.scenes { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 72px; }
.scenes-head { margin-bottom: 20px; }
.scenes-lead {
  margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  color: var(--muted); max-width: 26em; line-height: 1.35;
}
.scene { display: grid; gap: 26px; padding: 44px 0; border-top: 1px solid var(--line); }
.kicker { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.05rem; color: var(--violet); }
.scene h3 {
  margin: 0 0 12px; font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: clamp(1.8rem, 5.6vw, 2.7rem); line-height: 1.06; letter-spacing: -.015em; text-wrap: balance;
}
.scene-text > p:last-child { margin: 0; color: var(--muted); max-width: 40ch; }

.demo {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 20px 18px;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--gold) 55%, transparent);
  min-width: 0;
}

/* Demo 1: busqueda dentro de la imagen */
.search {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
  background: var(--bg); border: 1.5px solid var(--field); font-size: 1.15rem;
}
.search-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--violet); stroke-width: 2.2; stroke-linecap: round; }
.typed { display: inline-block; }
.caret { width: 2px; height: 1.25em; background: var(--violet); margin-left: -8px; }
.found { margin-top: 18px; }
.paper-note {
  background: var(--shot); border: 1px dashed var(--field); padding: 16px 18px; transform: rotate(-1.2deg);
  font-family: var(--mono); font-size: .95rem; line-height: 1.5;
}
.paper-note p { margin: 0; }
.pn-1 { font-weight: 600; }
.pn-2 { color: var(--muted); }
mark {
  color: var(--on-gold); padding: 0 .2em; border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold)) left / 100% 100% no-repeat;
}
.found-cap { margin: 12px 0 0; font-size: .84rem; color: var(--muted); }
.fname { font-family: var(--mono); color: var(--ink); margin-right: 6px; }

/* Demo 2: reglas como frases */
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.rules li:first-child { padding-top: 0; }
.rules li:last-child { border-bottom: 0; padding-bottom: 0; }
.rule { margin: 0; font-size: 1.08rem; line-height: 1.5; }
.arr { color: var(--violet); margin: 0 .25em; }
.to {
  font-weight: 600; color: var(--burgundy); white-space: nowrap;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% .16em no-repeat;
  padding-bottom: .05em;
}
.drop { margin: 6px 0 0; font-family: var(--mono); font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }

/* Demo 3: entrada y recordatorio */
.ticket {
  position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr);
  background: var(--shot); border: 1px solid var(--field); border-radius: 4px; transform: rotate(-.8deg);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; left: 37px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--field);
}
.ticket::before { top: -10px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
.tk-file {
  margin: 0; padding: 12px 0; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  font-family: var(--mono); font-size: .78rem; color: var(--muted); border-left: 2px dashed var(--field);
}
.tk-title, .tk-when { grid-column: 2; margin: 0; }
.tk-title { grid-row: 1; align-self: start; padding: 16px 16px 2px 18px; font-family: var(--serif); font-weight: 600; font-size: 1.35rem; line-height: 1.15; }
.tk-when { grid-row: 2; padding: 0 16px 16px 18px; font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.tk-file { grid-row: 1 / span 2; grid-column: 1; }
.reminder { margin: 20px 0 0 6px; }
.rem-label { margin: 0; font-family: var(--serif); font-style: italic; font-size: .98rem; color: var(--violet); }
.rem-text { margin: 2px 0 0; font-size: 1.08rem; }

/* Privacidad como declaracion */
.manifesto {
  background: var(--band-bg); color: var(--band-ink);
  border-block: 6px solid var(--gold); padding: 64px 16px 68px;
}
.mf-inner { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 36px; }
.mf-title { margin: 0; font-family: var(--serif); font-weight: 700; line-height: .98; letter-spacing: -.03em; }
.mf-a { display: block; font-size: clamp(1.4rem, 5vw, 2.4rem); font-style: italic; font-weight: 500; letter-spacing: -.01em; margin-bottom: .1em; }
.mf-b { display: block; font-size: clamp(5rem, 27vw, 12.5rem); color: var(--band-accent); }
.mf-lead { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; opacity: .85; }
.mf-list { list-style: none; margin: 0; padding: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.25; }
.mf-list s { text-decoration-thickness: .1em; text-decoration-color: var(--band-accent); }
.mf-text { margin: 24px 0 0; max-width: 34ch; font-size: 1.08rem; opacity: .92; }

/* Importadores: una frase */
.bring { max-width: var(--wrap); margin: 0 auto; padding: 72px 16px 24px; }
.bring-text {
  margin: 0; max-width: 24em; font-family: var(--serif); font-weight: 500; line-height: 1.3;
  font-size: clamp(1.45rem, 4.4vw, 2.3rem);
}

/* FAQ editorial */
.faq { max-width: var(--wrap); margin: 0 auto; padding: 56px 16px 40px; }
.faq-grid { display: grid; gap: 26px; margin-top: 26px; }
.qa { border-top: 2px solid var(--ink); padding-top: 12px; }
.qa h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.qa p { margin: 0; color: var(--muted); max-width: 46ch; }
.qa-wide h3 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.qa-wide p { font-size: 1.12rem; color: var(--ink); }

/* Final con dragon */
.finale { max-width: var(--wrap); margin: 0 auto; padding: 56px 16px 0; }
.finale-inner { display: grid; gap: 28px; align-items: end; }
.finale-copy { padding-bottom: 36px; }
.finale-copy .h2 { font-size: clamp(2rem, 7vw, 3.6rem); margin-bottom: 22px; max-width: 12em; }
.peek { width: min(78vw, 380px); aspect-ratio: 1 / .66; overflow: hidden; justify-self: end; margin-right: 4px; }
.peek img { display: block; width: 100%; height: auto; border-radius: 22.5% 22.5% 0 0; }

/* Pie */
.foot { border-top: 4px solid var(--gold); padding: 26px 0 44px; }
.foot-links, .copy { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.foot-links a { padding: 8px 2px; }
.promo { max-width: var(--wrap); margin: 14px auto 0; padding-inline: 16px; font-size: .92rem; color: var(--muted); }
.copy { margin-top: 8px; color: var(--muted); font-size: .9rem; }

/* Privacidad */
.doc { max-width: 720px; margin: 0 auto; padding: 8px 16px 48px; }
.doc-title { font-family: var(--serif); font-weight: 700; color: var(--burgundy); font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1.05; margin: 8px 0 6px; }
.doc h2 { font-family: var(--serif); font-size: 1.3rem; margin: 28px 0 6px; padding-top: 10px; border-top: 2px solid var(--ink); }
.doc p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.back { display: inline-block; padding: 8px 0; }

/* Tablet y escritorio */
@media (min-width: 640px) {
  .form-row { flex-direction: row; }
  .btn { white-space: nowrap; }
  .faq-grid { grid-template-columns: 1fr 1fr; gap: 34px 56px; }
  .qa-wide { grid-column: 1 / -1; }
}
@media (min-width: 920px) {
  body { font-size: 1.125rem; }
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 56px; padding-bottom: 96px; }
  .headline { grid-column: 1 / -1; }
  .hero-copy { grid-column: 1; grid-row: 2; margin-top: 28px; }
  .hero-icon-wrap { grid-column: 2; grid-row: 2; justify-self: start; margin: 20px 0 0 40px; }
  .hero-icon { width: min(100%, 300px); transform: rotate(-3deg); }

  .scenes { padding-bottom: 104px; }
  .scenes-head { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; align-items: end; margin-bottom: 36px; }
  .scenes-lead { margin: 0 0 .5rem; }
  .scene { grid-template-columns: 5fr 6fr; gap: 80px; align-items: center; padding: 64px 0; }
  .scene-rules, .scene-remind { grid-template-columns: 6fr 5fr; }
  .scene-rules .scene-text, .scene-remind .scene-text { order: 2; }
  .scene-remind { padding-bottom: 8px; }
  .scene-ocr .demo { margin-right: 24px; }
  .scene-rules .demo { margin-left: 24px; }
  .demo { padding: 28px 28px; }

  .manifesto { padding: 96px 16px 104px; }
  .mf-inner { grid-template-columns: 7fr 5fr; gap: 56px; align-items: end; }
  .bring { padding: 112px 16px 40px; }
  .bring-text { margin-left: 16%; }
  .faq { padding-top: 88px; padding-bottom: 72px; }
  .faq-grid { margin-top: 36px; }
  .finale { padding-top: 40px; }
  .finale-inner { grid-template-columns: 6fr 5fr; gap: 56px; }
  .finale-copy { padding-bottom: 72px; }
  .peek { width: 100%; max-width: 420px; justify-self: start; margin-left: 40px; }
}

/* Animaciones (el estado final es el estado por defecto) */
@media (prefers-reduced-motion: no-preference) {
  .hero-icon { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .caret { animation: blink 1.1s steps(1) infinite; }

  .js .scene:not(.in) .typed { clip-path: inset(0 100% 0 0); }
  .js .scene:not(.in) .found,
  .js .scene:not(.in) .drop,
  .js .scene:not(.in) .ticket,
  .js .scene:not(.in) .reminder { opacity: 0; }
  .js .scene:not(.in) mark { background-size: 0% 100%; }
  .js .scene:not(.in) .to { background-size: 0% .16em; }

  .scene.in .typed { animation: type .8s steps(4, end) .3s both; }
  .scene.in .found { animation: fade-up .6s ease 1.3s both; }
  .scene.in mark { animation: mark-in .5s ease 1.9s both; }

  .scene.in .drop { animation: slide-in .6s cubic-bezier(.2, .8, .2, 1) calc(.3s + var(--i, 0) * .2s) both; }
  .scene.in .rules li:nth-child(1) .drop { animation-delay: .3s; }
  .scene.in .rules li:nth-child(2) .drop { animation-delay: 1.2s; }
  .scene.in .rules li:nth-child(3) .drop { animation-delay: 2.1s; }
  .scene.in .rules li:nth-child(1) .to { animation: line-in .5s ease .8s both; }
  .scene.in .rules li:nth-child(2) .to { animation: line-in .5s ease 1.7s both; }
  .scene.in .rules li:nth-child(3) .to { animation: line-in .5s ease 2.6s both; }

  .scene.in .ticket { animation: fade-up .6s ease .2s both; }
  .scene.in .reminder { animation: fade-up .6s ease 1.1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) rotate(4deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes mark-in { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes line-in { from { background-size: 0% .16em; } to { background-size: 100% .16em; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
.form-msg .av { width: 44px; height: 20px; border-radius: 0; vertical-align: -3px; }
/* Hueco para que Kip asome sobre su linea tambien donde otras reglas fijan el margen */
.scene-text > p.says:last-child, .qa p.says, p.mf-text.says { margin-top: 56px; }
.mf-text.says { border-top-color: currentColor; }
