/* Hallmark · v2.0.0 · redesign: full · genre: modern-minimal · theme: brand SAFIA, kit v1.0 (deal: manual, tokens from 02_Color/safia-colores.css) · posture: Restrained · job: hire · shape: Index-First, adapted (the work as the page) · hero: Stage · nav: edge-aligned, wordmark, three links, one quiet action · footer: statement · signature: the example sales board with net profit per payment method · copy: rewritten from the team's capabilities PDF · lint: sloplint not run, the session sandbox blocks third-party scripts; gates walked by hand */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: P, the hero line borrows the PDF's claim; kept it because it is the team's own argument and names the planilla every client has */
/* Hallmark · dropped the agents-only sections (problems, before/after table, three services, verticals, FAQ) and the client names · the team's PDF repositions SAFIA and says the clients have not yet allowed their names */
/* Hallmark · 2026-11-06: theme is dark, the owner does not want a white site: Tinta base, surfaces one step lighter, Verde Safia the one accent, pill controls, the ownership line on a green card */
/* Hallmark · hero stage: five areas travel a dashed rounded track around the example board, always in front of it so none is hidden; every 4.2s the next one turns to the front and the board crossfades to its view (Tableros, CRM, Cobranza, Documentos, IA) · click jumps to one, hover or focus pauses, reduced motion turns it off and narrow screens get a pill row */
/* Hallmark · added a pill-tab switcher with built samples and a block-by-block board entrance, from the owner's reference */
/* Hallmark · the mascot is the owner's own character, redrawn in vector by parts so it can move: it walks along the bottom edge after the cursor and stops beside it, never under it; eyes and head follow the cursor; it blinks, waves, laughs when tickled, jumps on three taps and naps after 25s idle · no speech, the owner asked for a character, not an agent · gate 80 waived for it · reduced motion: it stands still in the corner; the frame loop stops when settled or the tab is hidden */
/* Hallmark · dropped the opened coaching case, the hardware note and the sales close · the owner asked for them out on 2026-11-06; the process loop follows the owner's own diagram */

/* ---------- Tokens ---------- */

@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/assets/fonts/PlusJakartaSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/assets/fonts/PlusJakartaSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Brand kit, 02_Color, en versión oscura: base Tinta, superficies un escalón más claras */
  --color-paper: #0F1714;  /* Tinta como fondo */
  --color-paper-2: #16221E;  /* superficie: tarjetas, bandas, tablero */
  --color-ink: #F4F6F5;  /* texto (Niebla) */
  --color-muted: #A9B5B0;
  --color-rule: #2A3833;
  --color-accent: #2BBF9B;  /* Verde Safia: el único acento, 7.6:1 sobre Tinta */
  --color-accent-ink: #0F1714;
  --color-accent-deep: #95DFCD;
  --color-signal: #2BBF9B;       /* Verde Safia: marks and the bar, never text on light */
  --color-tint: #2E5E50;
  --color-tint-soft: #1B2E28;
  --color-focus: #95DFCD;
  --color-dark-text: #F4F6F5;
  --color-dark-muted: #A9B5B0;   /* Pizarra lifted for dark paper, 7.9:1 on Tinta */
  --color-dark-rule: #26332E;
  --color-warn: #FFCC66;
  --color-warn-soft: #3A2E12;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;

  /* Type, 1.25 from a 16px body; clamps reach the layout sizes at 1440 */
  --text-display: clamp(2.75rem, 1.2rem + 4.4vw, 5.25rem);
  --text-display-s: clamp(2.25rem, 1.2rem + 2.9vw, 3.75rem);
  --text-section: clamp(2rem, 1.25rem + 2.1vw, 3.25rem);
  --text-title: clamp(1.25rem, 1.1rem + 0.4vw, 1.5625rem);
  --text-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  --text-md: 1.0625rem;
  --text-sm: 0.875rem;

  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --section-gap-s: clamp(4.5rem, 8vw, 7.5rem);
  --section-gap: clamp(5rem, 10vw, 9rem);

  --container: 1440px;
  --gutter: clamp(1rem, 4.4vw, 4rem);
  --gap-columns: clamp(1rem, 2.2vw, 2rem);

  --radius-input: 14px;          /* kit radius */
  --radius-card: 20px;
  --radius-inner: 8px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --nav-h: 72px;
  --color-paper-3: #1C2A25;
  --color-footer: #0A100E;
  --radius-big: clamp(28px, 4vw, 56px);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--space-md)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: clip;
  background: var(--color-paper); color: var(--color-ink);
  font: 400 var(--text-md)/1.6 var(--font-body);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: var(--text-display); line-height: 1.0; letter-spacing: -0.035em; max-width: 12ch; }
h2 { font-size: var(--text-section); line-height: 1.06; letter-spacing: -0.03em; max-width: 20ch; }
h3 { font-size: var(--text-title); line-height: 1.2; letter-spacing: -0.015em; max-width: 40ch; }
p { margin: 0; text-wrap: pretty; }
ol, ul, dl, dd { margin: 0; padding: 0; list-style: none; }
a { color: var(--color-accent); text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent-deep); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: var(--space-2xs); }
::selection { background: var(--color-tint); color: var(--color-ink); }
.lead { font-size: var(--text-lead); line-height: 1.5; color: var(--color-muted); max-width: 34ch; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; z-index: 400; padding: var(--space-sm) var(--space-md); background: var(--color-ink); color: var(--color-dark-text); }
.skip:focus { left: var(--space-md); top: var(--space-md); }

