/* nestorlazaro.com · un trayecto, como una ruta de carga, por cuatro temas. Cada tema es un capítulo con su color.
   Marca del CV (papel, tinta, azul marino, Newsreader + Inter) y el verde de EV Insights en movilidad eléctrica. */
:root {
  --paper: #f6f3ee; --paper-2: #ece7df; --paper-3: #e2dbcf; --ink: #17171a; --ink-2: #4a4a52; --line: #d8d1c5; --navy: #23395d;
  --mob: #0b7a66; --mob-brand: #1bb598; --edu: #b4661a; --comp: #3f7a3a; --ia: #4f46a8;
  --on-color: #ffffff; --shadow: 0 18px 40px -22px rgb(23 23 26 / .45);
  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #121316; --paper-2: #1b1c21; --paper-3: #24252c; --ink: #ece8e1; --ink-2: #a9a6a0; --line: #33343c; --navy: #9db4dc;
  --mob: #12917a; --mob-brand: #3fd3b4; --edu: #e39a4f; --comp: #7fbf72; --ia: #a39cf0; --shadow: 0 18px 40px -22px rgb(0 0 0 / .8); color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #121316; --paper-2: #1b1c21; --paper-3: #24252c; --ink: #ece8e1; --ink-2: #a9a6a0; --line: #33343c; --navy: #9db4dc;
  --mob: #12917a; --mob-brand: #3fd3b4; --edu: #e39a4f; --comp: #7fbf72; --ia: #a39cf0; --shadow: 0 18px 40px -22px rgb(0 0 0 / .8); color-scheme: dark }

* { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: 72px }
body { background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--f-body); margin: 0; -webkit-font-smoothing: antialiased }
img, video { max-width: 100%; height: auto; display: block }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px) }
a { color: inherit }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-wrap: balance; margin: 0 }
p { margin: 0 }
.mono { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px }

/* ---------- cabecera ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; gap: 14px; padding-block: 10px }
.brand { font-family: var(--f-display); font-size: 1.2rem; text-decoration: none; margin-right: auto; white-space: nowrap }
.chips { display: flex; gap: 6px; flex-wrap: wrap }
.chip { --c: var(--ink); display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .8rem; color: var(--ink-2); transition: border-color .2s, color .2s, background .2s }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c) }
.chip:hover, .chip.on { border-color: var(--c); color: var(--ink); background: var(--paper-2) }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper-2) }
.lang-toggle button { font: 500 12px/1 var(--f-body); letter-spacing: .06em; border: 0; background: none; color: var(--ink-2); padding: 7px 10px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s }
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
@media (max-width: 900px) { .chips { display: none } }

/* ---------- portada ---------- */
.hero { padding-block: clamp(36px, 7vw, 84px) 20px }
.hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(24px, 5vw, 72px); align-items: end }
.eyebrow { color: var(--ink-2); margin-bottom: 18px }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.4rem); line-height: .97; letter-spacing: -.02em }
.hero h1 em { font-style: italic; color: var(--navy) }
.lede { font-size: clamp(1.05rem, 1.9vw, 1.22rem); color: var(--ink-2); max-width: 40ch; margin-top: 24px }
.lede b { color: var(--ink); font-weight: 500 }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .93rem; border: 1px solid var(--ink); transition: transform .25s var(--ease) }
.btn:hover { transform: translateY(-1px) }
.btn.solid { background: var(--ink); color: var(--paper) }
.portrait { margin: 0; position: relative; min-width: 0 }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px }
.portrait figcaption { position: absolute; left: 12px; bottom: 12px; background: var(--paper); color: var(--ink); padding: 6px 10px; border-radius: 3px }

/* trayecto */
.route { margin-top: clamp(30px, 5vw, 52px); border-block: 1px solid var(--line); padding-block: 14px 6px }
.route-head { display: flex; justify-content: space-between; color: var(--ink-2) }
.route svg { width: 100%; height: auto; overflow: visible; display: block }
.route .road { fill: none; stroke: var(--line); stroke-width: 2 }
.route .road-on { fill: none; stroke: var(--navy); stroke-width: 2; stroke-dasharray: 6 9; animation: dash 30s linear infinite }
@keyframes dash { to { stroke-dashoffset: -600 } }
.stop circle { stroke: var(--paper); stroke-width: 3 }
.stop text { font-family: var(--f-body); font-size: 14px; fill: var(--ink) }
.stop .k { font-family: var(--f-mono); font-size: 10px; fill: var(--ink-2); letter-spacing: .06em }
.stop a:hover text { text-decoration: underline }
#car { fill: var(--navy) }
.route-list { display: none; list-style: none; margin: 4px 0 8px; padding: 0; grid-template-columns: 1fr 1fr; gap: 8px }
.route-list a { display: flex; gap: 8px; align-items: center; text-decoration: none; padding: 10px 12px; border-radius: 6px; background: var(--paper-2); border-left: 3px solid var(--c); font-size: .9rem }
.route-list .mono { color: var(--ink-2) }
@media (max-width: 600px) { .route svg { display: none } .route-list { display: grid } }

