/* ==========================================================================
   Cantiere — landing site
   Tokens from design-system colors_and_type.css + marketing layout.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --paper:        #FFFFFF;
  --paper-2:      #F4F5F7;
  --paper-3:      #E6E8EC;
  --paper-4:      #C8CCD2;

  --ink:          #0A0E14;
  --ink-2:        #272B33;
  --ink-3:        #5B6170;
  --ink-4:        #8E94A1;

  --white:        #FFFFFF;

  --accent:       #0369A1;
  --accent-hover: #075985;
  --accent-weak:  #E0F2FE;

  --success:      #2F6A4B;
  --warning:      #8A6A1C;
  --danger:       #8B2A2A;

  --bg:           var(--paper);
  --bg-elevated:  var(--white);
  --bg-muted:     var(--paper-2);
  --bg-inverse:   var(--ink);

  --fg:           var(--ink);
  --fg-muted:     var(--ink-2);
  --fg-subtle:    var(--ink-3);
  --fg-faint:     var(--ink-4);
  --fg-inverse:   var(--paper);

  --border:       var(--paper-3);
  --border-strong:var(--paper-4);
  --border-focus: var(--accent);

  --font-serif:   "Newsreader", "Charter", Georgia, serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-md:      1.125rem;
  --text-lg:      1.25rem;
  --text-xl:      1.5rem;
  --text-2xl:     2rem;
  --text-3xl:     2.5rem;
  --text-4xl:     3.25rem;
  --text-5xl:     4.25rem;
  --text-6xl:     5.5rem;

  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-loose:  1.7;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-normal:0;
  --tracking-wide:  0.04em;
  --tracking-mono:  0.1em;

  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;

  --space-0:   0;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10:  128px;

  --radius-none: 0;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  --shadow-xs:  0 1px 0 rgba(14, 22, 38, 0.04);
  --shadow-sm:  0 1px 2px rgba(14, 22, 38, 0.06), 0 0 0 1px rgba(14, 22, 38, 0.04);
  --shadow-md:  0 4px 12px rgba(14, 22, 38, 0.06), 0 0 0 1px rgba(14, 22, 38, 0.04);
  --shadow-lg:  0 12px 40px rgba(14, 22, 38, 0.08), 0 0 0 1px rgba(14, 22, 38, 0.04);

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   320ms;

  --container-max:  1200px;
  --gutter:         var(--space-5);

  --header-h:       65px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* Header sticky de --header-h tapa el top del viewport. scroll-padding-top
     reserva esa altura. NO sumamos buffer extra — cada sección ya tiene su
     propio padding-top que sirve de respiración (.section 96, .section--tight 64).
     Buffer extra producía que las secciones cayeran visualmente muy abajo. */
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg);
  background: var(--bg);
  margin: 0;
}

h1, h2, h3, .h-display {
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  color: var(--fg);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.025em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.02em; line-height: var(--leading-snug); }
h3 { font-size: var(--text-xl); letter-spacing: var(--tracking-snug); line-height: var(--leading-snug); }

h4, h5 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  color: var(--fg);
  margin: 0;
}
h5 { font-size: var(--text-base); }

p, .p {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-muted);
  margin: 0;
  text-wrap: pretty;
}

.lede {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--fg);
  font-weight: var(--weight-regular);
}

