/* Rader · rader.es — hoja única. Tokens → base → layout → componentes → demo → utilidades. */

@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #F8FAFC;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #556477;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --navy: #0F172A;
  --navy-2: #172238;
  --navy-3: #1E2A44;
  --navy-line: rgb(248 250 252 / 0.1);
  --on-navy: #F8FAFC;
  --on-navy-2: #AEBBD0;
  --cyan: #22D3EE;
  --cyan-ink: #0E7490;
  --cyan-wash: #E6FAFD;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step-display: clamp(2.3rem, 1.5rem + 3.9vw, 4.4rem);
  --step-h1: clamp(2.25rem, 1.6rem + 2.7vw, 3.6rem);
  --step-h2: clamp(1.8rem, 1.35rem + 1.8vw, 2.75rem);
  --step-h3: clamp(1.2rem, 1.1rem + 0.35vw, 1.4rem);
  --step-lead: clamp(1.125rem, 1.03rem + 0.4vw, 1.325rem);

  --gutter: clamp(20px, 5vw, 48px);
  --max: 1200px;
  --section: clamp(72px, 9vw, 128px);
  --radius: 10px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 560; line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
p, li, dd { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--cyan-ink); outline-offset: 3px; border-radius: 4px; }
.on-navy :focus-visible { outline-color: var(--cyan); }
::selection { background: var(--cyan); color: var(--navy); }
abbr { text-decoration: none; }
strong { font-weight: 620; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--navy); color: var(--on-navy); border-radius: var(--radius); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section + .section:not(.on-navy) { border-top: 1px solid var(--line); }
.on-navy { background: var(--navy); color: var(--on-navy); }
.on-navy + .section { border-top: 0; }

/* Marca: el trazo inclinado del monograma como marcador */
.slash { display: inline-block; width: 0.8em; height: 0.62em; background: var(--cyan); clip-path: polygon(0 0, 40% 0, 100% 100%, 60% 100%); flex: none; }

.eyebrow { display: inline-flex; align-items: center; gap: 0.6em; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; color: var(--cyan-ink); }
.on-navy .eyebrow { color: var(--cyan); }
.num { font: 400 0.8125rem/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.on-navy .num { color: var(--on-navy-2); }

.lead { font-size: var(--step-lead); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.on-navy .lead { color: var(--on-navy-2); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 20px; align-content: start; }
.h2 { font-size: var(--step-h2); max-width: 16ch; }
.statement { font-size: var(--step-lead); line-height: 1.45; color: var(--ink); }
.mb-m { margin-bottom: 24px; }
.mt-s { margin-top: 18px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 32px; }

/* Encabezado de sección */
.head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 60rem; }
.head h2 { font-size: var(--step-h2); max-width: 22ch; }
.head--split { max-width: none; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .head--split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: 64px; }
  .head--split .lead { justify-self: end; }
}

