/* luis.altto.mx — v2 «papel / cianotipo»
   Hoja de dibujo técnico real: papel milimétrico claro por default,
   modo oscuro = inversión cianotipo. Paleta: tinta, azul de Prusia, blanco. */

@font-face { font-family: 'Space Grotesk'; src: url('fonts/SpaceGrotesk-var.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('fonts/DMMono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/Fraunces-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ── Tokens: PAPEL (default, claro) ────────────────── */
:root {
  --module: 28px;
  --maxw: 1176px; /* 42 módulos de 28px */
  --pad: clamp(20px, 4.5vw, 56px);

  --paper: #FAFBFD;
  --paper2: #F1F5FA;
  --panel: #FFFFFF;
  --ink: #0C1523;
  --muted: #3E4F66;
  --faint: #51637C;
  --blue: #16418A;        /* azul de delineado (Prusia) */
  --blue-strong: #0E3068;
  --blue-soft: #DCE6F5;
  --blue-mid: #7E9CC9;
  --grid: #E4EBF5;
  --grid-major: #CBD9EB;
  --line: #C7D3E4;
  --line-strong: #8FA4C0;
  --frame: #23374F;
  --term-bg: #0B1220;
  --term-ink: #D7E4F7;
  --term-accent: #8FB8F2;
  --shot-filter: none;
}

/* ── Tokens: CIANOTIPO (oscuro) ────────────────────── */
:root[data-theme="ciano"] {
  --paper: #0B2649;
  --paper2: #0A2140;
  --panel: #0F2E57;
  --ink: #EAF2FC;
  --muted: #C0D2EA;
  --faint: #93ADD1;
  --blue: #9CC3F9;
  --blue-strong: #C4DBFC;
  --blue-soft: rgba(156, 195, 249, .13);
  --blue-mid: #5B7FB4;
  --grid: rgba(214, 230, 250, .07);
  --grid-major: rgba(214, 230, 250, .14);
  --line: rgba(199, 219, 244, .22);
  --line-strong: rgba(199, 219, 244, .45);
  --frame: #B9CFEC;
  --term-bg: #061426;
  --term-ink: #D7E4F7;
  --term-accent: #8FB8F2;
  --shot-filter: saturate(.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--paper);
  /* papel milimétrico real: módulo 28px + mayor cada 5 módulos, anclado al contenedor */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px;
  background-position: calc(50% - 588px) 0, calc(50% - 588px) 0, calc(50% - 588px) 0, calc(50% - 588px) 0;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
::selection { background: var(--blue); color: var(--paper); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
.mono { font-family: 'DM Mono', ui-monospace, monospace; letter-spacing: .06em; }
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; line-height: 1.1; letter-spacing: -.015em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: fixed; top: -60px; left: 16px; z-index: 200; background: var(--blue); color: var(--paper); padding: 12px 18px; font-size: 12px; transition: top .2s; }
.skip:focus { top: 12px; text-decoration: none; }

/* logos según tema */
.ldm-white { display: none; }
:root[data-theme="ciano"] .ldm-ink { display: none; }
:root[data-theme="ciano"] .ldm-white { display: block; }

/* ── Marco de hoja con referencias de zona ─────────── */
.hoja-marco { position: fixed; inset: 8px; border: 1.5px solid var(--frame); opacity: .55; pointer-events: none; z-index: 90; display: none; }
.zona { position: absolute; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .2em; color: var(--faint); }
.zl { left: -1px; transform: translateX(-100%); padding-right: 6px; }
.zt { top: -1px; transform: translateY(-100%); padding-bottom: 4px; }
@media (min-width: 1280px) {
  .hoja-marco { display: block; inset: 22px; }
}

/* ── Nav + calibrador de progreso ──────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transform: translateY(0); transition: transform .35s ease, background-color .4s ease;
}
.nav.hide { transform: translateY(-110%); }
.nav-mark { display: flex; align-items: center; gap: 10px; color: var(--ink); letter-spacing: .2em; font-size: 13px; flex-shrink: 0; }
.nav-mark:hover { text-decoration: none; }
.nav-links { display: flex; gap: clamp(6px, 1.6vw, 18px); align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; padding: 12px 6px; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--blue); box-shadow: inset 0 -2px var(--blue); }
.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.lam-hud { color: var(--faint); font-size: 11px; letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.theme-btn {
  font-size: 10.5px; letter-spacing: .18em; color: var(--blue);
  background: var(--blue-soft); border: 1px solid var(--line-strong);
  padding: 9px 12px; cursor: pointer;
}
.theme-btn:hover { border-color: var(--blue); }
.tb-ciano { display: none; }
:root[data-theme="ciano"] .tb-papel { display: none; }
:root[data-theme="ciano"] .tb-ciano { display: inline; }
.nav-cta { border: 1.5px solid var(--ink); padding: 9px 14px; color: var(--ink); font-size: 11px; letter-spacing: .16em; }
.nav-cta:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.nav-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 28px);
}
.nav-progress span { display: block; height: 100%; width: 0%; background: var(--blue); }

/* ── Layout de hoja ────────────────────────────────── */
.sheet { position: relative; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(72px, 11vh, 126px) var(--pad); }

.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.sec-index { color: var(--faint); font-size: 12px; letter-spacing: .22em; white-space: nowrap; }
.sec-head h2 { font-size: clamp(29px, 4.4vw, 50px); font-weight: 700; }
.sec-rule { flex: 1; height: 1.5px; background: var(--line-strong); transform-origin: left; transform: scaleX(0); transition: transform 1.1s cubic-bezier(.2,.7,.2,1) .15s; }
.sec-head.in .sec-rule { transform: scaleX(1); }
.sec-sub { color: var(--muted); max-width: 62ch; margin-bottom: clamp(26px, 4.5vh, 46px); }

/* cota-medidora: la línea se traza y la etiqueta "mide" el dato de la lámina */
.sec-meter { display: flex; align-items: center; gap: 14px; margin: 2px 0 18px; }
.meter-line { flex: 0 0 clamp(60px, 12vw, 150px); height: 1.5px; background: var(--blue); position: relative; transform-origin: left; transform: scaleX(0); transition: transform .8s steps(12) .1s; }
.meter-line::before, .meter-line::after { content: ''; position: absolute; top: -5px; width: 1.5px; height: 11px; background: var(--blue); }
.meter-line::before { left: 0; } .meter-line::after { right: 0; opacity: 0; transition: opacity .1s ease .9s; }
.sec-meter.in .meter-line { transform: scaleX(1); }
.sec-meter.in .meter-line::after { opacity: 1; }
.meter-label { color: var(--blue); font-size: 11.5px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }

/* ── Hero ──────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 130px var(--pad) 90px; text-align: center; overflow: hidden;
}
.hero-inner { position: relative; max-width: 1000px; }
.eyebrow { color: var(--faint); font-size: 11.5px; letter-spacing: .24em; margin-bottom: clamp(24px, 4vh, 42px); }

.hero-name-wrap { position: relative; display: inline-block; padding: 12px clamp(6px, 3vw, 40px) 6px; }
.hero-name { font-size: clamp(40px, 8vw, 96px); font-weight: 700; text-transform: uppercase; letter-spacing: -.02em; line-height: .98; }
.hero-name span { display: block; }
.hero-name-accent { color: var(--blue); }

.dim { position: absolute; overflow: visible; }
.dim-top { left: 0; right: 0; top: -24px; width: 100%; height: 34px; }
.dim-side { right: -30px; top: 8%; height: 84%; width: 34px; display: block; }
.dim-line, .dim-tick { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.dim-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.loaded .dim-line { animation: dash 1.5s cubic-bezier(.4,0,.2,1) .4s forwards; }
.dim-tick { opacity: 0; }
.loaded .dim-tick { animation: fadein .4s ease 1.6s forwards; }
.dim-text { fill: var(--faint); font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .3em; text-anchor: middle; opacity: 0; }
.loaded .dim-text { animation: fadein .7s ease 1.9s forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

.hero-sub { max-width: 62ch; margin: clamp(24px, 4.5vh, 42px) auto 0; color: var(--muted); font-size: clamp(16px, 1.9vw, 19px); }
.hero-sub strong { color: var(--ink); font-weight: 650; }

.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: clamp(26px, 4.5vh, 44px); }
.btn { font-size: 11.5px; letter-spacing: .16em; padding: 15px 22px; border: 1.5px solid var(--ink); color: var(--ink); }
.btn:hover { text-decoration: none; }
.btn-solid { background: var(--blue); border-color: var(--blue); color: #FFFFFF; }
.btn-solid:hover { background: var(--blue-strong); border-color: var(--blue-strong); }
:root[data-theme="ciano"] .btn-solid { color: #0B2649; }
.btn-line:hover { background: var(--ink); color: var(--paper); }

.coords { position: absolute; right: clamp(18px, 4vw, 60px); bottom: 26px; color: var(--faint); font-size: 10.5px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }

.scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: var(--faint); font-size: 10px; letter-spacing: .3em;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue:hover { color: var(--muted); text-decoration: none; }
.cue-line { width: 1.5px; height: 40px; background: var(--line-strong); position: relative; overflow: hidden; display: block; }
.cue-line::after { content: ''; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--blue); animation: cuedrop 1.8s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes cuedrop { to { top: 110%; } }

/* ── Métricas ──────────────────────────────────────── */
.stats {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(48px, 8vh, 84px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1.5px solid var(--frame); border-bottom: 1.5px solid var(--frame);
}
.stat { padding: clamp(20px, 3vw, 32px) clamp(16px, 2vw, 28px); border-right: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 55%, transparent); }
.stat:last-child { border-right: 0; }
.stat-n { font-size: clamp(30px, 3.8vw, 44px); color: var(--blue); line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 13.5px; margin-top: 10px; line-height: 1.45; }

/* ── Perfil ────────────────────────────────────────── */
.perfil-grid { display: grid; grid-template-columns: 1.2fr .95fr; gap: clamp(30px, 5vw, 70px); }
.lead { font-family: 'Fraunces', serif; font-size: clamp(20px, 2.5vw, 26px); line-height: 1.42; font-weight: 470; }
.lead em { font-style: normal; color: var(--blue); font-weight: 640; }
.perfil-copy p + p { margin-top: 1.1em; }
.perfil-copy p:not(.lead) { color: var(--muted); }
.perfil-copy .lead { margin-bottom: .9em; color: var(--ink); }
.perfil-copy strong { color: var(--ink); }

.block-label { color: var(--faint); font-size: 11.5px; letter-spacing: .24em; border-bottom: 1.5px solid var(--line-strong); padding-bottom: 12px; margin-bottom: 20px; }
.edu-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.edu-item:last-child { border-bottom: 0; }
.edu-logo { flex-shrink: 0; margin-top: 2px; }
:root[data-theme="ciano"] .edu-logo { filter: brightness(0) invert(1); opacity: .92; }
.edu-dot { width: 9px; height: 9px; background: var(--blue-mid); margin: 9px 18px 0 17px; flex-shrink: 0; }
.edu-item h3 { font-size: 19px; }
.edu-meta { color: var(--faint); font-size: 11.5px; margin: 5px 0 4px; }
.edu-item p:not(.edu-meta) { color: var(--muted); font-size: 14.5px; }
.edu-star { background: var(--blue-soft); border: 1px solid var(--line); padding: 16px; margin: 0 -16px 4px; border-bottom: 1px solid var(--line); }
.beca { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ldm-logo { width: min(240px, 80%); height: auto; }
.beca span { font-size: 14px; color: var(--muted); }
.beca strong { color: var(--ink); }

/* ── Piezas: reveal "delineado" ────────────────────── */
.drafted { position: relative; border: 1px solid var(--line); }
.drafted::before, .drafted::after { content: ''; position: absolute; background: var(--blue); z-index: 1; pointer-events: none; }
.drafted::before { top: -1px; left: -1px; right: -1px; height: 1.5px; transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.3,0,.2,1); }
.drafted::after { top: -1px; left: -1px; bottom: -1px; width: 1.5px; transform: scaleY(0); transform-origin: top; transition: transform .8s cubic-bezier(.3,0,.2,1) .15s; }
.drafted.in::before { transform: scaleX(1); }
.drafted.in::after { transform: scaleY(1); }

.pieza {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center; padding: clamp(26px, 4vw, 46px);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  margin-bottom: clamp(22px, 3vh, 34px);
}
.pieza.flip .pieza-media { order: 2; }
.pieza-id { color: var(--faint); font-size: 11.5px; letter-spacing: .22em; margin-bottom: 12px; }
.pieza-body h3, .card-body h3 { font-size: clamp(22px, 2.5vw, 29px); margin-bottom: 12px; }
.pieza-body > p { color: var(--muted); font-size: 15.5px; }

.spec { list-style: none; margin: 20px 0 0; border-top: 1.5px solid var(--line-strong); }
.spec li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 12px; }
.spec li span:first-child { color: var(--faint); letter-spacing: .16em; white-space: nowrap; }
.spec li span:last-child { color: var(--ink); text-align: right; letter-spacing: .02em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips span { font-size: 11.5px; letter-spacing: .08em; padding: 6px 11px; background: var(--blue-soft); color: var(--blue); border: 1px solid var(--line); }
:root[data-theme="ciano"] .chips span { color: var(--blue); }

/* esquemático SVG */
.schematic { width: 100%; height: auto; }
.sch-node rect, .sch-hub rect { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1.2; }
.sch-hub rect { stroke: var(--blue); stroke-width: 1.6; }
.sch-node text, .sch-hub text, .sch-db text { fill: var(--muted); font-family: 'DM Mono', monospace; font-size: 12.5px; letter-spacing: .1em; text-anchor: middle; }
.sch-hub text { fill: var(--blue); }
.sch-db rect { fill: transparent; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.sch-db text { font-size: 11px; fill: var(--faint); }
.sch-links path { stroke: var(--blue); stroke-width: 1.3; opacity: .6; fill: none; stroke-dasharray: 6 7; }
.in .sch-links path { animation: schflow 1.4s linear infinite; }
@keyframes schflow { to { stroke-dashoffset: -26; } }
.sch-caption { fill: var(--faint); font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .16em; text-anchor: middle; }

/* simulación de pipeline (HTML) */
.pipe-sim { border: 1px solid var(--line); background: var(--panel); padding: clamp(16px, 2.5vw, 26px); }
.pipe-cap { color: var(--faint); font-size: 10.5px; letter-spacing: .18em; margin-bottom: 14px; }
.pipe-cap-b { margin: 14px 0 0; }
.pipe-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: etapa; }
.pipe-grid li {
  border: 1px solid var(--line-strong); padding: 12px 8px 10px; font-size: 10.5px; letter-spacing: .08em;
  color: var(--muted); position: relative; counter-increment: etapa; text-align: center;
  transition: border-color .2s steps(2), background-color .2s steps(2), color .2s steps(2);
}
.pipe-grid li::before { content: counter(etapa, decimal-leading-zero); display: block; font-size: 9px; color: var(--faint); margin-bottom: 4px; }
.pipe-grid li.done { border-color: var(--blue-mid); color: var(--faint); background: var(--blue-soft); }
.pipe-grid li.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 -3px var(--blue); }
.pipe-log { margin-top: 14px; color: var(--blue); font-size: 12px; letter-spacing: .06em; min-height: 1.6em; border-left: 3px solid var(--blue); padding-left: 12px; }

/* grid de cards */
.pieza-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: clamp(24px, 4vh, 40px); }
.card { overflow: hidden; background: color-mix(in srgb, var(--panel) 80%, transparent); display: flex; flex-direction: column; }
.card-shot { overflow: hidden; border-bottom: 1px solid var(--line); aspect-ratio: 16/10; }
.card-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: var(--shot-filter); transform: scale(1.02); transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-shot img { transform: scale(1.06); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 20px; }
.card-body p:not(.pieza-id) { color: var(--muted); font-size: 14px; flex: 1; }
.card-solo { padding-top: 24px; }
.card-link { margin-top: 10px; font-size: 11.5px; letter-spacing: .16em; color: var(--blue); display: block; padding: 12px 0 2px; }
.card .spec { margin-top: 14px; }
.card .spec li { font-size: 11px; }

/* ── Banco de pruebas (demos) ──────────────────────── */
.demo-rig { margin-bottom: clamp(30px, 5vh, 50px); }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: -1px; position: relative; z-index: 2; }
.demo-tabs button {
  font-family: 'DM Mono', monospace; font-size: 11.5px; letter-spacing: .14em;
  padding: 13px 18px; background: var(--paper2); color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-color: var(--line-strong); cursor: pointer;
}
.demo-tabs button:hover { color: var(--ink); }
.demo-tabs button[aria-selected="true"] { background: var(--panel); color: var(--blue); border-color: var(--frame); border-bottom-color: var(--panel); box-shadow: inset 0 2.5px var(--blue); }
.demo-frame { border: 1.5px solid var(--frame); background: var(--panel); }
.demo-chrome { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.demo-dot { width: 9px; height: 9px; border-radius: 50%; background: #2FA36B; flex-shrink: 0; animation: pulse 2.2s ease infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.demo-chrome a { margin-left: auto; font-size: 11px; letter-spacing: .14em; padding: 6px 2px; }
.demo-view { position: relative; height: clamp(420px, 62vh, 640px); }
.demo-view iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.demo-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 11px; letter-spacing: .22em; pointer-events: none; }
.demo-view.loaded .demo-hint { display: none; }

/* terminal */
.term-wrap { max-width: 880px; }
.term-label { color: var(--faint); font-size: 11px; letter-spacing: .18em; margin-bottom: 12px; }
.term { background: var(--term-bg); border: 1.5px solid var(--frame); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); }
.term-bar em { font-style: normal; color: rgba(255,255,255,.4); font-size: 10.5px; letter-spacing: .16em; margin-left: 8px; }
.term pre {
  padding: 18px 18px 22px; color: var(--term-ink); font-family: 'DM Mono', monospace;
  font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; min-height: 230px; margin: 0;
}
.term pre .cmd { color: var(--term-accent); }
.term-caret { display: inline-block; width: 7px; height: 14px; background: var(--term-accent); vertical-align: -2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ── Trayectoria ───────────────────────────────────── */
.tline { position: relative; padding-left: clamp(20px, 4vw, 40px); }
.tline::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1.5px; background: var(--blue-mid); }
.tentry { position: relative; display: grid; grid-template-columns: 86px 1fr; gap: clamp(14px, 3vw, 34px); padding: 22px 0; }
.tentry::before {
  content: ''; position: absolute; left: calc(-1 * clamp(20px, 4vw, 40px) - 4.5px);
  top: 34px; width: 9px; height: 9px; background: var(--paper); border: 2px solid var(--blue);
}
.tmark { color: var(--blue); font-size: 15px; padding-top: 4px; font-variant-numeric: tabular-nums; }
.tbody h3 { font-size: clamp(20px, 2.3vw, 25px); }
.tent-sub { color: var(--faint); font-size: 11.5px; letter-spacing: .18em; margin: 6px 0 10px; }
.tbody p:not(.tent-sub) { color: var(--muted); font-size: 15px; max-width: 68ch; }