small, .small { font-size: var(--text-sm); color: var(--fg-subtle); }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--bg-muted);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--fg);
}
pre {
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--leading-normal);
}
pre code { background: transparent; padding: 0; color: inherit; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
a:hover { text-decoration-color: var(--fg); }

::selection { background: var(--ink); color: var(--paper); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Primitives
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.eyebrow.accent { color: var(--accent); }

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--lg { padding: 14px 22px; font-size: 15px; }

.btn--primary {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--secondary:hover {
  background: var(--paper-2);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.btn--ghost:hover { background: var(--paper-2); text-decoration: none; }

/* CTA hacia la página actual: queda visible pero deshabilitado sutilmente.
   El lead ve que la opción existe ("estás aquí") sin gastar el click. El
   ring pulsante se detiene para no parecer un CTA activo. */
.btn[aria-current="page"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  filter: saturate(0.6);
}
.btn[aria-current="page"] .btn__icon-ring { animation: none; }

/* Icon slot dentro de los .btn — heredado del color del texto. */
.btn__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.btn--lg .btn__icon { width: 16px; height: 16px; flex-basis: 16px; }

/* Anillo pulsante alrededor del dot del bot — efecto "online/listo".
   `transform-box: view-box` hace que el origen 12,12 sea relativo al
   viewBox del SVG (centro real), no al bounding box del propio círculo
   (que estaría fuera de centro y descentraría la animación). */
.btn__icon-ring {
  transform-origin: center;
  transform-box: view-box;
  animation: btn-bot-pulse 2s ease-out infinite;
}
@keyframes btn-bot-pulse {
  0%   { transform: scale(0.55); opacity: 0.85; }
  70%  { transform: scale(1.40); opacity: 0; }
  100% { transform: scale(1.40); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn__icon-ring { animation: none; opacity: 0.65; }
}

.btn--inverse {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn--inverse:hover { opacity: 0.9; text-decoration: none; }

/* La cta-section antes tenía fondo oscuro y exigía invertir el secondary
   button. Ahora vive en paper igual al resto del landing — usa el estilo
   secondary default (sin override). */

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 18px var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__wordmark {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--ink);
}
.brand svg { display: block; }

.site-nav {
  display: flex;
  gap: 22px;
  font-family: var(--font-sans);
  font-size: 13.5px;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent-weak);
}
.site-nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
/* Item del nav que apunta a la página actual: visible como activo pero
   no clickeable. Solo aplica a páginas dedicadas (/chat, /contacto) — el
   scroll-spy en home NO setea aria-current, así que sigue clickeable
   para volver al top de cada sección. */
.site-nav a[aria-current="page"] {
  pointer-events: none;
  cursor: default;
}

.site-header__right {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* Link sutil tipo disclaimer dentro del header (ej. /chat tiene "Agendar →"
   al lado del btn primary deshabilitado, sin compite visualmente con él). */
.site-header__link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-standard),
              text-decoration-color var(--duration-fast) var(--ease-standard);
}
.site-header__link:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}
@media (max-width: 900px) {
  .site-header__link { display: none; }
}

.lang-toggle {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.lang-toggle button {
  background: none;
  border: none;
  font: inherit;
  letter-spacing: inherit;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--ink-4);
}
.lang-toggle button.is-active { color: var(--ink); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--ink);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-6);
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__headline {
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 400;
  margin: 0;
  max-width: 14ch;
}

.rotate-word {
  display: inline-block;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  animation: rotate-word-fade 4200ms var(--ease-standard) infinite;
  will-change: opacity;
}
@keyframes rotate-word-fade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rotate-word { animation: none; }
}
.hero__lede {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 48px;
  max-width: 52ch;
  font-weight: 400;
}
.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Section shared
   ========================================================================== */

.section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 96px var(--space-6);
}
.section--tight { padding: 64px var(--space-6); }

.section__head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 48px;
}
.section__title {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 400;
  max-width: 18ch;
  margin: 0;
}
.section__lede {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 20px 0 0;
}

/* ==========================================================================
   Services — hairline list
   ========================================================================== */

.services-list {
  border-top: 1px solid var(--border);
}
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 2fr;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  gap: 24px;
  color: inherit;
}
.service-row__n {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-left: 4px;
}
.service-row__title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.service-row__body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   Process
   ========================================================================== */

.process {
  background: #FAFAFB;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.process__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 96px var(--space-6);
}
.process__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.process-step {
  border-top: 1px solid var(--ink-3);
  padding-top: 20px;
}
.process-step__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.process-step__meta > span:first-child {
  color: var(--accent);
}
.process-step__title {
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: -0.015em;
  font-weight: 400;
  margin: 0;
}
.process-step__body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 12px;
}

