/* ==========================================================================
   Miguel Guevara — Portafolio v2
   Portafolio v3 · Concepto: "hoja de especificación" a color, con escenas de scroll. Papel cálido, tinta y cuadrícula
   técnica; cada capítulo tiene su tono (clases .tone-*), solo tema claro.
   ========================================================================== */

/* Fuentes alojadas en el propio servidor (licencia OFL): sin peticiones a Google */
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/geist-normal-400-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('../fonts/geist-mono-normal-400-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-italic-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #f4f2ed;
    --bg-alt: #ebe8e1;
    --surface: #fbfaf7;
    --ink: #151513;
    --ink-2: #45443f;
    --ink-3: #6f6d66;           /* 4,6:1 sobre papel (WCAG AA) */
    --line: #d9d5cb;
    --line-strong: #c3beb1;
    /* Paleta */
    --c-paper: #f4f2ed;
    --c-ink: #151513;
    --c-orange: #ff5b22;
    --c-cobalt: #2e46f0;
    --c-lilac: #c9b8ff;
    --c-lime: #d7f25c;
    --c-sun: #ffd23f;

    --accent: #ed5520;          /* naranja apenas más oscuro: 3,2:1 en títulos sobre papel */
    --accent-ink: #c2410c;       /* versión con contraste AA para texto */
    --accent-soft: rgba(255, 91, 34, 0.12);
    --ok: #1f8a4c;
    --grid: rgba(21, 21, 19, 0.05);
    --shadow: 0 1px 2px rgba(21, 21, 19, 0.04), 0 12px 32px -12px rgba(21, 21, 19, 0.18);
    --on-accent: #ffffff;

    --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
    --font-serif: 'Instrument Serif', Georgia, serif;

    --radius: 14px;
    --radius-sm: 8px;
    --gutter: 24px;
    --header-h: 68px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

/* Tonos por capítulo: redefinen los tokens, los componentes se adaptan solos
   ========================================================================== */
.tone-cobalt {
    --bg: var(--c-cobalt);
    --bg-alt: #2639d6;
    --surface: #3b53f6;
    --ink: #ffffff;
    --ink-2: rgba(255, 255, 255, 0.84);
    --ink-3: rgba(255, 255, 255, 0.8);
    --line: rgba(255, 255, 255, 0.2);
    --line-strong: rgba(255, 255, 255, 0.4);
    --accent: var(--c-sun);
    --accent-ink: #ffd54b;     /* amarillo un punto más claro: 4,5:1 en texto pequeño */
    --accent-soft: rgba(255, 210, 63, 0.18);
    --grid: rgba(255, 255, 255, 0.07);
}

.tone-lilac {
    --bg: var(--c-lilac);
    --bg-alt: #bba8fa;
    --surface: #f5f1ff;
    --ink: #17132b;
    --ink-2: #3a3360;
    --ink-3: #504877;
    --line: rgba(23, 19, 43, 0.14);
    --line-strong: rgba(23, 19, 43, 0.28);
    --accent: var(--c-cobalt);
    --accent-ink: #2335c9;
    --accent-soft: rgba(46, 70, 240, 0.12);
    --grid: rgba(23, 19, 43, 0.06);
}

.tone-lime {
    --bg: var(--c-lime);
    --bg-alt: #c9e64a;
    --surface: #f5fbd8;
    --ink: #141a06;
    --ink-2: #38411a;
    --ink-3: #59632f;
    --line: rgba(20, 26, 6, 0.15);
    --line-strong: rgba(20, 26, 6, 0.3);
    --accent: var(--c-cobalt);
    --accent-ink: #2335c9;
    --accent-soft: rgba(46, 70, 240, 0.12);
    --ok: #1a7a3e;
    --grid: rgba(20, 26, 6, 0.06);
}

.tone-sun {
    --bg: var(--c-sun);
    --bg-alt: #f5c52a;
    --surface: #fff3c4;
    --ink: #1c1604;
    --ink-2: #4a3d0d;
    --ink-3: #6e5c1c;
    --line: rgba(28, 22, 4, 0.16);
    --line-strong: rgba(28, 22, 4, 0.3);
    --accent-ink: #aa3109;
    --grid: rgba(28, 22, 4, 0.06);
}

.tone-orange {
    --bg: var(--c-orange);
    --bg-alt: #f04d15;
    --surface: #ff7a4d;
    --ink: #1a0a02;
    --ink-2: rgba(26, 10, 2, 0.8);
    --ink-3: rgba(26, 10, 2, 0.8);
    --line: rgba(26, 10, 2, 0.18);
    --line-strong: rgba(26, 10, 2, 0.4);
    --accent: #ffffff;           /* títulos grandes en blanco (3,1:1, válido en texto grande) */
    --accent-ink: #1a0a02;       /* texto pequeño de acento (números de paso): tinta, 6,2:1 */
    --grid: rgba(255, 255, 255, 0.1);
}

.tone-grey {
    --bg: #e3e1db;
    --bg-alt: #d9d6cf;
    --surface: #f1efea;
    --ink: #262624;
    --ink-2: #51504b;
    --ink-3: #63625d;
    --line: rgba(38, 38, 36, 0.14);
    --line-strong: rgba(38, 38, 36, 0.28);
    --accent: #6b6a64;
    --accent-ink: #4a4944;
    --accent-soft: rgba(38, 38, 36, 0.08);
    --grid: rgba(38, 38, 36, 0.05);
}

/* Negro de corte: solo para la entrada al caso (no es un tema oscuro) */
.tone-ink {
    --bg: #121211;
    --bg-alt: #1b1b19;
    --surface: #1f1f1d;
    --ink: #f4f2ed;
    --ink-2: rgba(244, 242, 237, 0.78);
    --ink-3: rgba(244, 242, 237, 0.55);
    --line: rgba(244, 242, 237, 0.14);
    --line-strong: rgba(244, 242, 237, 0.3);
    --accent: var(--c-orange);
    --accent-ink: var(--c-orange);
    --grid: rgba(244, 242, 237, 0.05);
}

[class*="tone-"] {
    background-color: var(--bg);
    color: var(--ink);
}

/* Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

/* Reglas de Lenis (vendor/lenis.css, v1.3.26) integradas para ahorrar una petición */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical],
.lenis [data-lenis-prevent-horizontal] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