/* Botones */
.btn {
  --bg: var(--navy); --fg: var(--on-navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--bg); color: var(--fg); font: 600 1rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { --bg: #1B2740; }
.btn:active { transform: translateY(1px); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { --bg: var(--surface); border-color: var(--ink); }
.on-navy .btn { --bg: var(--cyan); --fg: var(--navy); }
.on-navy .btn:hover { --bg: #67E8F9; }
.on-navy .btn--ghost { --bg: transparent; --fg: var(--on-navy); border-color: rgb(248 250 252 / 0.28); }
.on-navy .btn--ghost:hover { --bg: rgb(248 250 252 / 0.06); border-color: var(--on-navy); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; }
.link::after { content: "→"; transition: transform 0.2s var(--ease); }
.link:hover { color: var(--cyan-ink); }
.link:hover::after { transform: translateX(3px); }
.on-navy .link { color: var(--on-navy); }
.on-navy .link:hover { color: var(--cyan); }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(248 250 252 / 0.86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { display: block; flex: none; }
.brand img { width: 108px; height: auto; }
.nav { margin-left: auto; }
.nav ul { display: flex; align-items: center; gap: 4px; padding: 0; list-style: none; }
.nav a { display: block; white-space: nowrap; padding: 10px 12px; border-radius: 8px; color: var(--ink-2); font-size: 0.9688rem; font-weight: 500; text-decoration: none; transition: color 0.15s, background-color 0.15s; }
.nav a:hover { color: var(--ink); background: rgb(15 23 42 / 0.05); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--cyan-ink); border-radius: 0; }
.header-cta { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }
.menu-btn { display: none; }

@media (max-width: 1179px) {
  .site-header .wrap { height: 64px; gap: 12px; }
  .brand img { width: 96px; }
  .nav { display: none; }
  .header-cta { margin-left: auto; }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; }
  .menu-btn svg { width: 20px; height: 20px; }
}
@media (max-width: 420px) { .header-cta { display: none; } .menu-btn { margin-left: auto; } }

/* Menú móvil: popover nativo, sin JS */
.mobile-menu { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.mobile-menu::backdrop { background: rgb(15 23 42 / 0.4); }
.mobile-menu .bar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding-inline: var(--gutter); border-bottom: 1px solid var(--line); }
.mobile-menu ul { list-style: none; margin: 0; padding: 12px var(--gutter); }
.mobile-menu li a { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 1.375rem; font-weight: 560; letter-spacing: -0.015em; text-decoration: none; }
.mobile-menu li a::after { content: "→"; color: var(--muted); }
.mobile-menu li a[aria-current="page"], .mobile-menu li a[aria-current="page"]::after { color: var(--cyan-ink); }
@supports not selector(:popover-open) { .mobile-menu { display: none; } }
.mobile-menu .btn { margin: 20px var(--gutter); width: calc(100% - 2 * var(--gutter)); }
@media (min-width: 1180px) { .mobile-menu { display: none !important; } }

/* Hero */
.hero { padding-block: clamp(56px, 8vw, 112px) clamp(48px, 6vw, 80px); }
.hero-grid { display: grid; gap: 28px; }
.hero-side { display: grid; gap: 28px; }
.hero h1 { margin-top: 22px; font-size: var(--step-display); line-height: 1.02; letter-spacing: -0.035em; max-width: 24ch; }
.hero .lead { max-width: 46ch; }
@media (min-width: 1024px) {
  .hero-side { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 48px; }
  .hero-side .actions { justify-content: flex-end; }
}

/* Cabecera de página interior */
.page-hero { padding-block: clamp(40px, 6vw, 88px) clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: var(--step-h1); max-width: 20ch; margin-block: 18px 22px; letter-spacing: -0.03em; }
.page-hero .lead { max-width: 60ch; }
.page-hero .actions { margin-top: 32px; }
.page-grid { display: grid; gap: 40px; }
@media (min-width: 1024px) { .page-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: 72px; align-items: end; } }
.spec { align-self: end; margin: 0; padding: 8px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.spec > div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.spec > div:last-child { border-bottom: 0; }
.spec dt { font: 400 0.75rem/1.2 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.spec dd { margin: 0; font-size: 0.9688rem; line-height: 1.45; color: var(--ink); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.updated { margin-top: 28px; font: 400 0.8125rem/1.4 var(--mono); color: var(--muted); }

/* Soluciones: lista editorial */
.lines { border-top: 1px solid var(--line); }
.line { display: grid; gap: 14px 48px; padding-block: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); position: relative; }
.line h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); letter-spacing: -0.028em; }
.line h3 a { text-decoration: none; }
.line h3 a::after { content: ""; position: absolute; inset: 0; }
.line-body { display: grid; gap: 14px; }
.line .result { font-size: 1.125rem; color: var(--ink); }
.line ul { display: grid; gap: 6px; padding: 0; list-style: none; color: var(--ink-2); font-size: 1rem; }
.line li { display: flex; gap: 10px; }
.line li::before { content: "—"; color: var(--line-2); }
.line .go { align-self: start; justify-self: start; font-weight: 600; color: var(--ink); transition: transform 0.2s var(--ease), color 0.2s; }
.line:hover .go { color: var(--cyan-ink); transform: translateX(4px); }
.line:hover h3 { color: var(--cyan-ink); }
.tag { display: inline-block; margin-left: 10px; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; font: 400 0.75rem/1.2 var(--mono); color: var(--muted); letter-spacing: 0; vertical-align: middle; }
@media (max-width: 899px) { .line .go { display: none; } }
@media (min-width: 900px) {
  .line { grid-template-columns: 64px minmax(0, 5fr) minmax(0, 6fr) 40px; align-items: start; }
  .line .num { padding-top: 0.55em; }
}

/* Principios (fondo navy) */
.pillars { display: grid; gap: 1px; background: var(--navy-line); border: 1px solid var(--navy-line); border-radius: var(--radius-lg); overflow: hidden; }
.pillar { display: grid; align-content: start; gap: 14px; padding: clamp(28px, 3.5vw, 44px); background: var(--navy); }
.pillar h3 { font-size: var(--step-h3); letter-spacing: -0.015em; }
.pillar p { color: var(--on-navy-2); }
.pillar .proof { padding-top: 14px; border-top: 1px dashed var(--navy-line); font-size: 0.9375rem; color: var(--on-navy); }
@media (min-width: 760px) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 760px) { .pillar { grid-row: span 4; grid-template-rows: subgrid; row-gap: 14px; } .pillar:not(:has(.proof)) { grid-row: span 3; } }

/* Pasos del método */
.steps { display: grid; gap: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; align-content: start; gap: 12px; padding: 28px 0; border-top: 1px solid var(--line); }
.step h3 { font-size: var(--step-h3); letter-spacing: -0.015em; }
.step p { color: var(--ink-2); }
.step .num { display: flex; align-items: center; gap: 10px; }
.step .num::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--line-2), transparent); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 32px; row-gap: 0; }
  .step { grid-row: span 3; grid-template-rows: subgrid; row-gap: 12px; padding-top: 22px; border-top: 2px solid var(--ink); }
  .step .num::after { display: none; }
}
.steps--rows .step { grid-template-columns: minmax(0, 1fr); }
.steps--rows h2 { font-size: var(--step-h3); letter-spacing: -0.015em; }
.split .pricing { margin-top: 0; }
@media (min-width: 900px) {
  .steps--rows { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps--rows .step { grid-row: auto; grid-template-rows: none; grid-template-columns: 64px minmax(0, 4fr) minmax(0, 7fr); column-gap: 48px; padding-block: 32px; border-top: 1px solid var(--line); }
  .steps--rows .step .num::after { display: none; }
  .steps--rows .step .num { padding-top: 0.4em; align-self: start; }
}

/* Modelo económico */
.pricing { display: grid; gap: 1px; margin-top: clamp(48px, 6vw, 80px); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.price { display: grid; align-content: start; gap: 10px; padding: clamp(24px, 3vw, 36px); background: var(--surface); }
.price .k { font: 400 0.8125rem/1 var(--mono); color: var(--muted); }
.price h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
.price p { color: var(--ink-2); font-size: 1rem; }
.price--main { background: var(--cyan-wash); }
@media (min-width: 820px) { .pricing { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pricing-note { margin-top: 18px; font-size: 0.9375rem; color: var(--muted); }

/* Fotografía editorial */
.photo { margin: 0 0 clamp(48px, 6vw, 80px); }
.photo img { width: 100%; height: auto; aspect-ratio: 2400 / 1018; object-fit: cover; border-radius: var(--radius-lg); background: var(--navy); }
@media (max-width: 719px) { .photo img { aspect-ratio: 4 / 3; } .photo--right img { object-position: 72% 50%; } }

/* Sector */
.sector { display: grid; gap: 48px; }
.stats { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { display: grid; align-content: start; gap: 8px; padding-block: 28px; background: var(--paper); }
.stat .fig { font-size: clamp(3rem, 2rem + 4vw, 5.25rem); font-weight: 520; line-height: 0.95; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.stat .fig small { font-size: 0.42em; letter-spacing: -0.02em; margin-left: 0.12em; }
.stat p { color: var(--ink-2); max-width: 34ch; }
.source { font-size: 0.875rem; color: var(--muted); }
.source a { color: var(--muted); }
.source a:hover { color: var(--ink); }
.segments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.segments li { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.9375rem; color: var(--ink-2); background: var(--surface); }
@media (min-width: 960px) {
  .sector { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 80px; align-items: start; }
  .stats { grid-template-columns: 1fr 1fr; border: 0; background: none; gap: 32px; }
  .stat { border-top: 2px solid var(--ink); padding-top: 22px; }
}

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0; cursor: pointer; list-style: none; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); font-weight: 560; letter-spacing: -0.012em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; margin-top: 0.45em; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--cyan-ink); }
.faq .answer { padding: 0 48px 26px 0; color: var(--ink-2); max-width: 72ch; }
.faq .answer p + p { margin-top: 12px; }
@media (min-width: 960px) {
  .faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 64px; }
  .faq-grid .head { position: sticky; top: 112px; align-self: start; }
}

/* Contenido editorial de páginas interiores */
.split { display: grid; gap: 20px 64px; }
.split + .split { margin-top: clamp(56px, 7vw, 96px); }
.split > h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem); max-width: 16ch; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .split > h2 { position: sticky; top: 112px; align-self: start; } }
.prose { max-width: 70ch; color: var(--ink-2); }
.prose > * + * { margin-top: 1em; }
.prose h3 { margin-top: 2em; color: var(--ink); font-size: 1.1875rem; letter-spacing: -0.012em; }
.prose strong { color: var(--ink); }
.prose a { color: var(--cyan-ink); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--muted); }