/* ---------- Controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--space-lg);
  border: 1px solid var(--color-accent); border-radius: var(--radius-input);
  background: var(--color-accent); color: var(--color-accent-ink);
  font: 600 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-accent-deep); color: var(--color-accent-ink); }
.btn:active { transform: translateY(1px); }
.btn-quiet { background: transparent; color: var(--color-ink); border-color: var(--color-rule); }
.btn-quiet:hover { background: var(--color-paper-2); color: var(--color-ink); }
.btn-light { background: var(--color-signal); border-color: var(--color-signal); color: var(--color-ink); }
.btn-light:hover { background: var(--color-tint); color: var(--color-ink); }

/* ---------- Nav: edge-aligned ---------- */

.site-header { position: sticky; top: 0; z-index: 300; background: var(--color-paper); border-bottom: 1px solid transparent; transition: border-color var(--dur-short) var(--ease-out); }
.site-header.scrolled { border-bottom-color: var(--color-rule); }
.header-row { display: flex; align-items: center; gap: var(--space-xl); height: var(--nav-h); }
.brand img { height: 34px; width: auto; }
.nav { display: flex; gap: var(--space-lg); margin-left: auto; }
.nav a, .nav-action { color: var(--color-ink); text-decoration: none; font-size: var(--text-sm); font-weight: 400; white-space: nowrap; }
.nav a:hover { color: var(--color-accent); text-decoration: underline; }
.nav-action { font-weight: 600; color: var(--color-accent); text-decoration: underline; }

/* ---------- Hero: Stage ---------- */

.hero { min-height: calc(100dvh - var(--nav-h)); display: grid; align-items: center; padding-block: var(--space-xl) var(--space-2xl); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3xl); align-items: center; }
.hero .lead { margin-top: var(--space-lg); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xl); }

/* The example board: the product built in a slot, sample values only */
.board {
  margin: 0; padding: var(--space-xl);
  background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  font-variant-numeric: tabular-nums;
}
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); }
.board-title { font: 600 var(--text-title)/1.2 var(--font-display); letter-spacing: -0.015em; }
.board-sub { font-size: var(--text-sm); color: var(--color-muted); }
.board-goal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-lg); }
.board-goal > div { padding-inline: var(--space-md); border-left: 1px solid var(--color-rule); }
.board-goal > div:first-child { padding-left: 0; border-left: 0; }
.board-goal dt { font-size: var(--text-sm); color: var(--color-muted); }
.board-goal dd { margin-top: var(--space-2xs); font: 600 clamp(1.25rem, 0.9rem + 1vw, 1.875rem)/1.1 var(--font-display); letter-spacing: -0.02em; }
.board-bar { height: 10px; margin-top: var(--space-lg); border-radius: 5px; background: var(--color-tint-soft); overflow: hidden; }
.board-bar span { display: block; height: 100%; width: 100%; transform: scaleX(0.65); transform-origin: left; background: var(--color-signal); border-radius: 5px; }
.board-table { width: 100%; margin-top: var(--space-xl); border-collapse: collapse; font-size: var(--text-sm); }
.board-table caption { text-align: left; font-weight: 600; font-size: var(--text-md); padding-bottom: var(--space-xs); }
.board-table th, .board-table td { padding: var(--space-xs) 0; text-align: right; border-bottom: 1px solid var(--color-rule); }
.board-table th:first-child { text-align: left; }
.board-table thead th { color: var(--color-muted); font-weight: 400; }
.board-table tbody th { font-weight: 400; }
.board-table td:last-child { font-weight: 600; color: var(--color-accent); }
.board-source { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); max-width: 60ch; }
.board figcaption { margin-top: var(--space-lg); padding-top: var(--space-sm); border-top: 1px dashed var(--color-rule); font-size: var(--text-sm); color: var(--color-muted); }

/* The one reveal: the board assembles block by block, then the bar fills. Blocks are made by the script, so the board is visible without it. */
.board { position: relative; overflow: hidden; }
.pixels { position: absolute; inset: 0; z-index: 5; display: grid; grid-template-columns: repeat(var(--cols, 12), 1fr); pointer-events: none; }
.pixels span { background: var(--c, var(--color-tint-soft)); }
@media (prefers-reduced-motion: no-preference) {
  .pixels span { animation: px-out 0.32s var(--ease-out) var(--d, 0s) both; }
  @keyframes px-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.6); } }
  .js .board-bar span { animation: fill 0.8s var(--ease-out) 1.05s both; }
  @keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(0.65); } }
}
@media (prefers-reduced-motion: reduce) { .pixels { display: none; } }