.lenis.lenis-autoToggle {
  transition-property: overflow;
  transition-duration: 1ms;
  transition-behavior: allow-discrete;
}

/* Con Lenis activo, el scroll suave lo maneja motion.js */
html.has-smooth-scroll {
    scroll-behavior: auto;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-sm);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
}

em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
}

/* Botones y chips
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.2s var(--ease), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn .icon {
    transition: transform 0.25s var(--ease);
}

.btn:hover .icon {
    transform: translateX(2px);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--ink);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.btn-ghost {
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--ink);
}

.btn-sm {
    min-height: 38px;
    padding: 0 16px;
    font-size: 14px;
}

.btn-lg {
    min-height: 54px;
    padding: 0 26px;
    font-size: 16px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    background: var(--surface);
}

.chips-sm .chip {
    font-size: 11.5px;
    padding: 6px 10px;
}

/* Header
   ========================================================================== */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.header.is-scrolled {
    border-bottom-color: var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-h);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    position: relative;
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14.5px;
    color: var(--ink-2);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a.is-active {
    color: var(--ink);
    background: var(--bg-alt);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-2);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    color: var(--ink);
    border-color: var(--line-strong);
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
}

.menu-toggle {
    display: none;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

.mobile-menu {
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.mobile-menu ul {
    padding: 8px var(--gutter) 16px;
}

.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 18px;
    font-weight: 500;
    border-bottom: 1px solid var(--line);
}

.mobile-menu li:last-child a {
    border-bottom: 0;
}

/* Hero: piezas compartidas (estado, foto, spec)
   ========================================================================== */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
    pointer-events: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 12px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-2);
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--ok);
    animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-visual {
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 400px;
    padding-bottom: 230px; /* la spec queda debajo de la foto: solo roza los hombros */
}

.portrait {
    position: relative;
    aspect-ratio: 640 / 760;
    border-radius: 22px;
    overflow: hidden;
    background: var(--c-lilac);
    box-shadow: 14px 14px 0 var(--c-cobalt);
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.15) contrast(1.02);
}

.spec-window {
    position: absolute;
    z-index: 1;
    left: -64px;
    bottom: 0;
    width: 330px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-family: var(--font-mono);
    font-size: 13.5px;
    overflow: hidden;
    /* Entrada corta y suave al aparecer; después se queda quieta */
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.6s ease 0.35s, translate 0.8s var(--ease) 0.35s;
}

.hero-visual.is-visible .spec-window,
html:not(.js) .spec-window {
    opacity: 1;
    translate: 0 0;
}

.spec-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-alt);
}

.spec-dots {
    display: flex;
    gap: 5px;
}

.spec-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line-strong);
}

.spec-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-3);
}

.spec-body {
    padding: 14px 16px 16px;
    line-height: 1.55;
}

.spec-h {
    color: var(--accent-ink);
    font-weight: 500;
}

.spec-muted {
    color: var(--ink-2);
    margin-bottom: 10px;
}

.spec-list li {
    position: relative;
    padding-left: 24px;
    color: var(--ink-2);
}

.spec-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 13px;
    height: 13px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.spec-list li.done::before {
    background: var(--ok);
    border-color: var(--ok);
}

.spec-list li.done::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    width: 3px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.spec-gates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.spec-gates span {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--ok);
    background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.spec-gates span::before {
    content: '✓ ';
}

/* Instituciones */
.trusted {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 72px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.trusted-label {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

.trusted-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

.trusted-list li {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-2);
    letter-spacing: -0.01em;
}

/* Cifras
   ========================================================================== */
.stats-band {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
    padding: 36px 24px;
    border-left: 1px solid var(--line);
}

.stat:first-child {
    border-left: 0;
    padding-left: 0;
}

.stat-number {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 10px;
    font-size: 14px;
    color: var(--ink-3);
    max-width: 22ch;
}

/* Secciones
   ========================================================================== */
.section {
    padding: 120px 0;
}

.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 760px;
    margin-bottom: 56px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
}

.section-label span {
    color: var(--accent-ink);
}

.section-label span::after {
    content: '/';
    margin-left: 10px;
    color: var(--line-strong);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.08;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.section-title em {
    color: var(--accent);
    font-size: 1.06em;
}

.section-intro {
    margin-top: 20px;
    font-size: 17.5px;
    color: var(--ink-2);
    max-width: 62ch;
}

.block-label {
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
}

/* Herramientas del método */
.toolkit {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 56px;
    padding: 22px 24px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
}

.toolkit-label {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

/* Proyectos */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.work-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.25s ease;
}

.work-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.work-cover {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 120px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--bg);
}

.work-cover-name {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--line-strong);
}

.work-cover[class*="tone-"] {
    background:
        linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--bg);
}

.work-cover[class*="tone-"] .work-cover-name {
    color: var(--ink);
}

.work-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
    padding: 24px 26px 26px;
}

.work-kind {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-ink);
}

.work-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: -6px;
}

.work-points {
    display: grid;
    align-content: start;
    gap: 8px;
    flex-grow: 1;
}

.work-points li {
    display: flex;
    gap: 10px;
    font-size: 14.5px;
    color: var(--ink-2);
}

.work-points .icon {
    margin-top: 4px;
    color: var(--ok);
}

/* Trayectoria */
.timeline {
    border-top: 1px solid var(--line);
}

.job {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 32px;
    padding: 36px 0;
    border-bottom: 1px solid var(--line);
}

.job-years {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-3);
    padding-top: 4px;
}

.job-role {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.badge-now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--ok);
    background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.job-company {
    margin-top: 4px;
    font-size: 15px;
    color: var(--accent-ink);
    font-weight: 500;
}