.checks { display: grid; gap: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.checks li::before { content: ""; width: 12px; height: 10px; margin-top: 0.5em; background: var(--cyan-ink); clip-path: polygon(0 0, 40% 0, 100% 100%, 60% 100%); }
.checks strong { color: var(--ink); }

.cards { display: grid; gap: 16px; }
.card { display: grid; align-content: start; gap: 10px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card h3 { font-size: 1.125rem; letter-spacing: -0.012em; }
.card p { color: var(--ink-2); font-size: 1rem; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.callout { padding: 24px 26px; border-left: 3px solid var(--cyan-ink); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-2); }
.callout strong { color: var(--ink); }

/* Flujo: llamada → datos → sistema → documento */
.flow { display: grid; gap: 12px; padding: 0; list-style: none; counter-reset: flow; }
.flow li { position: relative; display: grid; align-content: start; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.flow li b { font-weight: 600; }
.flow li span { color: var(--ink-2); font-size: 0.9688rem; }
.flow .human { border-style: dashed; background: transparent; }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .flow li:not(.human):not(:nth-child(4))::after { content: "→"; position: absolute; right: -19px; top: 50%; translate: 0 -50%; color: var(--muted); }
  .flow .human { grid-column: 1 / -1; text-align: center; }
}

/* CTA final */
.cta { padding-block: clamp(88px, 11vw, 152px) clamp(72px, 8vw, 112px); }
main:has(> .cta:last-child) + .site-footer { padding-top: 48px; }
.cta h2 { font-size: var(--step-h2); max-width: 18ch; }
.cta .eyebrow + h2 { margin-top: 20px; }
.cta dd.muted { color: var(--on-navy-2); }
.cta-grid { display: grid; gap: 40px; }
.cta .lead { margin-top: 20px; }
.cta dl { display: grid; gap: 14px; padding-top: 4px; }
.cta dt { font: 400 0.8125rem/1 var(--mono); color: var(--on-navy-2); }
.cta dd { margin: 4px 0 0; }
.cta .mail { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 560; letter-spacing: -0.02em; color: var(--on-navy); text-decoration: none; border-bottom: 1px solid rgb(34 211 238 / 0.5); }
.cta .mail:hover { color: var(--cyan); border-color: var(--cyan); }
@media (min-width: 960px) { .cta-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: 80px; } }

/* Pie */
.site-footer { padding-block: 64px 40px; border-top: 1px solid var(--navy-line); font-size: 0.9375rem; }
.footer-grid { display: grid; gap: 40px; }
.footer-grid img { width: 112px; }
.footer-grid p { margin-top: 16px; max-width: 36ch; color: var(--on-navy-2); }
.footer-grid h2 { margin-bottom: 14px; font: 400 0.8125rem/1 var(--mono); color: var(--on-navy-2); letter-spacing: 0.02em; }
.footer-grid ul { display: grid; gap: 10px; padding: 0; list-style: none; }
.footer-grid a { color: var(--on-navy); text-decoration: none; }
.footer-grid a:hover { color: var(--cyan); }
.legal-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--navy-line); color: var(--on-navy-2); font-size: 0.875rem; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); } }