/* ---------- capítulos ---------- */
.chapter { --c: var(--ink); padding-top: clamp(56px, 9vw, 110px) }
.chapter + .chapter { border-top: 1px solid var(--line); margin-top: clamp(56px, 9vw, 110px) }
.ch-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: baseline; margin-bottom: 30px }
.ch-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); grid-row: span 2; align-self: center }
.ch-head .mono { color: var(--c) }
.ch-head h2 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.01em }
.ch-intro { grid-column: 2; color: var(--ink-2); max-width: 62ch; margin-top: 10px; font-size: 1.06rem }

.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px }
.w2 { grid-column: span 2 } .w3 { grid-column: span 3 } .w4 { grid-column: span 4 } .w6 { grid-column: span 6 }
/* carril: tres tarjetas en fila; en pantallas estrechas, carrusel en vez de apilarlas */
.rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px }
.rail > .card { grid-column: auto }
.card { min-width: 0; background: var(--paper-2); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden }
.card .tag { color: var(--c) }
/* las mayúsculas monoespaciadas quedan para los títulos de tema; en las tarjetas, el dato va en texto normal */
.card .tag.mono { font-family: var(--f-body); font-size: .84rem; font-weight: 500; letter-spacing: 0; text-transform: none }
.card h3 { font-size: 1.5rem; line-height: 1.14 }
.card p { color: var(--ink-2); font-size: .96rem }
.card .meta { margin-top: auto; padding-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--ink-2) }
.more { font-weight: 500; text-decoration: none; border-bottom: 1.5px solid var(--c); padding-bottom: 1px }
.more:hover { color: var(--c) }
.media { margin: -22px -22px 6px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-3) }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease) }
.card:hover .media img { transform: scale(1.03) }
.num { font-family: var(--f-display); font-size: clamp(2.8rem, 6vw, 4.2rem); line-height: 1; color: var(--c); font-variant-numeric: tabular-nums }

/* ---------- EV Insights ---------- */
.evi { background: var(--mob); color: var(--on-color); display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; padding: clamp(24px, 4vw, 40px) }
.evi .tag, .evi p, .evi .meta { color: rgb(255 255 255 / .86) }
.evi .more { border-color: var(--mob-brand); color: #fff }
.evi-word { font-family: var(--f-body); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.03em; line-height: 1 }
.evi-word span { color: var(--mob-brand); filter: brightness(1.25) }
.evi h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem) }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px }
.pillar { border-top: 2px solid var(--mob-brand); padding-top: 10px; font-size: .9rem; color: rgb(255 255 255 / .9) }
.pillar b { display: block; font-weight: 600; color: #fff; margin-bottom: 2px }
.netmap { min-width: 0; align-self: stretch; border-radius: 6px; background: rgb(0 0 0 / .14); position: relative; min-height: 240px }
.netmap svg { position: absolute; inset: 0; width: 100%; height: 100% }
.netmap .lnk { stroke: rgb(255 255 255 / .22); stroke-width: 1 }
.netmap .dot { fill: #fff }
.netmap .hub { fill: var(--mob-brand) }
.netmap .pulse { fill: none; stroke: var(--mob-brand); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: pulse 3.2s var(--ease) infinite; opacity: 0 }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9 } 100% { transform: scale(3.2); opacity: 0 } }
.netmap .cap { position: absolute; left: 14px; bottom: 12px; color: rgb(255 255 255 / .8) }