.job-text {
    margin: 12px 0 16px;
    max-width: 70ch;
    color: var(--ink-2);
    font-size: 15.5px;
}

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.service {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.25s ease, transform 0.35s var(--ease);
}

.service:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.service-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 22px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.service-icon .icon {
    width: 22px;
    height: 22px;
}

.service h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.service p {
    font-size: 15px;
    color: var(--ink-2);
}

.stack {
    margin-top: 20px;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
}

.lab-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    font-size: 15px;
    transition: color 0.2s ease;
}

.lab-list a .icon {
    margin-left: auto;
    color: var(--ink-3);
    transition: transform 0.25s var(--ease), color 0.2s ease;
}

.lab-list a:hover {
    color: var(--accent-ink);
}

.lab-list a:hover .icon {
    color: var(--accent-ink);
    transform: translate(2px, -2px);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    flex-shrink: 0;
}

/* Laboratorio */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

/* Proyectos en vivo: bloque a todo el ancho, la lista crece en columnas */
.lab {
    margin-top: 20px;
}

.lab-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 24px;
    margin-bottom: 8px;
}

.lab-head .block-label {
    margin-bottom: 0;
}

.lab-intro {
    font-size: 14.5px;
    color: var(--ink-2);
}

.lab-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
}

.lab-note {
    padding: 2px 8px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
    color: var(--ink-2);
    background: var(--bg-alt);
}

.tool,
.lab {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 22px;
    border-radius: 11px;
    background: var(--ink);
    color: var(--bg);
}

.tool-icon .icon {
    width: 22px;
    height: 22px;
}

.tool h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.tool p {
    flex-grow: 1;
    margin-bottom: 18px;
    font-size: 15px;
    color: var(--ink-2);
}

.lab {
    border-style: solid;
    border-color: var(--line);
    background: var(--surface);
}

.lab .block-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* De dirigir equipos a dirigir agentes: tabla espejo */
.shift-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.shift-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    align-items: stretch;
    border-top: 1px solid var(--line);
}

.shift-row:first-child {
    border-top: 0;
}

.shift-row p {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 24px;
    font-size: 16.5px;
    color: var(--ink-2);
}

.shift-row p:last-child {
    font-weight: 500;
    color: var(--ink);
    background: var(--accent-soft);
}

.shift-arrow {
    display: grid;
    place-items: center;
    color: var(--accent-ink);
}

.shift-arrow .icon {
    width: 18px;
    height: 18px;
}

.shift-head {
    background: var(--ink);
}

.shift-head p,
.shift-head p:last-child {
    font-size: 18px;
    font-weight: 600;
    color: var(--bg);
    background: transparent;
}

.shift-head .shift-arrow {
    color: var(--c-orange);
}

.shift-years {
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.shift-constant {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    margin-top: 28px;
}

.shift-constant .block-label {
    margin-bottom: 0;
}

/* Stack completo dentro de la trayectoria */
#stack.stack {
    margin-top: 64px;
    padding: 32px;
}

.stack-title {
    margin-bottom: 24px;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.stack-title em {
    color: var(--accent);
}

.stack-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
}

.stack-group {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.stack-group dt {
    padding-top: 5px;
    font-size: 14.5px;
    font-weight: 600;
}

/* Contacto */
.contact {
    padding-bottom: 96px;
}

.contact-panel {
    position: relative;
    padding: clamp(36px, 6vw, 80px);
    border-radius: 24px;
    overflow: hidden;
}

.contact-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
    -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
    pointer-events: none;
}

.contact-panel > * {
    position: relative;
}

.contact-panel .section-label {
    color: var(--ink-3);
}

.contact-panel .section-label span::after {
    color: var(--line-strong);
}

.contact-title {
    max-width: 20ch;
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    line-height: 1.06;
    font-weight: 600;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.contact-title em {
    display: block;
    color: var(--accent);
}

.contact-text {
    max-width: 56ch;
    margin-top: 22px;
    font-size: 17.5px;
    color: var(--ink-2);
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.contact-panel .btn-primary:hover {
    background: #ffffff;
    color: var(--ink);
}

.contact-panel .btn-ghost {
    font-family: var(--font-mono);
    font-size: 14px;
    max-width: 100%;
}

.copy-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 36px;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    transition: opacity 0.2s ease;
}

.contact-links a:hover {
    opacity: 0.7;
}

.contact-links .icon {
    width: 18px;
    height: 18px;
}

.contact-note {
    margin-top: 28px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-3);
}

/* Footer */
.footer {
    padding: 28px 0 36px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    font-size: 14px;
    color: var(--ink-3);
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 12.5px;
}

/* Animación de entrada
   ========================================================================== */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   v3 · ① Hero: tipografía gigante y estática (el protagonismo es del caso)
   ========================================================================== */
.cine {
    position: relative;
}

.cine-stage {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 40px) 0 56px;
    overflow: hidden;
}

.cine-inner {
    position: relative;
}

.cine-status {
    margin-bottom: 36px;
}

.cine-title {
    display: flex;
    flex-direction: column;
    font-size: clamp(2.6rem, 12vw, 9rem);
    line-height: 0.94;
    font-weight: 600;
    letter-spacing: -0.05em;
}

/* Cada línea en su propio renglón */
.cine-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.07em;
}

.cine-word {
    display: inline-block;
}

/* Nombre y profesión: primera línea del h1, discreta (aporta el contexto para buscadores) */
.cine-kicker {
    display: block;
    margin-bottom: 0.9rem;
    font-family: var(--font-mono);
    font-size: clamp(12px, 1.1vw, 14px);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.cine-line:nth-child(3) {
    color: var(--c-cobalt);
}

.cine-punch {
    margin-top: 0.16em;
}

.cine-punch .cine-word {
    display: block;
}

.cine-punch em {
    display: block;
    max-width: 18ch;
    text-wrap: balance;
    font-size: 0.5em;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--accent);
}