/* ==========================================================================
   Cases — three-up hairline grid
   ========================================================================== */

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.section__foot {
  margin-top: 32px;
  text-align: right;
}
.section__foot-link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}
.section__foot-link:hover { opacity: 0.6; }
.case-card {
  background: var(--paper);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  text-decoration: none;
  color: inherit;
  transition: background var(--duration-fast) var(--ease-standard);
}
.case-card:hover { background: var(--paper-2); text-decoration: none; }
.case-card__sector {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.case-card__client {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 12px 0 0;
}
.case-card__metric {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  margin-top: 20px;
}
.case-card__detail {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: 8px;
  flex: 1;
}
.case-card__link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  margin-top: 16px;
}

/* ==========================================================================
   CTA — ink inverse section
   ========================================================================== */

.cta-section {
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--border);
}
/* Inner ya viene con padding 96px — lo dejamos. La jerarquía la da el
   border-top + el size del título, no un cambio de color. */
.cta-section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 96px var(--space-6);
}
.cta-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.cta-section__mark {
  color: var(--ink-3);
  display: block;
}
.cta-section__title {
  font-family: var(--font-serif);
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0;
  max-width: 22ch;
  color: var(--ink);
}
.cta-section__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 64px;
}
.cta-section__copy-lede {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 40px 0 0;
}
.cta-card {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
}
.cta-card__n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 16px;
}
.cta-card__title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
}
.cta-card__body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 12px;
}
.cta-section__action {
  margin-top: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cta-section__alt {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-standard),
              text-decoration-color var(--duration-fast) var(--ease-standard);
}
.cta-section__alt:hover {
  color: var(--paper);
  text-decoration-color: var(--paper);
}

/* ==========================================================================
   Applications — pattern rows (aplicaciones.html)
   ========================================================================== */

.patterns-intro {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 56px;
}

.patterns {
  border-top: 1px solid var(--border);
}
.pattern-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--duration-fast) var(--ease-standard);
}
.pattern-row:hover {
  background: var(--paper-2);
  text-decoration: none;
}

.pattern-row__sector {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pattern-row__title {
  font-family: var(--font-serif);
  font-size: 30px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 18px;
  line-height: 1.1;
}
.pattern-row__metric {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}

.pattern-row__body p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.pattern-row__list {
  margin: 22px 0 0;
  padding: 0 0 0 18px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pattern-row__list li {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  position: relative;
}
.pattern-row__list li::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 10px;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.pattern-row__link {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.pattern-row:hover .pattern-row__link {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent-hover);
}

/* ==========================================================================
   Case detail (article)
   ========================================================================== */

.article {
  max-width: 780px;
  margin: 0 auto;
  padding: 96px var(--space-6);
}
.article__title {
  font-family: var(--font-serif);
  font-size: 54px;
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin-top: 24px;
}
.article__lede {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 48px;
}
.article__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.metric__value {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.metric__label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}
.article h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-top: 64px;
}
.article h2 + p { margin-top: 16px; }
.article p {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}
.article h2:nth-of-type(n+2) { margin-top: 48px; }

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color var(--duration-fast) var(--ease-standard);
}
.article__back:hover {
  color: var(--accent);
  text-decoration: none;
}

.article__metrics-note {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  font-style: italic;
  max-width: 64ch;
}

.article__cta {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 80px;
  margin-top: 80px;
}
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.contact-form__wide { grid-column: 1 / -1; }
.contact-form__notice {
  background: var(--surface-muted, #f6f6f2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-form__notice strong { font-weight: 600; }
.contact-form__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.field__input,
.field__textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--ink);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.field__textarea { resize: vertical; min-height: 108px; }
.field__input:focus,
.field__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 182, 122, 0.2);
}