/* Marcador visible de dato pendiente: nunca debe publicarse */
.pending { padding: 1px 6px; border-radius: 4px; background: #FEF3C7; color: #78350F; font: 400 0.85em/1.4 var(--mono); }

/* ------------------------------------------------------------------ */
/* Demostración: llamada → datos → ficha                               */
/* ------------------------------------------------------------------ */
.demo-wrap { padding-bottom: clamp(16px, 3vw, 32px); }
.demo { background: var(--navy); color: var(--on-navy); border-radius: 22px; box-shadow: 0 1px 0 rgb(255 255 255 / 0.06) inset, 0 40px 80px -40px rgb(15 23 42 / 0.55), 0 18px 36px -24px rgb(15 23 42 / 0.4); overflow: hidden; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 16px clamp(16px, 2.4vw, 28px); border-bottom: 1px solid var(--navy-line); font-size: 0.875rem; }
.demo-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid rgb(34 211 238 / 0.35); border-radius: 999px; color: var(--cyan); font: 400 0.75rem/1 var(--mono); }
.demo-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.demo[data-state="playing"] .demo-badge::before { animation: pulse 1.6s infinite; }
.demo-title { color: var(--on-navy); font-weight: 600; }
.demo-title span { color: var(--on-navy-2); font-weight: 400; }
.demo-ctrl { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.demo-time { font: 400 0.8125rem/1 var(--mono); color: var(--on-navy-2); font-variant-numeric: tabular-nums; }
.demo-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid rgb(248 250 252 / 0.22); border-radius: 8px; background: transparent; color: var(--on-navy); font: 600 0.8125rem/1 var(--sans); cursor: pointer; }
.demo-btn:hover { border-color: var(--on-navy); }
.demo-btn[hidden] { display: none; }