/* Roles bajo la frase del hero */
.cine-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

.cine-roles li {
    padding: 8px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
}

/* Presentación */
.intro {
    position: relative;
    padding: 24px 0 0;
}

.intro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.intro-p {
    max-width: 58ch;
    margin-top: 18px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink-2);
}

.intro-lead {
    margin-top: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    line-height: 1.38;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
}

/* ==========================================================================
   v3 · Scrollytelling genérico: pasos a la izquierda, escenario fijo a la derecha
   ========================================================================== */
.scrolly {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 64px;
    align-items: start;
}

.scrolly-steps {
    grid-column: 1;
    grid-row: 1;
}

.scrolly-stage {
    position: sticky;
    top: calc(var(--header-h) + 4vh);
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    height: calc(100vh - var(--header-h) - 8vh);
}

.scrolly-step {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72vh;
    padding: 24px 0;
    transition: opacity 0.45s var(--ease);
}

/* El paso activo se marca con una línea de acento (sin atenuar el resto: todo el texto conserva su contraste) */
.motion-ready .scrolly-step {
    padding-left: 24px;
    border-left: 2px solid var(--line);
    transition: border-color 0.4s ease;
}

.motion-ready .scrolly-step.is-active {
    border-left-color: var(--accent);
}

.scrolly-step .step-num {
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-ink);
}

.scrolly-step .step-title {
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.scrolly-step .step-text {
    max-width: 40ch;
    font-size: 17.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.scrolly-step .step-artifact {
    margin-top: 20px;
}

.step-artifact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-2);
    background: var(--bg-alt);
    border: 1px solid var(--line);
}

.scrolly-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.scrolly-progress li {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--line-strong);
    transition: width 0.4s var(--ease), background-color 0.4s ease;
}

.scrolly-progress li.is-active {
    width: 44px;
    background: var(--accent);
}

/* Lienzos (tarjeta que se construye y ventana de AppControl): siempre "pantalla" clara */
.build-frame,
.app-window {
    --f-bg: #fbfaf7;
    --f-bar: #f1efe9;
    --f-ink: #151513;
    --f-ink-2: #5b5a55;
    --f-ink-3: #6b6962;          /* 4,6:1 sobre la barra y el fondo del lienzo */
    --f-line: #e2ded5;
    --f-sk: #e4e1d9;
    --f-ok: #1f8a4c;
    --f-ok-soft: #dff3e6;
    container-type: inline-size;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: var(--f-bg);
    color: var(--f-ink);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 32px 64px -24px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.bf-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2.2cqi 3cqi;
    border-bottom: 1px solid var(--f-line);
    background: var(--f-bar);
    font-family: var(--font-mono);
    font-size: max(10px, 2.1cqi);
    color: var(--f-ink-3);
}

.bf-bar .spec-dots i {
    background: var(--f-line);
}

.bf-url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bf-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--f-ok);
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

.bf-body,
.app-body {
    position: relative;
    aspect-ratio: 16 / 10.5;
}

.bf-layer,
.app-screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}

/* ② Estados de la tarjeta: 1 notas · 2 spec · 3 wireframe · 4 agentes · 5 compuertas · 6 producción */
[data-state="1"] .bf-notes,
[data-state="2"] .bf-spec,
[data-state="3"] .bf-app,
[data-state="4"] .bf-app,
[data-state="5"] .bf-app,
[data-state="6"] .bf-app,
[data-state="5"] .bf-gates {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s var(--ease), visibility 0s;
}

[data-state="6"] .bf-live {
    opacity: 1;
}

/* 1 · Notas sueltas */
.bf-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 4cqi;
    padding: 6cqi 9cqi;
}

.note {
    --r: -3deg;
    padding: 3.4cqi 3cqi;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: max(13px, 4.2cqi);
    line-height: 1.1;
    color: #1c1604;
    background: var(--c-sun);
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: rotate(var(--r)) translateY(24px) scale(0.92);
    transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

.note-2 { --r: 2.5deg; background: var(--c-lilac); transition-delay: 0.1s; }
.note-3 { --r: -1.5deg; background: var(--c-lime); transition-delay: 0.2s; }
.note-4 { --r: 3deg; background: #ffd5c2; transition-delay: 0.3s; }

[data-state="1"] .note {
    opacity: 1;
    transform: rotate(var(--r));
}

/* 2 · spec.md */
.bf-spec {
    padding: 5.5cqi 7cqi;
    font-family: var(--font-mono);
    font-size: max(10px, 2.6cqi);
    line-height: 1.75;
    color: var(--f-ink-2);
}

.bf-spec p {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.35s ease calc(var(--i) * 70ms), transform 0.35s var(--ease) calc(var(--i) * 70ms);
}

.bf-spec .is-h {
    color: #b83c0c;
    font-weight: 500;
}

[data-state="2"] .bf-spec p {
    opacity: 1;
    transform: none;
}

/* 3–6 · La interfaz */
.bf-app {
    display: grid;
    grid-template-columns: 22% minmax(0, 1fr);
}

.bf-side {
    display: flex;
    flex-direction: column;
    gap: 1.6cqi;
    padding: 4cqi 2.6cqi;
    border-right: 1px solid var(--f-line);
    background: #f4f2ed;
    transition: background-color 0.6s ease;
}

.bf-logo {
    display: grid;
    place-items: center;
    width: 7cqi;
    height: 7cqi;
    margin-bottom: 2cqi;
    border-radius: 1.6cqi;
    font-family: var(--font-mono);
    font-size: max(9px, 2.1cqi);
    font-weight: 500;
    color: #fff;
    background: var(--f-ink);
}

.bf-nav {
    padding: 1.1cqi 1.8cqi;
    border-radius: 1.4cqi;
    font-size: max(9px, 2.2cqi);
    color: var(--f-ink-2);
}

.bf-nav.is-on {
    background: #e9e6df;
    color: var(--f-ink);
    font-weight: 500;
}

.bf-main {
    display: flex;
    flex-direction: column;
    gap: 2.6cqi;
    min-width: 0;
    padding: 4cqi;
}

.bf-heading {
    font-size: max(11px, 3cqi);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.bf-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2cqi;
}

.bf-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.8cqi;
    padding: 2.2cqi;
    border: 1px solid var(--f-line);
    border-radius: 1.8cqi;
    background: #fff;
    transition: background-color 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}

.bf-kpi span {
    font-size: max(8px, 1.9cqi);
    opacity: 0.75;
}

.bf-kpi strong {
    font-size: max(10px, 2.8cqi);
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.bf-table {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--f-line);
    border-radius: 1.8cqi;
    background: #fff;
}

.bf-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr auto;
    gap: 2cqi;
    align-items: center;
    padding: 1.5cqi 2.2cqi;
    border-top: 1px solid var(--f-line);
    font-size: max(8.5px, 2.1cqi);
}