.contact-aside {
  border-left: 1px solid var(--border);
  padding-left: 32px;
}
.contact-aside__content {
  margin-top: 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}
.contact-aside__content strong {
  color: var(--ink);
  font-weight: 500;
  display: block;
}
.contact-aside__content .stack { margin-top: 16px; }

.contact-headline {
  font-family: var(--font-serif);
  font-size: 60px;
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin-top: 24px;
  max-width: 14ch;
}

/* ==========================================================================
   Pricing — hairline-divided rows
   ========================================================================== */

.pricing-list {
  border-top: 1px solid var(--border);
}
.pricing-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  gap: 24px;
}
.pricing-row__n {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-left: 4px;
}
.pricing-row__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pricing-row__title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.pricing-row__body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}
.pricing-row__price {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.02em;
  justify-self: end;
  padding-right: 4px;
  white-space: nowrap;
}
.pricing-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-top: 24px;
  line-height: 1.7;
}

/* ==========================================================================
   FAQ — details/summary
   ========================================================================== */

.faq-list {
  border-top: 1px solid var(--border);
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item__q {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: -0.01em;
  padding: 22px 40px 22px 4px;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--ink);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.faq-item[open] .faq-item__q::after {
  content: '−';
}
.faq-item__a {
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 22px 4px;
  max-width: 72ch;
}

/* ==========================================================================
   Chat — discovery agent interface
   ========================================================================== */

.body--chat {
  background: var(--paper);
}

.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--header-h));
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.chat-page__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 32px var(--space-6) 24px;
  border-bottom: 1px solid var(--border);
}
.chat-page__head-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-page__title {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
  max-width: 22ch;
}
.chat-dev-reset {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border-strong, #ccc);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2, #666);
  cursor: pointer;
  align-self: flex-start;
  transition: background 120ms ease, color 120ms ease;
}
.chat-dev-reset:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink, #111);
}
.chat-dev-reset[hidden] { display: none; }

/* Card grande retirada — ahora hay un .chat-match-chip sticky + .chat-match-sheet
   que abre con la ficha completa. Las clases .chat-match__* siguen usándose
   DENTRO del sheet (eyebrow, dot, name, metrics, etc). */

/* ===== Chip sticky encima del input ===== */
.chat-match-chip {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  margin: 0 16px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 2px 12px rgba(14, 22, 38, 0.06);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  width: calc(100% - 32px);
  max-width: 720px;
  text-align: left;
  transition: border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
  animation: chat-match-chip-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.chat-match-chip:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.chat-match-chip[hidden] { display: none; }
.chat-match-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.chat-match-chip__label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.chat-match-chip__name {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.chat-match-chip__sep {
  color: var(--ink-4);
  flex: 0 0 auto;
}
.chat-match-chip__metric {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  flex: 0 0 auto;
  white-space: nowrap;
}
.chat-match-chip__chevron {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 16px;
  flex: 0 0 auto;
}
@keyframes chat-match-chip-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 680px) {
  .chat-match-chip { font-size: 12.5px; padding: 7px 10px 7px 12px; }
  .chat-match-chip__metric { font-size: 11px; }
}

/* ===== Sheet (mobile bottom-sheet, desktop modal centered) ===== */
.chat-match-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.chat-match-sheet[hidden] { display: none; }
.chat-match-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 22, 38, 0.40);
  backdrop-filter: blur(2px);
  animation: chat-match-sheet-fade 200ms ease-out;
}
.chat-match-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--paper);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 24px 22px 28px;
  box-shadow: 0 -8px 40px rgba(14, 22, 38, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: chat-match-sheet-slide 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chat-match-sheet__panel::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--paper-3);
  margin: -8px auto 6px;
}
.chat-match-sheet__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 1;
}
.chat-match-sheet__close:hover { background: var(--paper-2); color: var(--ink); }
/* Reservar espacio para el close button — sino el confidence chip
   queda detrás del × en el corner. */
