/* Traza Contable · landing. Tokens de DESIGN.md (tinta y papel, verde sello, un solo azul de acción). */

@font-face {
  font-family: 'Fraunces Variable';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Variable';
  src: url('/fonts/plex-sans.woff2') format('woff2');
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plex-mono.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #0e1a24;
  --ink-soft: #17252f;
  --ink-line: #24333f;
  --paper: #faf8f4;
  --fondo: #f1f0ec;
  --superficie: #ffffff;
  --linea: #e2e0da;
  --linea-fuerte: #8a877f;
  --texto: #0e1a24;
  --texto-suave: #3d4a55;
  --texto-tenue: #5f6b75;
  --accion: #2563eb;
  --accion-900: #1d4ed8;
  --sello: #0f6b5c;
  --sello-claro: #3ddc97;
  --sobre-tinta: rgb(255 255 255 / 78%);

  --display: 'Fraunces Variable', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans Variable', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --control: 6px;
  --tarjeta: 8px;
  --salida: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sello); color: #fff; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }

/* Foco: anillo doble sobre papel, contorno blanco sobre tinta (DESIGN.md). */
:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accion); border-radius: var(--control); }
.tinta :focus-visible, .portada :focus-visible { box-shadow: none; outline: 2px solid #fff; outline-offset: 3px; }
@media (forced-colors: active) { :focus-visible { outline: 2px solid Highlight; } }

.salto {
  position: absolute; left: 16px; top: -64px; z-index: 10;
  background: var(--superficie); color: var(--texto);
  padding: 10px 14px; border-radius: var(--control);
}
.salto:focus { top: 16px; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.contenedor { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.contenedor-angosto { max-width: 820px; }

/* El renglón del libro mayor: textura de la identidad. */
.reglado {
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, rgb(255 255 255 / 5%) 39px, rgb(255 255 255 / 5%) 40px);
}

/* ---------- Marca ---------- */
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.signo { width: 32px; height: 32px; color: var(--ink-soft); }
.marca-texto { font-family: var(--display); font-size: 1.375rem; letter-spacing: -0.025em; line-height: 1; font-optical-sizing: auto; }
.marca-texto b { font-weight: 600; }
.marca-texto span { font-weight: 300; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border-radius: var(--control); border: 1px solid transparent;
  font: 500 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
.boton-primario { background: var(--accion); color: #fff; }
.boton-primario:hover { background: var(--accion-900); }
.boton-secundario { background: var(--superficie); color: var(--texto); border-color: var(--linea-fuerte); }
.boton-secundario:hover { background: var(--fondo); }
.boton-grande { min-height: 56px; padding: 0 36px; font-size: 1.125rem; }

.enlace-flecha {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 500; text-decoration: none; padding: 12px 4px;
}
.enlace-flecha svg { width: 24px; height: 12px; transition: transform 200ms var(--salida); }
.enlace-flecha:hover svg { transform: translateX(6px); }
.enlace-flecha:hover { text-decoration: underline; }

/* ---------- Portada ---------- */
.portada { background-color: var(--ink); color: #fff; padding-bottom: 96px; }
.barra { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 0; }
.barra-enlaces { display: flex; align-items: center; gap: 28px; font-size: 0.9375rem; }
.barra-enlaces a { color: var(--sobre-tinta); text-decoration: none; padding: 0 2px; min-height: 44px; display: inline-flex; align-items: center; }
.barra-enlaces a:hover { color: #fff; }
.barra-enlaces .entrar { color: #fff; border: 1px solid rgb(255 255 255 / 40%); border-radius: var(--control); padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; }
.barra-enlaces .entrar:hover { border-color: #fff; }

.portada-cuerpo {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 72px; align-items: center; padding-top: clamp(56px, 9vw, 112px);
}
h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.5rem, 5.6vw, 4.75rem); line-height: 1.04; letter-spacing: -0.03em;
  font-optical-sizing: auto; text-wrap: balance;
}
.entrada { margin-top: 28px; max-width: 54ch; font-size: 1.25rem; line-height: 1.55; color: var(--sobre-tinta); }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; margin-top: 40px; }
.nota-portada { margin-top: 20px; font-size: 0.9375rem; color: var(--sobre-tinta); }

/* El asiento de ejemplo: papel sobre tinta. */
.asiento figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--sobre-tinta); }
.hoja {
  background: var(--paper); color: var(--texto);
  border: 1px solid var(--linea); border-radius: var(--tarjeta);
  padding: 24px;
}
.hoja-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--linea); }
.hoja-titulo { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; }
.hoja-titulo span { display: block; font-weight: 400; color: var(--texto-suave); }
.hoja-moneda { font-size: 0.8125rem; color: var(--texto-tenue); }
.hoja table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.hoja th, .hoja td { padding: 11px 0; text-align: left; border-bottom: 1px solid var(--linea); font-weight: 400; }
.hoja thead th { font-size: 0.8125rem; font-weight: 500; color: var(--texto-suave); }
.hoja .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; padding-left: 12px; white-space: nowrap; }
.hoja tfoot th { font-weight: 600; }
.hoja tfoot th, .hoja tfoot td { border-bottom: 0; border-top: 1px solid var(--linea-fuerte); }
.sello-estado {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 0.9375rem; font-weight: 600; color: var(--sello);
}
.sello-estado svg { width: 20px; height: 20px; flex: none; }