.bf-row:first-child {
    border-top: 0;
}

.bf-chip {
    padding: 0.5cqi 1.6cqi;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: max(8px, 1.8cqi);
    color: var(--f-ink-2);
    background: #eceae4;
    transition: background-color 0.6s ease, color 0.6s ease;
}

/* Esqueleto: el texto se vuelve bloque gris y luego "se rellena" en orden */
.sk {
    transition: color 0.4s ease calc(var(--i) * 70ms), background-color 0.4s ease calc(var(--i) * 70ms);
}

[data-state="3"] .sk {
    color: transparent;
    background-color: var(--f-sk);
    border-radius: 1cqi;
}

[data-state="3"] .bf-kpi,
[data-state="3"] .bf-table {
    border-style: dashed;
}

/* Cotas de plano (solo en el wireframe) */
.bf-dim {
    position: absolute;
    display: flex;
    justify-content: center;
    height: 0;
    padding-top: 2px;
    border-top: 1px solid var(--c-cobalt);
    font-family: var(--font-mono);
    font-size: max(8px, 1.7cqi);
    line-height: 1;
    color: var(--c-cobalt);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bf-dim::before,
.bf-dim::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 1px;
    height: 7px;
    background: var(--c-cobalt);
}

.bf-dim::before { left: 0; }
.bf-dim::after { right: 0; }

.dim-side { top: 1.6cqi; left: 1cqi; width: calc(22% - 2cqi); }
.dim-main { top: 1.6cqi; left: calc(22% + 1cqi); right: 1cqi; }
.dim-kpi { bottom: 2.4cqi; left: calc(22% + 4cqi); right: 4cqi; }

[data-state="3"] .bf-dim {
    opacity: 1;
}

/* Agentes trabajando */
.agent {
    position: absolute;
    padding: 0.8cqi 1.8cqi 0.8cqi 2.8cqi;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: max(8px, 1.9cqi);
    font-weight: 500;
    white-space: nowrap;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.agent::before {
    content: '';
    position: absolute;
    left: -1.2cqi;
    top: -1.2cqi;
    width: 2.6cqi;
    height: 2.6cqi;
    background: inherit;
    clip-path: polygon(0 0, 100% 45%, 45% 100%);
}

.agent-a { top: 34%; left: 34%; background: var(--c-cobalt); }
.agent-b { top: 70%; left: 58%; background: var(--c-orange); }

[data-state="4"] .agent {
    opacity: 1;
}

[data-state="4"] .agent-a { animation: agent-a 3.4s ease-in-out infinite; }
[data-state="4"] .agent-b { animation: agent-b 3s ease-in-out infinite; }

@keyframes agent-a {
    0%, 100% { transform: translate(0, 0); }
    35% { transform: translate(18cqi, -8cqi); }
    70% { transform: translate(-6cqi, 10cqi); }
}

@keyframes agent-b {
    0%, 100% { transform: translate(0, 0); }
    40% { transform: translate(-22cqi, -6cqi); }
    75% { transform: translate(-8cqi, 6cqi); }
}

/* 5 · Compuertas de calidad */
.bf-gates {
    inset: auto 4cqi 4cqi auto;
    display: flex;
    flex-direction: column;
    gap: 1.4cqi;
    width: 46%;
    padding: 3cqi;
    border-radius: 2cqi;
    background: var(--f-ink);
    color: #fff;
    font-family: var(--font-mono);
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.6);
    transform: translateY(12px);
}

[data-state="5"] .bf-gates {
    transform: none;
}

.bf-gates-title {
    font-size: max(8px, 1.9cqi);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
}

.gate {
    display: flex;
    align-items: center;
    gap: 1.6cqi;
    font-size: max(10px, 2.4cqi);
    opacity: 0;
    transition: opacity 0.3s ease calc(var(--i) * 160ms);
}

[data-state="5"] .gate {
    opacity: 1;
}

.gate-mark {
    flex-shrink: 0;
    width: 2.4cqi;
    height: 2.4cqi;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background: #3ccf7a;
}

[data-state="5"] .gate-retry .gate-mark {
    animation: gate-fix 2.2s linear forwards;
}