/* Hero stage: the board in the middle and the areas orbiting it; the one that reaches the front opens its view */
.stage { position: relative; min-width: 0; }
.views { display: grid; }
.view { grid-area: 1 / 1; min-width: 0; }
.js .view { visibility: hidden; opacity: 0; transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s; }
.js .view.is-active { visibility: visible; opacity: 1; transition: opacity 0.35s var(--ease-out) 0.08s, visibility 0s; }
.view .pipe { margin-top: var(--space-lg); }
.view .pipe li { padding: var(--space-sm) var(--space-md); }
.view .pipe b { font-size: var(--text-section); }
.view .chat { margin-top: var(--space-lg); }
.board-table .chip { font-size: 0.8125rem; font-weight: 600; }
.board-table td:last-child .chip:not(.ok):not(.wait) { color: var(--color-ink); font-weight: 400; }

.orbit-ring { display: none; }
.orbit-chips { display: none; }
.js .stage:not(.is-orbit) { display: flex; flex-direction: column; }
.js .orbit-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); order: -1; margin-bottom: var(--space-md); }
.orbit-chips button {
  min-height: 40px; padding: 0 18px; border: 1px solid var(--color-tint); border-radius: 999px;
  background: var(--color-paper-2); color: var(--color-ink); font: 600 var(--text-sm)/1 var(--font-body); white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.orbit-chips button:hover { border-color: var(--color-accent); }
.orbit-chips button[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }

/* Orbit mode, set by the script on wide screens */
.stage.is-orbit { padding: 64px 72px 80px; }
.stage.is-orbit .board { z-index: 1; }
.stage.is-orbit .orbit-ring { display: block; position: absolute; z-index: 0; border: 2px dashed var(--color-tint); pointer-events: none; }
.stage.is-orbit .orbit-chips { display: block; position: absolute; inset: 0; margin: 0; pointer-events: none; }
.stage.is-orbit .orbit-chips button {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  transform: translate(var(--x, 0), var(--y, 0)) translate(-50%, -50%) scale(var(--s, 1));
  z-index: 2; box-shadow: 0 1px 2px oklch(20% 0.01 165 / 0.06);
}

/* ---------- Casos: the work as an index ---------- */

.casos { padding-block: var(--section-gap-s) var(--section-gap); }
.table-wrap { margin-top: var(--space-2xl); overflow-x: auto; }
.index { width: 100%; min-width: 720px; border-collapse: collapse; }
.index th, .index td { text-align: left; vertical-align: top; padding: var(--space-lg) var(--space-lg) var(--space-lg) 0; border-bottom: 1px solid var(--color-rule); }
.index thead th { padding-block: 0 var(--space-sm); font-size: var(--text-sm); font-weight: 400; color: var(--color-muted); border-bottom-color: var(--color-ink); }
.index tbody th { width: 28%; font: 600 var(--text-title)/1.25 var(--font-display); letter-spacing: -0.015em; }
.index td:nth-child(2) { color: var(--color-muted); max-width: 52ch; }
.index td:last-child { width: 18%; padding-right: 0; font-size: var(--text-sm); white-space: nowrap; }

/* ---------- Capacidades: tabbed container ---------- */

.hacemos { padding-block: var(--section-gap-s); background: var(--color-paper-2); }
.hacemos-head .lead { margin-top: var(--space-md); }
.tabs-card { margin-top: var(--space-2xl); padding: var(--space-xl); background: var(--color-tint-soft); border-radius: 32px; }
.tablist { display: none; }
.js .tablist { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-xl); }
.tablist button {
  min-height: 44px; padding: 0 var(--space-lg); border: 1px solid var(--color-tint); border-radius: 999px;
  background: var(--color-paper-2); color: var(--color-ink); font: 600 var(--text-sm)/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.tablist button:hover { border-color: var(--color-accent); }
.tablist button:active { transform: translateY(1px); }
.tablist button[aria-selected="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); align-items: center; }
.panel + .panel { margin-top: var(--space-2xl); }
.js .panel + .panel { margin-top: 0; }
.panel[hidden] { display: none; }
.panel-text { display: grid; gap: var(--space-xl); }
.panel-text dt { font: 600 var(--text-title)/1.25 var(--font-display); letter-spacing: -0.015em; }
.panel-text dd { margin-top: var(--space-xs); color: var(--color-muted); max-width: 44ch; }
@media (prefers-reduced-motion: no-preference) {
  .js .panel:not([hidden]) .sample { animation: panel-in 0.42s var(--ease-out) both; }
  @keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.sample { margin: 0; min-height: 300px; padding: var(--space-xl); background: var(--color-paper-2); border-radius: var(--radius-card); display: grid; align-content: space-between; gap: var(--space-lg); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.sample figcaption { color: var(--color-muted); padding-top: var(--space-sm); border-top: 1px dashed var(--color-rule); }

.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.pipe li { display: grid; gap: var(--space-xs); align-content: start; padding: var(--space-md); background: var(--color-paper); border-radius: var(--radius-inner); }
.pipe span { color: var(--color-muted); }
.pipe b { font: 600 var(--text-section)/1 var(--font-display); letter-spacing: -0.03em; }
.pipe i { display: block; height: 10px; border-radius: 5px; background: var(--color-rule); }
.pipe .won { background: var(--color-tint-soft); }
.pipe .won b { color: var(--color-accent); }
.pipe .won i { background: var(--color-signal); }

.docs, .audit { width: 100%; border-collapse: collapse; }
.docs th, .docs td, .audit th, .audit td { text-align: left; padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); }
.docs thead th { color: var(--color-muted); font-weight: 400; }
.docs tbody th, .audit tbody th { font-weight: 600; }
.docs td:nth-child(2) { color: var(--color-muted); }
.chip { display: inline-block; padding: var(--space-3xs) var(--space-xs); border-radius: 999px; background: var(--color-paper); color: var(--color-ink); white-space: nowrap; }
.chip.ok { background: var(--color-tint-soft); color: var(--color-accent); font-weight: 600; }
.chip.wait { background: var(--color-warn-soft); color: var(--color-warn); font-weight: 600; }

.chat { display: grid; gap: var(--space-xs); font-size: var(--text-md); line-height: 1.45; }
.chat li { max-width: 80%; padding: var(--space-xs) var(--space-sm); border-radius: 14px; }
.chat .in { justify-self: start; background: var(--color-paper); border-bottom-left-radius: var(--space-2xs); }
.chat .out { justify-self: end; background: var(--color-tint-soft); border-bottom-right-radius: var(--space-2xs); }
.chat .handoff { justify-self: center; max-width: none; padding: var(--space-2xs) var(--space-sm); font-size: var(--text-sm); color: var(--color-accent); font-weight: 600; border: 1px solid var(--color-tint); border-radius: 999px; }

.audit-q { font: 600 var(--text-title)/1.2 var(--font-display); }
.audit td:last-child { color: var(--color-accent); font-weight: 600; text-align: right; padding-right: 0; }
.audit .bad th, .audit .bad td { background: var(--color-warn-soft); color: var(--color-warn); }
.audit .bad th { padding-left: var(--space-xs); }

/* ---------- Statement band ---------- */

.statement { padding-block: var(--section-gap-s); background: var(--color-ink); color: var(--color-dark-text); }
.statement-text { font: 600 var(--text-display-s)/1.08 var(--font-display); letter-spacing: -0.03em; max-width: 22ch; text-wrap: balance; }
.statement-note { margin-top: var(--space-lg); color: var(--color-dark-muted); max-width: 52ch; }

/* ---------- Proceso: the loop, a diagram of the real process ---------- */

.proceso { padding-block: var(--section-gap); }
.proceso-lead { margin-top: var(--space-md); }
@media (min-width: 60.0625rem) { .proceso .loop { margin-top: var(--space-2xl); } }
.loop { --top: 170px; --bot: 360px; --edge: 9%; position: relative; margin-top: var(--space-xl); }
.loop-steps h3 { font-size: var(--text-title); }
.loop-steps p { margin-top: var(--space-2xs); color: var(--color-muted); }
.node {
  display: grid; place-items: center; flex: none; width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid var(--color-accent); background: var(--color-paper); color: var(--color-accent);
  font: 600 var(--text-lead)/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.fw .node { background: var(--color-accent); color: var(--color-accent-ink); }
.evo .node { border-color: var(--color-signal); }
.loop-note-left { color: var(--color-muted); }
.loop-note-right { display: flex; gap: var(--space-sm); align-items: center; font: 600 var(--text-title)/1.25 var(--font-display); color: var(--color-accent); }
.spark { flex: none; fill: var(--color-signal); }

@media (min-width: 60.0625rem) {
  .loop { height: 480px; }
  .loop-track {
    position: absolute; z-index: 1; left: var(--edge); right: var(--edge); top: var(--top); height: calc(var(--bot) - var(--top));
    border: 3px solid var(--color-rule); border-radius: 999px;
  }
  .loop-framework {
    position: absolute; z-index: 0; left: 75%; right: calc(var(--edge) - 6px); top: calc(var(--top) - 6px); height: calc(var(--bot) - var(--top) + 12px);
    border: 15px solid var(--color-tint-soft); border-left: 0; border-radius: 0 999px 999px 0;
  }
  .loop-framework-low { position: absolute; z-index: 0; left: 50%; width: 25%; top: calc(var(--bot) - 9px); height: 15px; background: var(--color-tint-soft); }
  .loop-arrow { position: absolute; z-index: 2; width: 18px; height: 14px; background: var(--color-accent); transform: translate(-50%, -50%); top: calc((var(--top) + var(--bot)) / 2); }
  .loop-arrow-up { left: calc(var(--edge) + 1.5px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  .loop-arrow-down { left: calc(100% - var(--edge) - 1.5px); clip-path: polygon(0 0, 100% 0, 50% 100%); }

  .loop-steps li { position: absolute; z-index: 3; width: 16rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; }
  .loop-steps .s1, .loop-steps .s6 { left: 25%; }
  .loop-steps .s2, .loop-steps .s5 { left: 50%; }
  .loop-steps .s3, .loop-steps .s4 { left: 75%; }
  .loop-steps .s1, .loop-steps .s2, .loop-steps .s3 { bottom: calc(100% - var(--top) - 31.5px); }
  .loop-steps .s1 .node, .loop-steps .s2 .node, .loop-steps .s3 .node { order: 3; margin-top: var(--space-md); }
  .loop-steps .s4, .loop-steps .s5, .loop-steps .s6 { top: calc(var(--bot) - 31.5px); }
  .loop-steps .s4 .node, .loop-steps .s5 .node, .loop-steps .s6 .node { margin-bottom: var(--space-md); }

  .loop-note { position: absolute; z-index: 3; top: calc((var(--top) + var(--bot)) / 2); transform: translateY(-50%); }
  .loop-note-left { left: calc(var(--edge) + 56px); max-width: 15ch; font-size: var(--text-lead); line-height: 1.35; }
  .loop-note-right { right: calc(var(--edge) + 72px); max-width: 16ch; }
}

/* ---------- Auditoría: the close, quiet ---------- */

.auditoria { padding-block: var(--section-gap-s); background: var(--color-paper-2); }
.auditoria-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl) var(--space-3xl); }
.auditoria .lead { margin-top: var(--space-md); max-width: 40ch; }
.audit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl) var(--gap-columns); }
.audit-list > div { padding-top: var(--space-md); border-top: 2px solid var(--color-ink); }
.audit-list dt { font: 600 var(--text-title)/1.25 var(--font-display); letter-spacing: -0.015em; }
.audit-list dd { margin-top: var(--space-xs); color: var(--color-muted); max-width: 36ch; }
.audit-contact { grid-column: 1 / -1; padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }

/* ---------- Footer: statement ---------- */

.site-footer { padding-block: var(--space-3xl) var(--space-xl); background: var(--color-ink); color: var(--color-dark-muted); font-size: var(--text-sm); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-xl); align-items: start; }
.footer-brand img { height: 40px; width: auto; }
.footer-brand p { margin-top: var(--space-lg); font: 600 var(--text-title)/1.3 var(--font-display); color: var(--color-dark-text); max-width: 28ch; }
.footer-nav { display: grid; gap: var(--space-xs); justify-items: start; }
.footer-nav a { color: var(--color-dark-muted); text-decoration: none; font-size: var(--text-md); }
.footer-btn { padding: 0; border: 0; background: none; color: var(--color-dark-muted); font: 400 var(--text-md)/1.6 var(--font-body); text-decoration: underline; cursor: pointer; }
.footer-btn:hover { color: var(--color-tint); }
.footer-nav a:hover { color: var(--color-tint); text-decoration: underline; }
.footer-legal { margin-top: var(--space-3xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-dark-rule); }

/* ---------- Mascota: un personaje que camina por el borde de abajo ---------- */

.mascota {
  --mascota-black: #0B0D0B; --mascota-stalk: #1D2220;
  position: fixed; z-index: 500; left: 0; bottom: 0; width: 104px; pointer-events: none; will-change: transform;
}
.mascota-body { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mascota-body:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 24px; }
.m-svg { display: block; width: 100%; height: auto; overflow: visible; }
.m-svg * { transform-box: view-box; }
.m-black { fill: var(--mascota-black); }
.m-stalk-rim { fill: none; stroke: #4F5B56; stroke-width: 6.5; stroke-linecap: round; }
.m-stalk { fill: none; stroke: #1D2220; stroke-width: 4; stroke-linecap: round; }
.m-line { fill: none; stroke: var(--mascota-black); stroke-width: 3.5; stroke-linecap: round; }
.m-shadow { fill: var(--color-ink); opacity: 0.12; }
.m-flip { transform-origin: 60px 150px; }
.mascota.face-left .m-flip { transform: scaleX(-1); }
.m-all { transform-origin: 60px 143px; }
.m-eyes-in { transform-origin: 60px 62px; }
.m-arm-l { transform-origin: 34px 102px; }
.m-leg-l { transform-origin: 47px 127px; }
.m-leg-r { transform-origin: 73px 127px; }
.m-arm-r { transform-origin: 86px 102px; }
.m-eyes-happy, .m-eyes-closed, .m-giggle, .m-zzz { opacity: 0; }
.m-zzz { font: 600 12px var(--font-display); fill: var(--color-muted); }
:is(.mascota, .mascota-hang).is-tickle .m-eyes-open, :is(.mascota, .mascota-hang).is-sleep .m-eyes-open { opacity: 0; }
:is(.mascota, .mascota-hang).is-tickle .m-eyes-happy, :is(.mascota, .mascota-hang).is-tickle .m-giggle { opacity: 1; }
:is(.mascota, .mascota-hang).is-sleep:not(.is-tickle) .m-eyes-closed, :is(.mascota, .mascota-hang).is-sleep .m-zzz { opacity: 1; }
.mascota-close {
  position: absolute; top: 0; right: -4px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--color-rule); border-radius: 50%; background: var(--color-paper-2); color: var(--color-muted);
  font: 400 var(--text-md)/1 var(--font-body); cursor: pointer; pointer-events: auto;
  opacity: 0; transition: opacity var(--dur-short) var(--ease-out);
}
.mascota:hover .mascota-close, .mascota:focus-within .mascota-close { opacity: 1; }
.mascota-close:hover { color: var(--color-ink); }
@media (hover: none) { .mascota-close { opacity: 0.85; } }

@media (prefers-reduced-motion: no-preference) {
  /* Respira cuando está quieta */
  .m-all { animation: m-breathe 3.4s ease-in-out infinite; }
  @keyframes m-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 0.985); } }
  /* Camina: se balancea y alterna los pies */
  :is(.mascota, .mascota-hang).is-walking .m-all { animation: m-waddle 0.42s ease-in-out infinite; }
  @keyframes m-waddle { 0%, 100% { transform: rotate(-4deg) translateY(0); } 25% { transform: rotate(0) translateY(-3px); } 50% { transform: rotate(4deg) translateY(0); } 75% { transform: rotate(0) translateY(-3px); } }
  :is(.mascota, .mascota-hang).is-walking .m-leg-l { animation: m-step 0.42s ease-in-out infinite; }
  :is(.mascota, .mascota-hang).is-walking .m-leg-r { animation: m-step 0.42s ease-in-out -0.21s infinite; }
  @keyframes m-step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  :is(.mascota, .mascota-hang).is-walking .m-arm-l { animation: m-swing 0.42s ease-in-out infinite; }
  :is(.mascota, .mascota-hang).is-walking .m-arm-r { animation: m-swing 0.42s ease-in-out -0.21s infinite; }
  @keyframes m-swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
  /* Parpadea */
  :is(.mascota, .mascota-hang).is-blink .m-eyes-in { transform: scaleY(0.12); }
  .m-eyes-in { transition: transform 70ms linear; }
  /* Saluda con la mano derecha */
  :is(.mascota, .mascota-hang).is-wave .m-arm-r { animation: m-wave 1.3s var(--ease-out); }
  @keyframes m-wave { 0% { transform: rotate(0); } 18% { transform: rotate(-140deg); } 32% { transform: rotate(-110deg); } 46% { transform: rotate(-145deg); } 60% { transform: rotate(-110deg); } 74% { transform: rotate(-140deg); } 100% { transform: rotate(0); } }
  /* Cosquillas: se retuerce y se aplasta de risa */
  :is(.mascota, .mascota-hang).is-tickle .m-all { animation: m-tickle 0.9s ease-in-out; }
  @keyframes m-tickle {
    0% { transform: scale(1, 1) rotate(0); } 12% { transform: scale(1.1, 0.88) rotate(-6deg); } 24% { transform: scale(0.95, 1.06) rotate(6deg); }
    36% { transform: scale(1.08, 0.9) rotate(-5deg); } 48% { transform: scale(0.97, 1.04) rotate(5deg); } 62% { transform: scale(1.04, 0.95) rotate(-3deg); }
    78% { transform: scale(1, 1) rotate(2deg); } 100% { transform: scale(1, 1) rotate(0); }
  }
  :is(.mascota, .mascota-hang).is-tickle .m-arm-l, :is(.mascota, .mascota-hang).is-tickle .m-arm-r { animation: m-flail 0.18s ease-in-out 5 alternate; }
  @keyframes m-flail { from { transform: rotate(-25deg); } to { transform: rotate(25deg); } }
  :is(.mascota, .mascota-hang).is-tickle .m-giggle { animation: m-giggle 0.15s steps(2) infinite; }
  @keyframes m-giggle { 50% { opacity: 0.2; } }
  /* Tres toques seguidos: salta */
  :is(.mascota, .mascota-hang).is-jump .m-flip { animation: m-jump 0.65s cubic-bezier(0.3, 0.7, 0.4, 1); }
  :is(.mascota, .mascota-hang).is-jump.face-left .m-flip { animation-name: m-jump-left; }
  @keyframes m-jump { 0% { transform: translateY(0) scale(1.1, 0.88); } 40% { transform: translateY(-46px) scale(0.94, 1.08); } 75% { transform: translateY(0) scale(1.08, 0.92); } 100% { transform: translateY(0) scale(1, 1); } }
  @keyframes m-jump-left { 0% { transform: scaleX(-1) translateY(0) scale(1.1, 0.88); } 40% { transform: scaleX(-1) translateY(-46px) scale(0.94, 1.08); } 75% { transform: scaleX(-1) translateY(0) scale(1.08, 0.92); } 100% { transform: scaleX(-1); } }
  /* Se despierta con un saltito */
  :is(.mascota, .mascota-hang).is-hop .m-all { animation: m-hop 0.45s var(--ease-out); }
  @keyframes m-hop { 0% { transform: translateY(0) scale(1.06, 0.94); } 45% { transform: translateY(-12px) scale(0.97, 1.03); } 100% { transform: none; } }
  /* Duerme: respira lento y suben las zetas */
  :is(.mascota, .mascota-hang).is-sleep .m-all { animation: m-breathe 4.8s ease-in-out infinite; }
  :is(.mascota, .mascota-hang).is-sleep .m-zzz text { animation: m-z 2.4s ease-out infinite; }
  :is(.mascota, .mascota-hang).is-sleep .m-zzz text:nth-child(2) { animation-delay: 0.8s; }
  :is(.mascota, .mascota-hang).is-sleep .m-zzz text:nth-child(3) { animation-delay: 1.6s; }
  @keyframes m-z { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -8px); } }
  :is(.mascota, .mascota-hang).paused * { animation-play-state: paused; }
}
@media (max-width: 40rem) {
  .mascota { width: 76px; }
}