.demo-body { display: grid; }
.demo-col { min-width: 0; padding: clamp(18px, 2.2vw, 26px); }
.demo-col + .demo-col { border-top: 1px solid var(--navy-line); }
.demo-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font: 400 0.75rem/1 var(--mono); color: var(--on-navy-2); letter-spacing: 0.04em; text-transform: uppercase; }
.demo-h b { font-weight: 400; color: var(--on-navy); }

/* Transcripción */
.transcript { position: relative; display: grid; gap: 12px; max-height: 452px; overflow-y: auto; padding-right: 4px; padding-bottom: 28px; mask-image: linear-gradient(#000 calc(100% - 44px), transparent); scrollbar-width: thin; scrollbar-color: var(--navy-3) transparent; overscroll-behavior: contain; }
.turn { display: grid; gap: 4px; max-width: 94%; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.3s; }
.turn .who { display: flex; align-items: center; gap: 8px; font: 400 0.6875rem/1 var(--mono); color: var(--on-navy-2); }
.turn .who time { margin-left: auto; opacity: 0.7; }
.turn p { padding: 10px 13px; border-radius: 12px; font-size: 0.9375rem; line-height: 1.45; }
.turn--agent p { background: var(--navy-3); border-top-left-radius: 4px; }
.turn--caller { justify-self: end; }
.turn--caller p { background: transparent; border: 1px solid var(--navy-line); border-top-right-radius: 4px; color: #DCE3EE; }
.event { display: flex; align-items: center; gap: 8px; padding-left: 2px; font: 400 0.75rem/1.3 var(--mono); color: var(--cyan); transition: opacity 0.35s var(--ease); }
.event::before { content: "↳"; }
.turn.is-traced p, .event.is-traced { outline: 1px solid var(--cyan); outline-offset: 2px; }
.bars { display: none; align-items: end; gap: 2px; height: 10px; }
.bars i { width: 2px; height: 100%; background: var(--cyan); border-radius: 1px; animation: talk 0.9s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -0.3s; } .bars i:nth-child(3) { animation-delay: -0.6s; } .bars i:nth-child(4) { animation-delay: -0.15s; }
.turn.is-live .bars { display: inline-flex; }

/* Datos del expediente */
.fields { display: grid; gap: 0; }
.field { display: grid; gap: 3px; padding: 10px 8px; margin-inline: -8px; border-bottom: 1px dashed var(--navy-line); border-radius: 6px; transition: background-color 0.4s var(--ease); cursor: default; }
.field dt { font: 400 0.6875rem/1.2 var(--mono); color: var(--on-navy-2); letter-spacing: 0.02em; }
.field dd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; font-size: 0.9375rem; line-height: 1.35; color: var(--on-navy); }
.field .src { flex: none; font: 400 0.6875rem/1.35 var(--mono); color: var(--on-navy-2); }
.field .ok { color: var(--cyan); }
.field:hover { background: rgb(34 211 238 / 0.07); }
.field.is-new { background: rgb(34 211 238 / 0.14); }
.field .empty { display: none; color: var(--on-navy-2); }

/* Ficha (papel) */
.sheet { position: relative; padding: 22px 22px 26px; border-radius: 10px; background: #FDFDFB; color: #1F2937; font-family: var(--serif); box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 12px 30px -18px rgb(0 0 0 / 0.6); }
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 10px 10px 0 0; background: repeating-linear-gradient(90deg, var(--navy) 0 28px, transparent 28px 34px); opacity: 0.12; }
.sheet-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid #E5E7EB; font: 400 0.6875rem/1.3 var(--mono); color: #6B7280; }
.sheet-title { margin: 14px 0 4px; font: 600 1.0625rem/1.25 var(--serif); letter-spacing: -0.005em; color: #111827; }
.sheet .sheet-label { margin: 14px 0 3px; font: 400 0.6875rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: #6B7280; }
.sheet p:not(.sheet-title):not(.sheet-label) { font-size: 0.9063rem; line-height: 1.5; }
.sheet .gap { color: #9A3412; font-style: italic; }
.status { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 5px 10px; border-radius: 999px; background: #FEF3C7; color: #78350F; font: 400 0.6875rem/1 var(--mono); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sheet-wait { display: none; position: absolute; inset: 56px 22px 22px; place-items: center; text-align: center; font: 400 0.75rem/1.5 var(--mono); color: #6B7280; }
.demo.js .sheet:has(.sheet-title.is-pending) .sheet-wait { display: grid; }
.sheet .reveal { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }

/* Línea de tiempo */
.timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding: 16px clamp(16px, 2.4vw, 28px) 18px; border-top: 1px solid var(--navy-line); list-style: none; font-size: 0.8125rem; color: var(--on-navy-2); }
.timeline li { display: grid; gap: 3px; transition: color 0.3s; }
.timeline time { font: 400 0.75rem/1 var(--mono); color: var(--on-navy); font-variant-numeric: tabular-nums; }
.timeline li.is-done time { color: var(--cyan); }
@media (min-width: 760px) { .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.demo-note { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }
@media (max-width: 759px) { .demo-note .hint { display: none; } }

/* Estados de reproducción (solo con JS: sin JS se ve la llamada completa) */
.demo.js .is-pending { opacity: 0; transform: translateY(6px); }
.demo.js .event.is-pending { transform: none; }
.demo.js .field.is-pending .val, .demo.js .field.is-pending .src { display: none; }
.demo.js .field.is-pending .empty { display: block; }
.demo.js .field.is-pending { opacity: 1; transform: none; }

@media (min-width: 760px) {
  .demo-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .demo-col:nth-child(2) { border-top: 0; border-left: 1px solid var(--navy-line); }
  .demo-col:nth-child(3) { grid-column: 1 / -1; }
}
@media (min-width: 1180px) {
  .demo-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1.05fr); }
  .demo-col + .demo-col { border-top: 0; border-left: 1px solid var(--navy-line); }
  .demo-col:nth-child(3) { grid-column: auto; }
}
@media (max-width: 759px) { .transcript { max-height: 340px; } }

@keyframes talk { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(34 211 238 / 0.6); } 100% { box-shadow: 0 0 0 8px rgb(34 211 238 / 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 404 */
.notfound { min-height: 60vh; display: grid; align-content: center; gap: 20px; padding-block: var(--section); }
.notfound h1 { font-size: var(--step-h1); }

@media print {
  .site-header, .site-footer, .demo-ctrl, .skip { display: none; }
  body { background: #fff; }
}