@keyframes gate-fix {
    0%, 55% { background: #ff5b5b; }
    60%, 100% { background: #3ccf7a; }
}

.gate-note {
    margin-left: auto;
    font-size: max(8px, 1.7cqi);
    color: rgba(255, 255, 255, 0.55);
}

/* 6 · Producción: la interfaz toma color */
[data-state="6"] .bf-side { background: var(--f-ink); }
[data-state="6"] .bf-nav { color: rgba(255, 255, 255, 0.6); }
[data-state="6"] .bf-nav.is-on { background: rgba(255, 255, 255, 0.12); color: #fff; }
[data-state="6"] .bf-logo { background: var(--c-orange); }
[data-state="6"] .kpi-a { background: var(--c-cobalt); border-color: var(--c-cobalt); color: #fff; }
[data-state="6"] .kpi-b { background: var(--c-lime); border-color: var(--c-lime); }
[data-state="6"] .kpi-c { background: var(--c-lilac); border-color: var(--c-lilac); }
[data-state="6"] .chip-0,
[data-state="6"] .chip-1 { background: var(--f-ok-soft); color: var(--f-ok); }
[data-state="6"] .chip-2 { background: #fff3c4; color: #6e5c1c; }
[data-state="6"] .chip-3 { background: #ffe1d4; color: #b83c0c; }

.build-closing {
    display: grid;
    gap: 6px;
    margin-top: 96px;
}

.build-closing p {
    font-size: clamp(1.4rem, 2.8vw, 2.3rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.build-closing p:nth-child(2) {
    color: var(--accent);
}

/* ==========================================================================
   v3 · ③ AppControl: "Antes" (gris) → corte → "Ahora" (naranja)
   ========================================================================== */
/* Entrada al caso: corte a negro, la pregunta y la llamada que interrumpe */
.case-alert {
    position: relative;
    overflow: hidden;
}

.alert-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 64px;
}

.alert-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-2);
}

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.2);
    animation: pulse-dot 1.1s ease-in-out infinite;
}

.alert-question {
    margin-top: 24px;
    font-size: clamp(5rem, 19vw, 17rem);
    line-height: 0.88;
    font-weight: 600;
    letter-spacing: -0.065em;
    color: inherit;
}

.alert-sub {
    max-width: 34ch;
    margin-top: 40px;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: var(--ink-2);
}

/* Notificación de llamada: vibra en ráfagas, como un teléfono sobre la mesa */
.call-card {
    position: absolute;
    right: var(--gutter);
    top: 50%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    width: min(400px, 100%);
    padding: 14px 16px;
    border-radius: 24px;
    background: #fbfaf7;
    color: #151513;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 40px 80px -24px rgba(0, 0, 0, 0.8);
    --call-y: 0px;
    translate: 0 var(--call-y); /* lo mueve el scroll sin pisar la vibración */
    animation: ring-shake 2.4s ease-in-out infinite;
}

@keyframes ring-shake {
    0%, 30%, 100% { transform: rotate(-3deg) translateX(0); }
    3%, 9%, 15%, 21% { transform: rotate(-4.5deg) translateX(-5px); }
    6%, 12%, 18%, 24% { transform: rotate(-1.5deg) translateX(5px); }
}

.call-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--c-lilac);
    font-weight: 600;
    font-size: 18px;
}

.call-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--c-lilac);
    border-radius: 50%;
    animation: call-ring 2.4s ease-out infinite;
}

.call-ring-2 {
    animation-delay: 0.8s;
}

@keyframes call-ring {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(2.1); opacity: 0; }
}

.call-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.call-status {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #75736b;
}

.call-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
}

.call-btn .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.call-decline {
    background: #ff3b30;
}

.call-decline .icon {
    transform: rotate(135deg);
}

.call-accept {
    background: #34c759;
}

.case-before {
    padding-top: 120px;
}

.before {
    padding: 8px 0 120px;
}

.before-stage {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 64px;
    align-items: center;
}

.before-label {
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-3);
}

.before-title {
    margin-top: 12px;
    font-size: clamp(1.8rem, 3.4vw, 2.9rem);
    line-height: 1.08;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.before-clock {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 15px;
}

.clock-face {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.clock-face::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 1px;
    width: 2px;
    height: 6px;
    background: currentColor;
    transform-origin: 1px 6px;
    animation: clock 1.6s linear infinite;
}

@keyframes clock {
    to { transform: rotate(360deg); }
}

.before-note {
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-3);
}

.evidence {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ev {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.45);
}

.ev:last-child {
    grid-column: 1 / -1;
}

.ev-art {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 66px;
    margin-bottom: 14px;
    font-size: 13px;
}

.ev-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.ev-phone::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d33b2c;
    animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
    50% { opacity: 0.25; }
}

.ev-art b {
    font-size: 17px;
    letter-spacing: -0.01em;
}

.bubble {
    align-self: flex-start;
    max-width: 85%;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 12px 12px 12px 4px;
    background: #fff;
    font-size: 12.5px;
}

.bubble.is-me {
    align-self: flex-end;
    border-radius: 12px 12px 4px 12px;
    background: #dcf5d3;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.sheet {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line-strong);
    border-left: 1px solid var(--line-strong);
    background: #fff;
}

.sheet i {
    display: grid;
    place-items: center;
    height: 20px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-style: normal;
    font-size: 11px;
}

.sheet i.is-doubt {
    background: #fff3c4;
    color: #b5340a;
    font-weight: 600;
    box-shadow: inset 0 0 0 2px #b5340a;
}

.folder {
    position: relative;
    display: block;
    margin-top: 10px;
    padding: 20px 14px 14px;
    border-radius: 3px 10px 10px 10px;
    background: #d6c7a4;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #4a3d0d;
    box-shadow: 4px 4px 0 #c4b38c, 8px 8px 0 #b3a27a;
}

.folder::before {
    content: '';
    position: absolute;
    left: 0;
    top: -9px;
    width: 40%;
    height: 10px;
    border-radius: 4px 6px 0 0;
    background: inherit;
}

.ev-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
}

.ev-clock {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: #b5340a;
}

.ev-text {
    margin-top: 4px;
    font-size: 14.5px;
    color: var(--ink-2);
}

/* Escritorio con movimiento: las evidencias se apilan como papeles sobre la mesa */
.before.is-pinned {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: calc(var(--header-h) + 24px) 0 32px;
}

.before.is-pinned .evidence {
    position: relative;
    display: block;
    height: min(560px, 66vh);
}

.before.is-pinned .ev {
    position: absolute;
    left: calc(var(--i) * 9%);
    top: calc(var(--i) * 12.5%);
    width: 60%;
}

/* El corte */
.now-cut {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 82vh;
    padding: 120px var(--gutter);
    text-align: center;
}

.now-label {
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-3);
}