/* Versión 3D: un lienzo del mismo tamaño que el dibujo, que queda de respaldo sin WebGL */
.m-canvas { display: block; width: 100%; aspect-ratio: 4 / 5; }
.mascota-hang .m-canvas { aspect-ratio: 2 / 3; }
.is-3d .m-svg { display: none; }
.m-z3 { display: none; }
.is-3d.is-sleep .m-z3 { display: block; position: absolute; right: 2px; top: 8px; font: 600 13px var(--font-display); color: var(--color-muted); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .is-3d.is-sleep .m-z3 i { display: inline-block; font-style: normal; animation: m-z 2.4s ease-out infinite; }
  .is-3d.is-sleep .m-z3 i:nth-child(2) { animation-delay: 0.8s; font-size: 15px; }
  .is-3d.is-sleep .m-z3 i:nth-child(3) { animation-delay: 1.6s; font-size: 17px; }
}

/* Versión fotos: la mascota hecha con los renders del equipo (js/mascota/fotos.js).
   La foto es más ancha que el cuerpo: la caja es la columna del cuerpo y la foto sobresale a los costados. */
.is-foto .m-svg { display: none; }
.mascota.is-foto { width: 92px; }
.mascota-hang.is-foto { width: 96px; }
.m-fotos { display: block; position: relative; width: 100%; aspect-ratio: 170 / 300; transform-origin: 50% 100%; }
.mascota-hang .m-fotos { transform-origin: var(--hx, 75%) var(--hy, 4%); }
.m-fotos-mov, .m-fotos-flip { position: absolute; inset: 0; transform-origin: 50% 100%; }
.mascota.face-left .m-fotos-flip { transform: scaleX(-1); }
.m-foto { position: absolute; left: -38.2%; top: 0; width: 176.5%; max-width: none; height: auto; opacity: 0; transition: opacity 0.12s linear; pointer-events: none; user-select: none; }
.m-fotos[data-pose="parado"] .m-foto[data-pose="parado"], .m-fotos[data-pose="saludo"] .m-foto[data-pose="saludo"],
.m-fotos[data-pose="risa"] .m-foto[data-pose="risa"], .m-fotos[data-pose="durmiendo"] .m-foto[data-pose="durmiendo"],
.m-fotos[data-pose="contento"] .m-foto[data-pose="contento"], .m-fotos[data-pose="espiando"] .m-foto[data-pose="espiando"],
.m-fotos[data-pose="cafe"] .m-foto[data-pose="cafe"] { opacity: 1; }
.mascota .m-fotos::before { content: ""; position: absolute; left: -6%; right: -6%; bottom: -3%; height: 8%; border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .is-foto .m-fotos-mov { animation: m-breathe-foto 3.4s ease-in-out infinite; }
  @keyframes m-breathe-foto { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 0.97); } }
  .is-foto.is-walking .m-fotos-mov { animation: m-waddle 0.42s ease-in-out infinite; }
  .is-foto.is-tickle .m-fotos-mov { animation: m-tickle 0.9s ease-in-out; }
  .is-foto.is-jump .m-fotos-mov { animation: m-jump 0.65s cubic-bezier(0.3, 0.7, 0.4, 1); }
  .is-foto.is-hop .m-fotos-mov { animation: m-hop 0.45s var(--ease-out); }
  .is-foto.is-sleep .m-fotos-mov { animation: m-breathe-foto 4.8s ease-in-out infinite; }
  .is-foto.is-wave:not(.is-walking) .m-fotos-mov { animation: m-wave-body 1.3s ease-in-out; }
  @keyframes m-wave-body { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-3deg); } }
  .m-fotos.is-change .m-foto { animation: m-pose 0.3s var(--ease-out); }
  @keyframes m-pose { 0% { transform: scale(1.06, 0.92); } 55% { transform: scale(0.97, 1.04); } 100% { transform: none; } }
  .mascota-hang.is-foto.is-in .m-fotos { animation: hang-in 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
  .mascota-hang.is-foto.is-fall .m-fotos { animation: hang-fall 0.95s cubic-bezier(0.5, 0, 0.9, 0.5) forwards; }
  .mascota-hang.is-foto.is-tickle .m-fotos-mov { animation: m-tickle 0.9s ease-in-out; }
}
@media (max-width: 40rem) { .mascota.is-foto { width: 70px; } }