/* ── Impacto ───────────────────────────────────────── */
.impacto-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(30px, 5vw, 80px); align-items: center; }
.big-num { font-size: clamp(68px, 10vw, 128px); color: var(--blue); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-num-2 { font-size: clamp(44px, 6.5vw, 80px); color: var(--ink); margin-top: 26px; opacity: .8; }
.big-label { color: var(--muted); font-size: 15px; margin-top: 6px; }
.impacto-copy .lead { margin-bottom: 24px; }
.iniciativas { list-style: none; columns: 2; gap: 28px; }
.iniciativas li { padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 15.5px; break-inside: avoid; }
.ini-n { color: var(--blue); font-size: 11px; margin-right: 12px; letter-spacing: .1em; }

/* ── Habilidades ───────────────────────────────────── */
.skills { border-top: 1.5px solid var(--frame); }
.skill-row { display: grid; grid-template-columns: 220px 1fr; gap: clamp(14px, 3vw, 40px); padding: 19px 2px; border-bottom: 1px solid var(--line); align-items: start; }
.skill-row h3 { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--faint); letter-spacing: .22em; font-weight: 400; padding-top: 7px; }
.skill-row .chips { margin-top: 0; }

/* ── Reconocimientos ───────────────────────────────── */
.awards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.award { display: flex; gap: 18px; padding: 20px 22px; background: color-mix(in srgb, var(--panel) 80%, transparent); align-items: baseline; }
.award-mark { color: var(--blue); font-size: 11.5px; letter-spacing: .16em; white-space: nowrap; }
.award h3 { font-size: 18px; }
.award p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ── Cajetín ───────────────────────────────────────── */
.titleblock { border-top: 2px solid var(--frame); background: var(--paper2); }
.tb-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; }
.tb-cell { padding: 24px clamp(18px, 2.5vw, 32px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tb-cell:nth-child(3n+1) { border-left: 1px solid var(--line); }
.tb-name { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.tb-label { color: var(--faint); font-size: 10.5px; letter-spacing: .26em; margin-bottom: 8px; }
.tb-big { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(23px, 3vw, 32px); line-height: 1.12; text-transform: uppercase; letter-spacing: -.01em; }
.tb-small { color: var(--faint); font-size: 10.5px; letter-spacing: .12em; margin-top: 12px; }
.tb-cell a { color: var(--ink); display: inline-block; padding: 6px 0; }
.tb-cell a:hover { color: var(--blue); }
.tb-cell p:not(.tb-label):not(.tb-small) { font-size: 15px; }
.tb-sellos .sellos { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 4px; }
.sellos img { filter: grayscale(1) opacity(.75); transition: filter .3s ease; }
.sellos img:hover { filter: none; }
:root[data-theme="ciano"] .sellos img { filter: brightness(0) invert(1) opacity(.8); }
:root[data-theme="ciano"] .sellos img:hover { filter: brightness(0) invert(1); }
.tb-rev { grid-column: 1 / -1; border-left: 1px solid var(--line); }
.rev { width: 100%; border-collapse: collapse; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.rev td { padding: 7px 18px 7px 0; border-bottom: 1px dashed var(--line); }
.rev tr:last-child td { border-bottom: 0; }
.rev td:first-child { color: var(--blue); white-space: nowrap; }

/* ── Reveal (con no-JS seguro) ─────────────────────── */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
html.js .drafted.reveal { transform: none; }
html.js .reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .12s; }
.d2 { transition-delay: .24s; }
.d3 { transition-delay: .36s; }
.d4 { transition-delay: .48s; }

/* ── Móvil ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .pieza, .pieza.flip { grid-template-columns: 1fr; }
  .pieza.flip .pieza-media { order: 0; }
  .pieza-grid { grid-template-columns: repeat(2, 1fr); }
  .perfil-grid, .impacto-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .awards { grid-template-columns: 1fr; }
  .tb-grid { grid-template-columns: 1fr 1fr; }
  .tb-name { grid-column: span 2; grid-row: auto; }
  .lam-hud { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .nav { padding: 10px 14px; gap: 10px; }
  .nav-links { mask-image: linear-gradient(90deg, black 82%, transparent); -webkit-mask-image: linear-gradient(90deg, black 82%, transparent); }
  .nav-links a { font-size: 11px; padding: 12px 5px; }
  .nav-cta { padding: 8px 10px; font-size: 10px; }
  .theme-btn { padding: 8px 8px; font-size: 9.5px; }
  .hero { min-height: 88svh; padding-top: 100px; }
  .cue-txt { display: none; }
  .coords { display: none; }
  .pieza-grid { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr; gap: 8px; }
  .tentry { grid-template-columns: 1fr; gap: 4px; }
  .dim-side { display: none; }
  .dim-text { display: none; }
  .dim-top { top: -14px; }
  .iniciativas { columns: 1; }
  .sec-head { flex-wrap: wrap; gap: 10px; }
  .pipe-grid { grid-template-columns: repeat(2, 1fr); }
  .pipe-grid li { font-size: 11px; padding: 12px 6px 10px; }
  .demo-view { height: 70svh; }
  .demo-tabs button { padding: 12px 13px; font-size: 10.5px; }
  .edu-star { margin: 0 -8px 4px; padding: 14px 12px; }
}

/* ── Motion off ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .dim-line { stroke-dashoffset: 0; animation: none !important; }
  .dim-tick, .dim-text { opacity: 1; animation: none !important; }
  .in .sch-links path { animation: none; }
  .cue-line::after { animation: none; }
  .demo-dot { animation: none; }
  .term-caret { animation: none; }
  .sec-rule, .meter-line { transform: scaleX(1); transition: none; }
  .meter-line::after { opacity: 1; }
  .drafted::before { transform: scaleX(1); transition: none; }
  .drafted::after { transform: scaleY(1); transition: none; }
  .card-shot img { transition: none; }
}