.now-title {
    margin-top: 18px;
    font-size: clamp(3rem, 11vw, 10rem);
    line-height: 0.92;
    font-weight: 600;
    letter-spacing: -0.055em;
}

.now-title em {
    color: var(--accent);
}

.now-text {
    max-width: 38ch;
    margin-top: 28px;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--ink-2);
}

.case-now {
    padding-bottom: 120px;
}

/* Ventana de AppControl: estados 1 cuenta · 2 pago · 3 recibo · 4 cierre · 5 cartera */
.demo-pill {
    padding: 0.5cqi 1.6cqi;
    border-radius: 99px;
    font-size: max(8.5px, 1.8cqi);
    white-space: nowrap;
    color: #6e5c1c;
    background: #fff3c4;
}

.app-screen {
    padding: 4.5cqi 5cqi;
}

[data-state="1"] .scr-account,
[data-state="2"] .scr-account,
[data-state="3"] .scr-receipt,
[data-state="4"] .scr-close,
[data-state="5"] .scr-debt {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s var(--ease), visibility 0s;
}

.acc-head {
    display: flex;
    align-items: center;
    gap: 2.6cqi;
    margin-bottom: 4cqi;
}

.acc-avatar {
    display: grid;
    place-items: center;
    width: 8cqi;
    height: 8cqi;
    border-radius: 50%;
    background: var(--c-lilac);
    font-size: max(10px, 2.4cqi);
    font-weight: 600;
}

.acc-name {
    font-size: max(12px, 3.2cqi);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.acc-meta,
.app-caption {
    font-size: max(9px, 2.1cqi);
    color: var(--f-ink-3);
}

.app-caption {
    margin-bottom: 2.4cqi;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.months {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.8cqi;
}

.month {
    display: flex;
    flex-direction: column;
    gap: 1.2cqi;
    padding: 1.8cqi;
    border: 1px solid var(--f-line);
    border-radius: 1.6cqi;
    background: #fff;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.month b {
    font-size: max(9px, 2.2cqi);
    font-weight: 500;
}

.month i {
    height: 1.2cqi;
    min-height: 4px;
    border-radius: 99px;
    background: #3ccf7a;
    transition: background-color 0.4s ease;
}

.m-nov i {
    background: var(--f-line);
}

[data-state="1"] .m-oct {
    border-color: var(--c-orange);
    box-shadow: 0 0 0 0.6cqi rgba(255, 91, 34, 0.18);
}

[data-state="1"] .m-oct i {
    background: var(--c-orange);
}

/* En el pago, octubre pasa de pendiente a pagado cuando se "presiona" Registrar */
[data-state="2"] .m-oct {
    animation: oct-paid 1.8s steps(1) forwards;
}

[data-state="2"] .m-oct i {
    animation: oct-paid-bar 1.8s steps(1) forwards;
}

@keyframes oct-paid {
    0% { border-color: var(--c-orange); }
    100% { border-color: var(--f-ok); }
}

@keyframes oct-paid-bar {
    0% { background: var(--c-orange); }
    100% { background: #3ccf7a; }
}

.pay-modal {
    position: absolute;
    left: 5cqi;
    bottom: 4cqi;
    display: flex;
    flex-direction: column;
    gap: 1.5cqi;
    width: 46%;
    padding: 3cqi;
    border: 1px solid var(--f-line);
    border-radius: 2cqi;
    background: #fff;
    box-shadow: 0 24px 44px -16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.5s var(--ease);
}

[data-state="2"] .pay-modal {
    opacity: 1;
    transform: none;
}

.pm-title,
.rc-title {
    font-size: max(11px, 2.8cqi);
    font-weight: 600;
}

.pm-row {
    display: flex;
    justify-content: space-between;
    gap: 2cqi;
    font-size: max(9px, 2.2cqi);
}

.pm-row span {
    color: var(--f-ink-3);
}

.pm-methods {
    display: flex;
    gap: 1cqi;
}

.pm-methods span {
    flex: 1;
    padding: 1cqi 0.4cqi;
    border: 1px solid var(--f-line);
    border-radius: 1.2cqi;
    text-align: center;
    font-size: max(8px, 1.8cqi);
}

.pm-methods .is-on {
    border-color: var(--c-cobalt);
    background: rgba(46, 70, 240, 0.08);
    color: var(--c-cobalt);
    font-weight: 500;
}

.pm-btn {
    padding: 1.4cqi;
    border-radius: 1.4cqi;
    text-align: center;
    font-size: max(9px, 2.2cqi);
    font-weight: 500;
    color: #fff;
    background: var(--f-ink);
}

[data-state="2"] .pm-btn {
    animation: press 0.5s ease 1.2s;
}

@keyframes press {
    50% { transform: scale(0.94); background: var(--c-orange); }
}

.scr-receipt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3cqi;
    background: #efede7;
}

.receipt {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.3cqi;
    width: 54%;
    padding: 3.4cqi;
    border-radius: 1cqi;
    background: #fff;
    box-shadow: 0 18px 32px -14px rgba(0, 0, 0, 0.35);
    transform: translateY(28px) rotate(-1.5deg);
    transition: transform 0.7s var(--ease);
}

[data-state="3"] .receipt {
    transform: rotate(-1.5deg);
}

.rc-kicker {
    font-family: var(--font-mono);
    font-size: max(8px, 1.8cqi);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--f-ink-3);
}

.rc-title {
    margin-bottom: 0.8cqi;
}

.rc-total {
    padding-top: 1.3cqi;
    border-top: 1px dashed var(--f-line);
    font-weight: 600;
}

.rc-stamp {
    position: absolute;
    right: 3cqi;
    top: 3cqi;
    padding: 0.5cqi 1.4cqi;
    border: 2px solid var(--f-ok);
    border-radius: 1cqi;
    font-family: var(--font-mono);
    font-size: max(9px, 2.1cqi);
    font-weight: 600;
    color: var(--f-ok);
    opacity: 0;
    transform: rotate(10deg) scale(1.6);
    transition: opacity 0.25s ease 0.7s, transform 0.35s var(--ease) 0.7s;
}

[data-state="3"] .rc-stamp {
    opacity: 1;
    transform: rotate(10deg);
}

.rc-share {
    padding: 1.3cqi 2.6cqi;
    border-radius: 99px;
    font-size: max(9px, 2.1cqi);
    font-weight: 500;
    color: #0b3d1f;
    background: #4fd17f;
}

.close-row,
.debt-row {
    opacity: 0;
    transition: opacity 0.35s ease calc(var(--i) * 140ms), transform 0.45s var(--ease) calc(var(--i) * 140ms);
}

.close-row {
    display: flex;
    justify-content: space-between;
    padding: 1.7cqi 0;
    border-bottom: 1px solid var(--f-line);
    font-size: max(10px, 2.5cqi);
    transform: translateY(6px);
}

.close-total {
    border-bottom: 0;
    font-size: max(12px, 3cqi);
    font-weight: 600;
}

.close-ok {
    display: inline-flex;
    align-items: center;
    gap: 1cqi;
    margin-top: 2cqi;
    padding: 1cqi 2.4cqi;
    border-radius: 99px;
    font-size: max(10px, 2.4cqi);
    font-weight: 600;
    color: var(--f-ok);
    background: var(--f-ok-soft);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease 0.8s, transform 0.4s var(--ease) 0.8s;
}

.debt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 7em;
    gap: 3cqi;
    align-items: center;
    margin-bottom: 1.4cqi;
    padding: 1.7cqi 2.2cqi;
    border: 1px solid var(--f-line);
    border-radius: 1.4cqi;
    background: #fff;
    font-size: max(10px, 2.4cqi);
    transform: translateX(-8px);
}