/* La mascota colgada del título de "Cómo trabajamos" */
.hang-line { display: flex; align-items: flex-end; gap: var(--space-lg); }
.hang-line h2 { flex: none; }
.hang-rod { position: relative; flex: 1; min-width: 160px; height: 4px; margin-bottom: 0.55rem; border-radius: 2px; background: #34463F; }
.mascota-hang {
  --mascota-black: #0B0D0B;
  position: absolute; z-index: 5; left: 62%; top: -3px; width: 136px;
  transform: translate(calc(var(--hx, 57.5%) * -1), calc(var(--hy, 7.2%) * -1)); opacity: 0; visibility: hidden; pointer-events: none;
}
.mascota-hang .mascota-body { transform-origin: var(--hx, 57.5%) var(--hy, 7.2%); }
.mascota-hang .m-shadow { display: none; }
.mascota-hang.is-in { opacity: 1; visibility: visible; pointer-events: auto; }
.mascota.is-away .mascota-body { transform: translateY(160%); }
.mascota.is-away .mascota-close { display: none; }
.mascota .mascota-body { transition: transform 0.45s var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  .mascota-hang.is-in .m-svg { animation: hang-in 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
  @keyframes hang-in { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
  .mascota-hang .m-leg-l { animation: dangle 1.5s ease-in-out infinite; }
  .mascota-hang .m-leg-r { animation: dangle 1.5s ease-in-out -0.75s infinite; }
  @keyframes dangle { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(2px) rotate(6deg); } }
  .mascota-hang.is-tickle .m-leg-l, .mascota-hang.is-tickle .m-leg-r { animation: kick 0.16s ease-in-out 6 alternate; }
  @keyframes kick { from { transform: translateY(0) rotate(-18deg); } to { transform: translateY(-5px) rotate(18deg); } }
  .mascota-hang.is-fall .m-svg { animation: hang-fall 0.95s cubic-bezier(0.5, 0, 0.9, 0.5) forwards; }
  @keyframes hang-fall { 0% { transform: translateY(0) rotate(0); } 15% { transform: translateY(-14px) rotate(-8deg); } 100% { transform: translateY(110vh) rotate(40deg); } }
}
@media (max-width: 40rem) { .mascota-hang { display: none; } }

/* ---------- Under 60rem: everything stacks in reading order ---------- */

@media (max-width: 60rem) {
  .nav { display: none; }
  .nav-action { margin-left: auto; }
  .hero { min-height: 0; padding-block: var(--space-2xl); }
  .hero-grid, .panel, .auditoria-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .tabs-card { padding: var(--space-lg); border-radius: var(--radius-card); }
  .js .tablist { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--space-lg) * -1); padding-inline: var(--space-lg); scrollbar-width: none; }
  /* The loop becomes a vertical run */
  .loop-track, .loop-framework, .loop-framework-low, .loop-arrow { display: none; }
  .loop-steps { position: relative; display: grid; gap: var(--space-lg); }
  .loop-steps::before { content: ""; position: absolute; left: 28px; top: var(--space-lg); bottom: var(--space-lg); width: 3px; background: var(--color-rule); }
  .loop-steps li { position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: var(--space-md); align-items: center; }
  .loop-steps li .node { grid-row: 1 / span 2; }
  .loop-steps h3 { align-self: end; }
  .loop-steps p { align-self: start; margin-top: 0; }
  .loop-note { margin-top: var(--space-lg); }
}
@media (max-width: 40rem) {
  .board { padding: var(--space-lg); }
  .board-goal { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
  .board-goal > div { padding-left: 0; border-left: 0; }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample { padding: var(--space-lg); }
  .audit-list { grid-template-columns: minmax(0, 1fr); }
  /* The index restacks as labelled blocks so the project name stays in view */
  .index { min-width: 0; }
  .index thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .index tr { display: grid; padding-block: var(--space-md); border-bottom: 1px solid var(--color-rule); }
  .index th, .index td, .index tbody th, .index td:last-child { display: block; width: auto; padding: 0; border: 0; white-space: normal; }
  .index td:nth-child(2) { margin-top: var(--space-xs); }
  .index td:last-child { margin-top: var(--space-xs); color: var(--color-accent); font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .site-header, .tablist button, .mascota-close, .orbit-chips button, .js .view, .js .view.is-active { transition: none; }
}

/* ---------- Ajustes del tema oscuro sobre los componentes ---------- */

.btn { border-radius: 999px; padding-inline: 28px; }
.btn-quiet { border: 1.5px solid oklch(96% 0.005 165 / 0.5); }
.btn-quiet:hover { background: var(--color-paper-2); border-color: var(--color-ink); }
.skip { background: var(--color-accent); color: var(--color-accent-ink); }
.pipe li, .chip, .chat .in { background: var(--color-paper-3); }
.board { border-color: var(--color-rule); }

/* Bandas: las superficies flotan como tarjetas grandes sobre el fondo */
.hacemos, .auditoria { margin-inline: clamp(8px, 1.6vw, 24px); border-radius: var(--radius-big); }
.statement { margin: var(--space-md) clamp(8px, 1.6vw, 24px); border-radius: var(--radius-big); background: var(--color-signal); color: #0F1714; }
.statement-note { color: #11352C; }
.tabs-card { background: var(--color-paper); }
.sample { background: var(--color-paper-2); }
.tablist button { background: var(--color-paper-2); }
.tablist button[aria-selected="true"], .orbit-chips button[aria-pressed="true"] { background: var(--color-signal); border-color: var(--color-signal); color: #0F1714; }

/* Proceso sobre oscuro */
.loop-track { border-color: #34463F; }
.loop-steps::before { background: #34463F; }

.site-footer { background: var(--color-footer); }

/* La mascota sobre oscuro: sombra real y un borde de luz como en el render */
.m-shadow { fill: #000; opacity: 0.45; }
.m-svg { filter: drop-shadow(0 0 5px oklch(72% 0.13 165 / 0.22)); }
.mascota-close { background: var(--color-paper-2); border-color: var(--color-rule); }