/* vídeos */
.video { text-decoration: none; background: var(--ink); color: var(--paper); padding: 0 }
.video .media { margin: 0; position: relative }
.video .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgb(0 0 0 / .55)) }
.video .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1 }
.video h3 { font-size: 1.22rem }
.video .tag { color: var(--mob-brand) }
.video p { color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: .9rem }
.play { position: absolute; z-index: 1; left: 16px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%; background: rgb(255 255 255 / .92); display: grid; place-items: center; transition: transform .25s var(--ease), background .2s }
.play::after { content: ""; border-left: 13px solid #17171a; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px }
.dur { position: absolute; z-index: 1; right: 12px; bottom: 14px; background: rgb(0 0 0 / .72); color: #fff; padding: 3px 7px; border-radius: 4px }
.video:hover .play { transform: scale(1.08); background: var(--mob-brand) }
.edu .video .tag { color: var(--edu) }
.edu .video:hover .play { background: var(--edu) }
.strip { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding-block: 14px; border-bottom: 1px solid var(--line); color: var(--ink-2) }

/* Dialogia: la única tarjeta de color del capítulo, con la captura del producto */
.dialogia { padding: 0; display: grid; grid-template-columns: 1.35fr .65fr; background: var(--edu); color: var(--on-color) }
.dialogia .screen { background: rgb(0 0 0 / .14); padding: clamp(16px, 2.6vw, 30px); display: grid; place-items: center; min-width: 0 }
.dialogia .screen img { width: 100%; border-radius: 8px; box-shadow: 0 18px 40px -18px rgb(0 0 0 / .55) }
.dialogia .text { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.dialogia .tag, .dialogia p, .dialogia .meta { color: rgb(255 255 255 / .9) }
.dialogia h3 { font-size: clamp(1.8rem, 3.4vw, 2.5rem) }
.dialogia .more { border-color: #fff; color: #fff }

/* ESAU */
.esau { padding: 0; display: grid; grid-template-columns: 1fr 1fr }
.esau .reel { position: relative; min-height: 260px; background: #000 }
.esau .reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.esau .text { padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0 }

.teach { display: grid; grid-template-columns: 1.4fr .6fr; gap: 28px; align-items: start }
.teach .text { display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.teach .where { display: grid; gap: 12px; min-width: 0 }

.places { display: flex; flex-wrap: wrap; gap: 8px }
.places span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: .86rem; background: var(--paper) }
.places b { font-family: var(--f-mono); font-weight: 400; font-size: .7rem; color: var(--ink-2); margin-left: 6px }
.places.now span { border-color: var(--c) }
.links-row { display: flex; gap: 10px 22px; flex-wrap: wrap }

/* ---------- doctorado ---------- */
.thesis { background: var(--comp); color: var(--on-color); display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; padding: clamp(24px, 4vw, 40px) }
.thesis .tag, .thesis p { color: rgb(255 255 255 / .86) }
.thesis h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-style: italic }
.card .quote { font-family: var(--f-display); font-style: italic; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.22; color: #fff; border-left: 2px solid rgb(255 255 255 / .5); padding-left: 18px; align-self: center }
.card .quote small { display: block; font-family: var(--f-mono); font-style: normal; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; margin-top: 12px; color: rgb(255 255 255 / .75) }
.paper .viz { margin: -22px -22px 6px; background: var(--paper-3); padding: 18px 18px 12px }
.paper .viz svg { width: 100%; height: auto; display: block }
.viz text { font-family: var(--f-body); font-size: 12px; fill: var(--ink) }
.viz .lbl { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .06em; fill: var(--ink-2) }
.viz .acc { fill: var(--comp) }
.viz .acc-s { stroke: var(--comp) }
.viz .soft { fill: var(--line) }
.viz .node { fill: var(--paper); stroke: var(--comp); stroke-width: 1.4 }
.viz .arr { stroke: var(--comp); stroke-width: 1.8; fill: none }
.viz .grow { transform-box: fill-box; transform-origin: left center; transition: transform 1.1s var(--ease) }
.viz .dash { stroke-dasharray: 4 4 }
.authors { font-size: .82rem }

/* ---------- libro ---------- */
.book { display: grid; grid-template-columns: minmax(0, 200px) 1fr; gap: 26px; align-items: start; background: var(--paper-2) }
.book img { width: 100%; border-radius: 2px; box-shadow: var(--shadow); transform: rotate(-2deg); transition: transform .4s var(--ease) }
.book:hover img { transform: rotate(0) }
.book .text { display: flex; flex-direction: column; gap: 10px; min-width: 0 }

/* ---------- pie ---------- */
.foot { margin-top: clamp(70px, 10vw, 130px); border-top: 1px solid var(--line); padding-block: 30px 44px }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--ink-2) }

/* entrada suave: siempre visible en reposo */
[data-reveal] { transition: transform .7s var(--ease) }
[data-reveal].pre { transform: translateY(16px) }

@media (max-width: 900px) {
  .hero-grid, .evi, .esau, .thesis, .dialogia, .teach { grid-template-columns: 1fr }
  .portrait { max-width: 320px }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .w2, .w3, .w4, .w6 { grid-column: span 2 }
  .rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * clamp(16px, 4vw, 40px)); padding-inline: clamp(16px, 4vw, 40px); scroll-padding-inline: clamp(16px, 4vw, 40px) }
  .rail::-webkit-scrollbar { display: none }
  .rail > .card { flex: 0 0 min(82%, 360px); scroll-snap-align: start }
  .ch-head { grid-template-columns: 1fr } .ch-dot { display: none } .ch-intro { grid-column: 1 }
  .book { grid-template-columns: 120px 1fr }
  .pillars { grid-template-columns: 1fr }
  .esau .reel { min-height: 0; aspect-ratio: 16 / 9 }
  .netmap { min-height: 200px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important }
  #car { display: none }
}