.debt-row small {
    text-align: right;
    font-size: 0.85em;
    color: var(--f-ink-3);
}

.debt-row.is-cleared {
    border-color: transparent;
    background: var(--f-ok-soft);
}

.debt-row.is-cleared b,
.debt-row.is-cleared small {
    color: var(--f-ok);
}

[data-state="4"] .close-row,
[data-state="5"] .debt-row {
    opacity: 1;
    transform: none;
}

[data-state="4"] .close-ok {
    opacity: 1;
    transform: none;
}

/* Pruebas y remate del caso */
.case-proof {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    margin-top: 96px;
    padding-top: 32px;
    border-top: 1px solid var(--line-strong);
}

.case-proof dt {
    font-size: clamp(2.6rem, 5vw, 4rem);
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.case-proof dd {
    margin-top: 10px;
    font-size: 14.5px;
    color: var(--ink-2);
}

.case-closing {
    margin-top: 80px;
    font-size: clamp(2rem, 5.4vw, 4.4rem);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.case-closing em {
    color: var(--accent);
}

.case-stack {
    margin-top: 28px;
}

/* Proyectos: antes → ahora */
.work-story {
    display: grid;
    gap: 10px;
}

.work-story div {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
}

.work-story dt {
    padding-top: 3px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.work-story dd {
    font-size: 15px;
    color: var(--ink-2);
}

.work-story div:last-child dt {
    color: var(--accent-ink);
}

.work-story div:last-child dd {
    font-weight: 500;
    color: var(--ink);
}


/* Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lab-grid,
    .lab-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-proof {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    :root {
        --header-h: 62px;
    }

    .nav,
    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: grid;
    }

    .intro-layout,
    .before-stage {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-visual {
        justify-self: center;
        max-width: 340px;
        padding-bottom: 0;
    }

    /* En móvil la spec va debajo de la foto, apenas montada sobre el borde */
    .spec-window {
        position: relative;
        left: auto;
        bottom: auto;
        width: min(330px, 100%);
        margin: -48px auto 0;
    }

    .trusted {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-top: 56px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat {
        padding: 28px 20px;
    }

    .stat:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }

    .stat:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .section,
    .case-before {
        padding-top: 88px;
    }

    .section {
        padding-bottom: 88px;
    }

    /* Scrollytelling en móvil: el lienzo queda fijo arriba y los pasos pasan por debajo */
    .scrolly {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .scrolly-stage {
        top: var(--header-h);
        z-index: 2;
        grid-column: 1;
        grid-row: 1;
        height: auto;
        gap: 12px;
        padding: 12px 0 16px;
        background: var(--bg);
    }

    .scrolly-steps {
        grid-row: 2;
    }

    .scrolly-step {
        justify-content: flex-start;
        min-height: 62vh;
        padding: 32px 0;
    }

    .scrolly-step .step-text {
        font-size: 16.5px;
    }

    .toolkit {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

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

    .job {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 28px 0;
    }

    .before {
        padding-bottom: 88px;
    }

    .call-card {
        position: relative;
        right: auto;
        top: auto;
        margin-top: 36px;
    }

    .now-cut {
        min-height: 64vh;
        padding: 88px var(--gutter);
    }

    .case-now {
        padding-bottom: 88px;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 16px;
    }

    /* Oculto a la vista pero legible para lectores de pantalla: el enlace del logo conserva su nombre */
    .logo-name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .intro-p {
        font-size: 16.5px;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .services-grid,
    .evidence,
    .lab-grid,
    .lab-list,
    .stack-groups,
    .stack-group {
        grid-template-columns: 1fr;
    }

    .stack-group {
        gap: 8px;
    }

    .shift-row {
        grid-template-columns: 1fr;
    }

    .shift-row p {
        padding: 12px 18px;
    }

    .shift-arrow {
        height: 8px;
        transform: rotate(90deg);
    }

    .service,
    .stack,
    .tool,
    .lab {
        padding: 24px 20px;
    }

    .section-head {
        margin-bottom: 40px;
    }

    .contact-actions .btn {
        flex: 1 1 100%;
    }

    .contact-panel {
        border-radius: 18px;
    }

    .case-proof {
        gap: 24px;
        margin-top: 64px;
    }

    .build-closing,
    .case-closing {
        margin-top: 64px;
    }
}