/* Un solo momento de movimiento: las líneas se asientan y el sello llega al final. */
@keyframes asentar { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sellar { from { opacity: 0; transform: scale(1.18); } to { opacity: 1; transform: none; } }
.portada-texto { animation: asentar 700ms var(--salida) both; }
.hoja { animation: asentar 700ms var(--salida) 120ms both; }
.fila { animation: asentar 520ms var(--salida) both; }
.f1 { animation-delay: 380ms; } .f2 { animation-delay: 500ms; } .f3 { animation-delay: 620ms; } .f4 { animation-delay: 740ms; }
.sello-estado { animation: sellar 420ms var(--salida) 1000ms both; transform-origin: left center; }

/* ---------- Secciones ---------- */
.seccion { padding: clamp(72px, 10vw, 128px) 0; }
.papel { background: var(--paper); }
.fondo { background: var(--fondo); }
.tinta { background-color: var(--ink); color: #fff; }
h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -0.025em;
  font-optical-sizing: auto; text-wrap: balance; max-width: 22ch;
}
.intro { margin-top: 20px; max-width: 60ch; font-size: 1.1875rem; color: var(--texto-suave); }
.tinta .intro { color: var(--sobre-tinta); }

/* Hoy / Traza: dos columnas separadas por línea, como un libro a dos haberes. */
.pares { margin-top: 56px; border-top: 1px solid var(--linea-fuerte); }
.par { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; padding: 28px 0; border-bottom: 1px solid var(--linea); }
.par p { max-width: 46ch; }
.par-cabecera { padding: 14px 0; border-bottom: 1px solid var(--linea); }
.par-cabecera p { font-size: 0.9375rem; font-weight: 500; color: var(--texto-tenue); }
.par .hoy { color: var(--texto-suave); }
.par .traza { font-weight: 500; }

/* Ejes */
.ejes { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 64px; border-top: 1px solid var(--linea-fuerte); }
.ejes article { padding: 32px 32px 0 0; }
.ejes article + article { padding-left: 32px; border-left: 1px solid var(--linea); }
.ejes h3 { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; font-optical-sizing: auto; }
.ejes p { margin-top: 16px; color: var(--texto-suave); max-width: 38ch; }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 56px; }
.video-principal { grid-column: 1 / -1; }
.video { position: relative; }
.video-boton, .video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--ink-line); border-radius: var(--tarjeta); background: var(--ink-soft);
}
.video-boton {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: #fff; font: inherit; cursor: pointer; padding: 24px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--ink-line) 31px, var(--ink-line) 32px);
  transition: border-color 150ms;
}
.video-boton:hover { border-color: var(--sello-claro); }
.play { width: 64px; height: 64px; color: var(--sello-claro); transition: transform 250ms var(--salida); }
.video-boton:hover .play { transform: scale(1.08); }
.video-titulo { font-family: var(--display); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.02em; text-align: center; }
.video-principal .video-titulo { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.video-enlace { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: 0.9375rem; color: var(--sobre-tinta); }
.video-enlace:hover { color: #fff; }

/* Planes */
.planes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; align-items: stretch; }
.plan { display: flex; flex-direction: column; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--tarjeta); padding: 32px; }
.plan h3 { font-family: var(--display); font-weight: 600; font-size: 1.75rem; letter-spacing: -0.02em; font-optical-sizing: auto; }
.precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 20px; }
.cifra { font-family: var(--display); font-weight: 400; font-size: clamp(3.5rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.04em; font-optical-sizing: auto; font-variant-numeric: lining-nums; }
.unidad { font-size: 0.9375rem; color: var(--texto-suave); }
.plan dl { margin: 28px 0 32px; border-top: 1px solid var(--linea); flex: 1; }
.plan dl > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); font-size: 0.9375rem; }
.plan dt { color: var(--texto-tenue); }
.plan dd { font-weight: 500; }
.plan .boton { width: 100%; }
.notas-precio { margin-top: 32px; display: grid; gap: 6px; color: var(--texto-suave); font-size: 0.9375rem; }