.chat-match-sheet__panel > .chat-match__eyebrow {
  padding-right: 44px;
}
.chat-match-sheet__title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}
@keyframes chat-match-sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes chat-match-sheet-slide {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (min-width: 720px) {
  .chat-match-sheet { align-items: center; padding: 24px; }
  .chat-match-sheet__panel {
    border-radius: 14px;
    max-height: 90vh;
  }
  .chat-match-sheet__panel::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-match-sheet__backdrop,
  .chat-match-sheet__panel,
  .chat-match-chip { animation: none; }
}
body.is-match-sheet-open { overflow: hidden; }
.chat-match__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-match__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2, #666);
}
.chat-match__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #0a7);
  box-shadow: 0 0 0 3px rgba(10, 170, 119, 0.15);
}
.chat-match__confidence {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(10, 170, 119, 0.12);
  color: var(--accent, #0a7);
  letter-spacing: 0.06em;
}
.chat-match__name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink, #111);
  margin: 0;
  line-height: 1.25;
}
.chat-match__desc {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2, #444);
  margin: 0;
}
.chat-match__desc[hidden] { display: none; }

.chat-match__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 2px;
}
.chat-match__tags[hidden] { display: none; }
.chat-match__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.chat-match__tag[hidden] { display: none; }
.chat-match__tag--type[data-type="agent"] {
  background: rgba(10, 170, 119, 0.10);
  color: var(--accent, #0a7);
  border-color: rgba(10, 170, 119, 0.25);
}
.chat-match__tag--type[data-type="workflow"] {
  background: rgba(70, 110, 200, 0.10);
  color: #466ec8;
  border-color: rgba(70, 110, 200, 0.25);
}
.chat-match__tag--type[data-type="hybrid"] {
  background: rgba(140, 90, 200, 0.10);
  color: #8c5ac8;
  border-color: rgba(140, 90, 200, 0.25);
}
.chat-match__industries {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chat-match__industry {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink-2, #555);
  background: #fff;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.chat-match__metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.chat-match__metrics[hidden] { display: none; }
.chat-match__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: #fff;
  min-height: 0;
}
.chat-match__metric[hidden] { display: none; }
.chat-match__metric-value {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.2;
  color: var(--ink, #111);
  font-weight: 500;
}
.chat-match__metric--hero .chat-match__metric-value {
  font-size: 14px;
  color: var(--accent, #0a7);
}
.chat-match__metric-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2, #666);
}
.chat-match__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.chat-match__chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink-2, #555);
  background: #fafafa;
  letter-spacing: 0.02em;
}
@media (max-width: 680px) {
  .chat-match__metrics { grid-template-columns: 1fr; }
}
.chat-match__metric-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3, #888);
}
.chat-match__update {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border: 1px solid var(--border-strong, #ccc);
  border-radius: 6px;
  background: transparent;
  color: var(--ink, #111);
  cursor: pointer;
  text-align: left;
}
.chat-match__update:hover { background: rgba(0, 0, 0, 0.04); }
.chat-match__panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-match__panel[hidden] { display: none; }
.chat-match__panel-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink, #333);
}
.chat-match__panel-field {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong, #ccc);
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
}
.chat-match__panel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.chat-match__panel-cancel,
.chat-match__panel-send {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-strong, #ccc);
}
.chat-match__panel-cancel { background: transparent; color: var(--ink); }
.chat-match__panel-send {
  background: var(--accent, #0a7);
  border-color: var(--accent, #0a7);
  color: #fff;
}
.chat-match__panel-send:disabled { opacity: 0.6; cursor: wait; }
.chat-match__panel-status {
  font-size: 11px;
  color: var(--muted, #666);
  font-family: var(--font-mono);
}
.chat-page__escape {
  text-align: right;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.chat-page__escape-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.chat-page__escape-action {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.chat-page__escape:hover .chat-page__escape-action {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent-hover);
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 28px var(--space-6);
  scroll-behavior: smooth;
}
.chat-stream__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 78%;
  animation: chat-msg-in 280ms var(--ease-standard);
}
.chat-msg--agent { align-self: flex-start; }
.chat-msg--user  { align-self: flex-end; align-items: flex-end; }

@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg__meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.chat-msg--agent .chat-msg__role { color: var(--accent); }
.chat-msg--user  .chat-msg__role { color: var(--ink); }

.chat-msg__body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.chat-msg__body p { margin: 0; }
.chat-msg__body p + p { margin-top: 10px; }
.chat-msg__body ul,
.chat-msg__body ol {
  margin: 8px 0 0;
  padding-left: 20px;
}
.chat-msg__body li + li { margin-top: 4px; }
.chat-msg__body strong { font-weight: 600; }
.chat-msg__body em { font-style: italic; }
.chat-msg__body code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.chat-msg__body a {
  color: var(--accent, #2a5cff);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-msg__body a:hover { text-decoration: none; }

.chat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chat-chip {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.chat-chip:hover:not([disabled]) {
  background: var(--paper-2);
  border-color: var(--ink-3);
}
.chat-chip:focus-visible {
  outline: 2px solid var(--accent, #2a5cff);
  outline-offset: 2px;
}
.chat-chip[disabled] {
  opacity: 0.5;
  cursor: default;
}
.chat-chip--other {
  border-style: dashed;
  color: var(--ink-2, #666);
}
.chat-chip-other {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  flex-basis: 100%;
}
.chat-chip-other__field {
  flex: 1 1 auto;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
.chat-chip-other__field:focus {
  outline: 2px solid var(--accent, #2a5cff);
  outline-offset: 1px;
}
.chat-chip-other__send {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
}
.chat-chip-other__send:hover {
  background: var(--accent-hover);
}
.chat-chip-other__cancel {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.chat-chip-other__cancel:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.chat-msg--user .chat-msg__body {
  background: var(--paper-2);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 10px;
  border-top-right-radius: 2px;
  border: 1px solid var(--border);
}
.chat-msg--user .chat-msg__body p { color: var(--ink); }

.chat-msg__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.chat-typing {
  display: inline-flex;
  gap: 5px;
  padding: 8px 0 4px;
}
.chat-typing__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: chat-typing-bounce 1.2s infinite ease-in-out both;
}
.chat-typing__dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes chat-typing-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-msg { animation: none; }
  .chat-typing__dot { animation: none; opacity: 0.6; }
}

.chat-input {
  border-top: 1px solid var(--border);
  padding: 16px var(--space-6) 18px;
  background: var(--paper);
}
.chat-input__inner {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.chat-input__field {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.45;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink);
  resize: none;
  min-height: 44px;
  max-height: 160px;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.chat-input__field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.chat-input__send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.chat-input__send:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.chat-input__send:disabled {
  background: var(--paper-3);
  border-color: var(--paper-3);
  cursor: not-allowed;
}
.chat-input__hint {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.chat-input__hint a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-weak);
}
.chat-input__hint a:hover { text-decoration-color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 128px;
}
.cta-section + .site-footer {
  margin-top: 0;
  border-top: none;
}
.site-footer__top {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px var(--space-6);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.site-footer__blurb {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  max-width: 280px;
  line-height: 1.5;
}
.footer-col {
  display: flex;
  flex-direction: column;
}
.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.footer-col__links a {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
.footer-col__links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.site-footer__bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px var(--space-6) 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .site-nav.is-open a {
    padding: 14px 32px;
    border-bottom: 1px solid var(--border);
  }
  .site-nav.is-open a.is-active { border-bottom-color: var(--border); }
  .menu-toggle { display: inline-flex; }
  :root { --header-h: 57px; }
  .site-header__inner { gap: var(--space-4); padding: 14px var(--space-5); }
  .site-header__right { gap: 12px; }
  .site-header__right .btn { display: none; }

  .hero { padding: var(--space-6) var(--space-5); }
  .hero__headline { font-size: 48px; }
  .hero__lede { font-size: 18px; margin-top: 32px; }
  .hero__cta { margin-top: 32px; }

  .section { padding: 64px var(--space-5); }
  .section--tight { padding: 48px var(--space-5); }
  .section__head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }
  .section__title { font-size: 32px; }

  .service-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }

  .pricing-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .pricing-row__price { justify-self: start; padding-right: 0; }
  .faq-item__q { font-size: 16px; padding-right: 36px; }

  .process__inner { padding: 64px var(--space-5); }
  .process__grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .cases-grid { grid-template-columns: 1fr; }

  .cta-section__inner {
    padding: 64px var(--space-5);
  }
  .cta-section__title { font-size: 36px; }
  .cta-section__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 40px;
  }
  .cta-section__action { margin-top: 40px; }

  .contact-headline { font-size: 40px; }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 48px;
  }
  .contact-form { grid-template-columns: 1fr; }
  .contact-aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 32px;
  }

  .article { padding: 64px var(--space-5); }
  .article__title { font-size: 36px; }
  .article__metrics { grid-template-columns: 1fr; }
  .article h2 { font-size: 26px; margin-top: 48px; }

  .pattern-row {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0;
  }
  .pattern-row__title { font-size: 24px; }
  .patterns-intro { font-size: 17px; margin-bottom: 40px; }

  .chat-page__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px var(--space-5) 20px;
  }
  .chat-page__title { font-size: 22px; }
  .chat-page__escape { text-align: left; }
  .chat-stream { padding: 24px var(--space-5); }
  .chat-msg { max-width: 90%; }
  .chat-input { padding: 14px var(--space-5) 16px; }

  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 32px var(--space-5);
  }
  .site-footer { margin-top: 64px; }
  .site-footer__bottom {
    padding: 16px var(--space-5) 24px;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .process__grid { grid-template-columns: 1fr; }
  .site-footer__top { grid-template-columns: 1fr; }
  .hero__headline { font-size: 40px; }
  .contact-headline { font-size: 32px; }
}

/* ==========================================================================
   Hero / CTA aside — text link under primary CTA
   ========================================================================== */
.hero__cta-aside {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 18px;
  line-height: 1.55;
  max-width: 52ch;
}
.hero__cta-aside a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
.hero__cta-aside a:hover { text-decoration-color: var(--accent); }

.cta-section__aside {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 18px 0 0;
  line-height: 1.55;
}
.cta-section__aside a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
.cta-section__aside a:hover { text-decoration-color: var(--accent); }

/* ==========================================================================
   Inline link button inside chat messages (e.g., reopen schedule modal)
   ========================================================================== */
.chat-msg__link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-weak);
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
.chat-msg__link:hover { text-decoration-color: var(--accent); }

/* ==========================================================================
   Schedule modal (post-brief, embebido en /chat)
   ========================================================================== */
.schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.schedule-modal[hidden] { display: none; }
.schedule-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.schedule-modal__panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  padding: 28px 28px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
}
.schedule-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.schedule-modal__close:hover { background: var(--paper-2); color: var(--ink); }
.schedule-modal__head .eyebrow { margin-bottom: 8px; }
.schedule-modal__title {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 10px;
  color: var(--ink);
}
.schedule-modal__lede {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 20px;
}
.schedule-modal__form .field + .field { margin-top: 12px; }
.schedule-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.schedule-modal__status {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 12px;
  line-height: 1.5;
}
body.is-modal-open { overflow: hidden; }

/* Sticky mobile CTA bar — eliminada. El header en mobile (cualquier página,
   incluyendo /chat) deja solo brand + menu-toggle, sino se desborda. El
   botón "Agendar" del chat sigue accesible al cerrar el brief vía el
   schedule-modal. */