/* Calculadora */
.enlace-calculadora { margin-top: 20px; }
.calculadora { margin-top: 72px; padding: 40px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--tarjeta); scroll-margin-top: 24px; }
.calculadora h3 { font-family: var(--display); font-weight: 500; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.15; font-optical-sizing: auto; }
.calc-intro { margin-top: 10px; color: var(--texto-suave); max-width: 60ch; }
.calc-campos { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 20px; margin-top: 28px; align-items: end; }
.calc-campos label { display: grid; gap: 8px; font-size: 0.9375rem; font-weight: 500; color: var(--texto-suave); }
.calc-campos input, .calc-campos select {
  width: 100%; min-height: 48px; padding: 0 12px;
  font: 400 1rem/1.2 var(--sans); color: var(--texto); background: var(--superficie);
  border: 1px solid var(--linea-fuerte); border-radius: var(--control);
}
.calc-campos input { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.calc-campos input:focus-visible, .calc-campos select:focus-visible { border-color: var(--accion); box-shadow: 0 0 0 1px var(--superficie), 0 0 0 3px var(--accion); }
.calc-resultado { margin-top: 28px; }
.calc-resultado table { width: 100%; border-collapse: collapse; }
.calc-resultado th, .calc-resultado td { padding: 16px 0; text-align: left; font-weight: 400; border-bottom: 1px solid var(--linea); vertical-align: top; }
.calc-resultado thead th { padding: 10px 0; font-size: 0.875rem; font-weight: 500; color: var(--texto-tenue); border-bottom-color: var(--linea-fuerte); }
.calc-resultado tbody th { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.015em; font-optical-sizing: auto; }
.calc-resultado .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 16px; }
.calc-resultado thead .num { font-family: var(--sans); }
.calc-sub { display: block; margin-top: 2px; font: 400 0.8125rem/1.35 var(--sans); letter-spacing: 0; color: var(--texto-tenue); }
.calc-mejor .calc-sub { color: var(--sello); font-weight: 600; }
.calc-descartado th, .calc-no { color: var(--texto-tenue); }
.calc-no { font-size: 0.9375rem; text-align: left; }
.calc-aviso { color: var(--texto-suave); }
.calc-nota { margin-top: 20px; font-size: 0.875rem; color: var(--texto-tenue); }

/* Preguntas */
.faq { margin-top: 48px; border-top: 1px solid var(--linea-fuerte); }
details { border-bottom: 1px solid var(--linea-fuerte); }
summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-family: var(--display); font-weight: 500; font-size: 1.375rem; letter-spacing: -0.015em; line-height: 1.3;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 10px; height: 10px; margin-top: -8px;
  border-right: 2px solid var(--texto); border-bottom: 2px solid var(--texto); transform: rotate(45deg);
  transition: transform 200ms var(--salida);
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { padding: 0 40px 24px 0; max-width: 62ch; color: var(--texto-suave); }

/* Cierre */
.cierre { text-align: left; }
.cierre .boton { margin-top: 36px; }

/* Pie */
.pie { background: var(--ink); color: var(--sobre-tinta); padding: 32px 0 40px; border-top: 1px solid var(--ink-line); font-size: 0.9375rem; }
.pie-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.pie a { color: var(--sobre-tinta); display: inline-flex; align-items: center; min-height: 44px; }
.pie a:hover { color: #fff; }
.marca-pie .marca-texto { font-size: 1.125rem; color: #fff; }

/* ---------- Pantallas estrechas ---------- */
@media (max-width: 960px) {
  .portada-cuerpo { grid-template-columns: 1fr; gap: 48px; }
  .ejes { grid-template-columns: 1fr; }
  .ejes article, .ejes article + article { padding: 28px 0; border-left: 0; border-bottom: 1px solid var(--linea); }
  .planes { grid-template-columns: 1fr; }
  .par { grid-template-columns: 1fr; gap: 10px; }
  .par-cabecera { display: none; }
  .par .hoy::before { content: 'Hoy · ' / ''; font-weight: 500; color: var(--texto-tenue); }
  .par .traza::before { content: 'Con Traza · ' / ''; font-weight: 500; color: var(--sello); }
  .videos { grid-template-columns: 1fr; }
  .calc-campos { grid-template-columns: 1fr 1fr; }
  .calc-campos label:last-child { grid-column: 1 / -1; }
  .calculadora { padding: 28px; }
}
@media (max-width: 560px) {
  .calc-resultado thead { display: none; }
  .calc-resultado table, .calc-resultado tbody { display: block; }
  .calc-resultado tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 16px 0; border-bottom: 1px solid var(--linea); }
  .calc-resultado th, .calc-resultado td { padding: 0; border: 0; }
  .calc-resultado tbody th { grid-column: 1 / -1; }
  .calc-resultado .num { text-align: left; padding-left: 0; }
  .calc-resultado td.num::before { content: attr(data-etq); display: block; font: 400 0.8125rem/1.35 var(--sans); color: var(--texto-tenue); }
  .calc-no { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .contenedor { padding: 0 16px; }
  .barra-enlaces { gap: 14px; }
  .barra-enlaces li:first-child, .barra-enlaces li:nth-child(2) { display: none; }
  .plan { padding: 24px; }
  .acciones .boton { width: 100%; }
  .hoja { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
