/* Jorge Sebastián Soriano · portfolio
   Paleta: papel de listado + tinta verde + cobalto + ámbar de aviso */
:root {
  --ground: #eef1ef;
  --surface: #ffffff;
  --surface-2: #e4e9e6;
  --ink: #14201c;
  --ink-2: #3e4b46;
  --muted: #56635e;
  --line: #d3dbd7;
  --accent: #2346d4;
  --accent-ink: #ffffff;
  --accent-soft: rgba(35, 70, 212, 0.09);
  --signal: #8f5500;
  --signal-soft: rgba(224, 138, 0, 0.14);
  --ok: #1e7a4f;
  --ok-soft: rgba(30, 122, 79, 0.12);
  --stop: #b3372b;
  --stop-soft: rgba(179, 55, 43, 0.1);
  --shadow: 0 1px 0 rgba(20, 32, 28, 0.04), 0 12px 32px -18px rgba(20, 32, 28, 0.25);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.4vw, 2.7rem);
  --step-4: clamp(2.4rem, 1.9rem + 2.6vw, 4rem);

  --radius: 14px;
  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d1311;
    --surface: #141c19;
    --surface-2: #1b2521;
    --ink: #e5ece9;
    --ink-2: #bcc8c3;
    --muted: #8d9b95;
    --line: #26322d;
    --accent: #8aa0ff;
    --accent-ink: #0d1311;
    --accent-soft: rgba(138, 160, 255, 0.12);
    --signal: #f2aa45;
    --signal-soft: rgba(242, 170, 69, 0.14);
    --ok: #5fcf96;
    --ok-soft: rgba(95, 207, 150, 0.12);
    --stop: #ff8a7e;
    --stop-soft: rgba(255, 138, 126, 0.12);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 36px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0d1311;
  --surface: #141c19;
  --surface-2: #1b2521;
  --ink: #e5ece9;
  --ink-2: #bcc8c3;
  --muted: #8d9b95;
  --line: #26322d;
  --accent: #8aa0ff;
  --accent-ink: #0d1311;
  --accent-soft: rgba(138, 160, 255, 0.12);
  --signal: #f2aa45;
  --signal-soft: rgba(242, 170, 69, 0.14);
  --ok: #5fcf96;
  --ok-soft: rgba(95, 207, 150, 0.12);
  --stop: #ff8a7e;
  --stop-soft: rgba(255, 138, 126, 0.12);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 36px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0)/1.62 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--f-mono); font-size: 0.9em; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ——— Barra superior ——— */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ink); color: var(--ground); font-family: var(--f-mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0;
}
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.93rem; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 9px;
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none;
}
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.theme-btn svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .nav { display: none; }
  .theme-btn { margin-left: auto; }
}

/* ——— Botones y etiquetas ——— */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  font: 600 0.95rem/1 var(--f-body); padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn svg { width: 16px; height: 16px; }
.eyebrow { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li { font-family: var(--f-mono); font-size: 0.74rem; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 3px 8px; }

/* ——— Portada ——— */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-id { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.avatar {
  width: 104px; height: 130px; border-radius: 14px; flex: none; overflow: hidden; position: relative; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
  background: var(--ink); color: var(--ground); display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 1.15rem;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-id .who { display: grid; line-height: 1.3; }
.hero-id .who b { font-weight: 600; }
.hero-id .who span { color: var(--muted); font-size: 0.92rem; }
.hero h1 { font-size: var(--step-4); max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 22px; font-size: var(--step-1); color: var(--ink-2); max-width: 54ch; line-height: 1.55; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; padding: 0; list-style: none; color: var(--muted); font-size: 0.9rem; }
.hero .facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 8px; vertical-align: 2px; }

/* Registro de trazas */
.trace {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; font-family: var(--f-mono); font-size: 0.8rem;
}
.trace-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; }
.trace-head .live { display: inline-flex; align-items: center; gap: 7px; }
.trace-head .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.trace ol { list-style: none; margin: 0; padding: 6px 0; }
.trace li {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 14px; padding: 12px 16px;
  border-left: 3px solid transparent; transition: background-color .35s ease, border-color .35s ease, opacity .35s ease;
}
.trace li.dim { opacity: 0.55; }
.trace li.on { background: var(--accent-soft); border-left-color: var(--accent); opacity: 1; }
.trace .src { color: var(--muted); padding-top: 1px; }
.trace .in { color: var(--ink); overflow-wrap: anywhere; }
.trace .out { grid-column: 2; display: flex; gap: 8px; align-items: baseline; color: var(--ink-2); line-height: 1.5; }
.trace .verdict { flex: none; font-weight: 600; font-size: 0.7rem; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; }
.v-salta { background: var(--signal-soft); color: var(--signal); }
.v-ok { background: var(--ok-soft); color: var(--ok); }
.v-stop { background: var(--stop-soft); color: var(--stop); }
.v-info { background: var(--accent-soft); color: var(--accent); }
.trace-foot { padding: 10px 16px 14px; color: var(--muted); font-size: 0.72rem; border-top: 1px dashed var(--line); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .trace li { grid-template-columns: 1fr; }
  .trace .out { grid-column: 1; }
}

/* ——— Secciones ——— */
.section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { text-wrap: pretty; }
.section-head p { max-width: 68ch; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.55; }

/* Vídeo */
.video-frame {
  background: var(--ink); border-radius: calc(var(--radius) + 4px); overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 16 / 9; max-width: 100%; position: relative;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-note { margin-top: 12px; color: var(--muted); font-size: 0.88rem; }

/* Tres preguntas */
.questions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 28px); row-gap: 14px; }
.q { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; gap: 14px; padding-top: 18px; border-top: 2px solid var(--ink); }
.q .where { align-self: end; }
.q h3 { font-size: var(--step-2); }
.q p { color: var(--ink-2); }
.q .where { font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); }
.q ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 6px; align-content: start; }
@media (max-width: 860px) { .questions { grid-template-columns: 1fr; row-gap: 32px; } .q { grid-row: auto; grid-template-rows: none; } }

/* Proyectos */
.group-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.group-label h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
.group-label span { color: var(--muted); font-size: 0.9rem; }
.projects { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 64px); }
.project {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(18px, 3vw, 36px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(14px, 2vw, 20px);
  transition: border-color .2s ease, transform .2s ease;
}
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.project .shot { border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 10; border: 1px solid var(--line); align-self: start; }
.project .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .6s ease; }
.project .shot video { display: block; width: 100%; height: 100%; object-fit: cover; }
.project:hover .shot img { transform: scale(1.025); }
.project .body { display: grid; align-content: start; gap: 12px; padding-block: 4px; }
.project .kicker { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.project h4 { font-family: var(--f-display); font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.project .pitch { color: var(--ink-2); }
.project .key {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line);
}
.project .key b { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); }
.project .key p { font-size: 0.95rem; color: var(--ink); }
.project .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.project .links .btn { padding: 10px 14px; font-size: 0.9rem; }
.pill { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.prod { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.project.no-demo .shot { display: grid; place-items: center; }
.agents-diagram { width: 88%; height: auto; }
@media (max-width: 820px) { .project { grid-template-columns: 1fr; } }

/* Trayectoria */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 860px; }
.timeline li { display: grid; grid-template-columns: 110px 22px minmax(0, 1fr); gap: 0 18px; }
.timeline .when { font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted); padding-top: 3px; text-align: right; }
.timeline .rail { position: relative; }
.timeline .rail::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline .rail::after { content: ""; position: absolute; left: 5px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--ground); border: 2px solid var(--muted); }
.timeline li.now .rail::after { border-color: var(--accent); background: var(--accent); }
.timeline li.next .rail::after { border-style: dashed; border-color: var(--accent); }
.timeline li:last-child .rail::before { bottom: auto; height: 12px; }
.timeline .what { padding-bottom: 28px; display: grid; gap: 4px; }
.timeline .what b { font-weight: 600; font-size: 1.04rem; }
.timeline .what span { color: var(--ink-2); }
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 22px minmax(0, 1fr); }
  .timeline .when { grid-column: 2; text-align: left; order: -1; padding: 0; }
  .timeline .rail { grid-row: 1 / span 2; grid-column: 1; }
}

/* Hacia dónde voy */
.direction { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.direction .big { font-family: var(--f-display); font-size: var(--step-2); line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; max-width: 30ch; }
.direction .big em { font-style: normal; color: var(--accent); }
.direction .body { display: grid; gap: 16px; color: var(--ink-2); }
.roles { display: grid; gap: 10px; margin-top: 6px; }
.role { display: grid; grid-template-columns: 124px 1fr; gap: 12px; align-items: baseline; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.role b { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.05em; text-transform: uppercase; }
.role span { color: var(--ink); }
@media (max-width: 860px) { .direction { grid-template-columns: 1fr; } }

/* IA */
.ai-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); }
.ai-block .col { display: grid; gap: 14px; align-content: start; color: var(--ink-2); }
.split-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.split-list li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.split-list li:last-child { border-bottom: 0; }
.split-list b { font-family: var(--f-mono); font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; padding-top: 3px; }
.split-list .me b { color: var(--accent); }
.split-list .ai b { color: var(--muted); }
@media (max-width: 860px) { .ai-block { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .split-list li { grid-template-columns: 1fr; gap: 2px; } }

/* Stack */
.stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stack div { display: grid; gap: 10px; align-content: start; }
.stack h3 { font-size: 1rem; font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
@media (max-width: 900px) { .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stack { grid-template-columns: 1fr; } }

/* Contacto */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.contact h2 { font-size: var(--step-4); max-width: 13ch; }
.contact-card { display: grid; gap: 12px; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.contact-row .label { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; display: block; }
.contact-row .value { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.copy-btn { border: 1px solid var(--line); background: var(--ground); color: var(--ink-2); border-radius: 8px; padding: 7px 11px; font: 600 0.82rem var(--f-body); cursor: pointer; }
.copy-btn:hover { border-color: var(--ink-2); color: var(--ink); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

.footer { padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ——— Páginas de caso ——— */
.case-hero { padding-block: clamp(32px, 6vw, 72px) clamp(24px, 4vw, 40px); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 0.92rem; margin-bottom: 26px; }
.back:hover { color: var(--ink); }
.case-hero h1 { font-size: var(--step-4); max-width: 34ch; text-wrap: pretty; }
.case-hero .lead { margin-top: 18px; font-size: var(--step-1); color: var(--ink-2); max-width: 62ch; line-height: 1.55; }
.case-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: clamp(28px, 4vw, 44px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.meta div { padding: 14px 16px; border-right: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.meta div:last-child { border-right: 0; }
.meta dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 0; font-size: 0.94rem; color: var(--ink); }
@media (max-width: 860px) {
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta div:nth-child(2) { border-right: 0; }
  .meta div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 460px) {
  .meta { grid-template-columns: 1fr; }
  .meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .meta div:last-child { border-bottom: 0; }
}
.case-figure { margin: 0; }
.case-figure img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; background: var(--surface); }
.case-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 0.86rem; }
.case-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding-block: clamp(36px, 6vw, 72px); }
.toc { position: sticky; top: 84px; align-self: start; display: grid; gap: 4px; font-size: 0.9rem; }
.toc a { color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); border-left-color: var(--ink-2); }
.prose { display: grid; gap: clamp(40px, 6vw, 64px); min-width: 0; }
.prose section { display: grid; gap: 16px; max-width: 70ch; }
.prose section.wide { max-width: none; }
.prose h2 { font-size: var(--step-2); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.prose strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .case-body { grid-template-columns: 1fr; } .toc { display: none; } }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--signal); background: var(--surface); border-radius: 10px; padding: 16px 18px; display: grid; gap: 8px; }
.callout .eyebrow { color: var(--signal); }
.callout p { color: var(--ink); }
.flow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.flow svg { min-width: 620px; width: 100%; height: auto; }
.flow svg text { font-family: var(--f-mono); font-size: 12px; fill: var(--ink); }
.flow svg .sub { fill: var(--muted); font-size: 10.5px; }
.flow svg .box { fill: var(--ground); stroke: var(--line); stroke-width: 1.5; }
.flow svg .box.hl { fill: var(--accent-soft); stroke: var(--accent); }
.flow svg .box.warn { fill: var(--signal-soft); stroke: var(--signal); }
.flow svg .arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.flow svg .arrowhead { fill: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td { color: var(--ink-2); }
td:first-child { color: var(--ink); font-weight: 500; }
.tag-real, .tag-sim, .tag-no { font-family: var(--f-mono); font-size: 0.72rem; padding: 2px 7px; border-radius: 5px; white-space: nowrap; font-weight: 600; }
.tag-real { background: var(--ok-soft); color: var(--ok); }
.tag-sim { background: var(--signal-soft); color: var(--signal); }
.tag-no { background: var(--surface-2); color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 14px; align-items: start; }
.shots figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.shots img { border-radius: 10px; border: 1px solid var(--line); width: 100%; background: var(--surface); max-height: 520px; object-fit: cover; object-position: top center; }
/* Capturas de móvil de la app real (ARX): cuatro por fila y sin recortar */
.shots:has(img[src*="/real_"]) { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.shots:has(img[src*="/real_"]) img { max-height: none; }
.shots figcaption { font-size: 0.84rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.stat b { font-family: var(--f-display); font-size: var(--step-2); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.88rem; color: var(--ink-2); }
.stat small { font-size: 0.76rem; color: var(--muted); }
.next-case { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px; border-top: 1px solid var(--line); }
.next-case a { text-decoration: none; display: grid; gap: 2px; color: var(--ink); }
.next-case a span { color: var(--muted); font-size: 0.84rem; }
.next-case a b { font-family: var(--f-display); font-size: var(--step-1); }
.next-case a:hover b { color: var(--accent); }
.next-case .r { text-align: right; margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 420px) { .role { grid-template-columns: 1fr; gap: 2px; } }

/* Vídeo dentro de un caso */
.case-video { margin: 0; display: grid; gap: 10px; }
.case-video video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.case-video figcaption { color: var(--muted); font-size: 0.86rem; }

/* Ficha homogénea en tarjetas */
.ficha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ficha div { padding: 8px 12px; border-right: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.ficha div:last-child { border-right: 0; }
.ficha dt { font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.ficha dd { margin: 0; font-size: 0.86rem; color: var(--ink); line-height: 1.35; }
@media (max-width: 520px) {
  .ficha { grid-template-columns: 1fr; }
  .ficha div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ficha div:last-child { border-bottom: 0; }
}

/* Empieza aquí */
.start { margin-bottom: clamp(28px, 4vw, 44px); padding: clamp(16px, 2.4vw, 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 16px; }
.start-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.start-head .eyebrow { color: var(--accent); }
.start-head p { color: var(--ink-2); }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pick { display: grid; gap: 10px; align-content: start; padding: 14px 16px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); }
.pick > b { font-family: var(--f-display); font-size: 1.08rem; letter-spacing: -0.01em; }
.pick ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pick li::marker { color: var(--accent); font-family: var(--f-mono); font-size: 0.85em; }
.pick li a { font-weight: 600; text-decoration: none; }
.pick li a:hover { text-decoration: underline; }
.pick li span { display: block; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 860px) { .start-grid { grid-template-columns: 1fr; } }

/* Ejemplo real del flujo con IA */
.worked { margin-top: clamp(28px, 4vw, 44px); display: grid; gap: 18px; }
.worked-head { display: grid; gap: 8px; max-width: 760px; }
.worked-head .eyebrow { color: var(--signal); }
.worked-head h3 { font-size: var(--step-2); }
.worked-head p { color: var(--ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: paso; }
.steps li { counter-increment: paso; display: grid; gap: 6px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(paso, decimal-leading-zero); font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); }
.steps li b { font-size: 1rem; }
.steps li span { color: var(--ink-2); font-size: 0.93rem; }
.steps li:nth-child(3) { border-color: color-mix(in srgb, var(--signal) 55%, var(--line)); }
.steps li:nth-child(4) { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Selector de idioma */
.lang-switch { font-family: var(--f-mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; height: 36px; padding: 0 10px; display: grid; place-items: center; flex: none; }
.lang-switch:hover { color: var(--ink); border-color: var(--muted); }
@media (max-width: 900px) { .lang-switch { margin-left: auto; } .lang-switch + .theme-btn { margin-left: 0; } }

/* Idiomas en «Hacia dónde voy» */
.langs { margin-top: 28px; display: grid; gap: 10px; max-width: 420px; }
.langs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.langs li { display: grid; gap: 2px; padding: 12px 14px; border-right: 1px solid var(--line); }
.langs li:last-child { border-right: 0; }
.langs li span { font-size: 0.9rem; color: var(--ink-2); }
.langs li b { font-family: var(--f-display); font-size: 1.15rem; letter-spacing: -0.01em; }

/* Botones de contacto como enlaces: sin subrayado */
a.copy-btn { text-decoration: none; display: inline-grid; place-items: center; }

/* Pie */
.footer .wrap { align-items: baseline; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }
.foot-made { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; }

/* Móvil: tarjetas más ligeras */
@media (max-width: 560px) {
  .project .tags { display: none; }
  .project .key p { font-size: 0.9rem; }
}

/* ——— Fase 1 ——— */
.text-link { align-self: center; color: var(--ink-2); font-size: 0.93rem; padding: 0 4px; }

/* Menú móvil */
.menu-btn { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; height: 36px; padding: 0 12px; font: 600 0.88rem var(--f-body); cursor: pointer; flex: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; place-items: center; margin-left: auto; }
  .lang-switch { margin-left: 0; }
  .topbar .wrap { position: relative; flex-wrap: nowrap; gap: 8px; }
  .nav { display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gutter) 14px; background: var(--ground); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .nav a:last-child { border-bottom: 0; }
}

/* Microdemo */
.microdemo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-family: var(--f-mono); font-size: 0.8rem; }
.md-body { padding: 16px 18px 6px; display: grid; gap: 14px; }
.md-rule { font-family: var(--f-body); font-size: 0.95rem; color: var(--ink); line-height: 1.45; }
.md-field { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.md-field label { color: var(--ink-2); font-size: 0.8rem; letter-spacing: 0.03em; }
.md-field output { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.md-field input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }
.md-verdict { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); color: var(--ink); line-height: 1.45; font-size: 0.84rem; }
.md-verdict .verdict { flex: none; }
.md-log { padding: 10px 18px 12px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.md-log-tit { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.md-log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.md-log li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; color: var(--ink-2); font-size: 0.76rem; }
.md-log li .in { color: var(--ink); white-space: nowrap; }
.md-log li.nuevo { animation: entra .35s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.microdemo .trace-foot a { color: var(--accent); white-space: nowrap; }
@media (max-width: 520px) { .microdemo .trace-head { flex-direction: column; align-items: flex-start; gap: 4px; } .md-log li .verdict { justify-self: start; } .md-log li { grid-template-columns: auto 1fr; } .md-log li .why { grid-column: 1 / -1; } }

/* Proyectos compactos */
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.mini { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s ease; }
.mini:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mini-shot { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mini-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .5s ease; }
.mini:hover .mini-shot img { transform: scale(1.03); }
.mini-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.mini-body h4 { margin: 0; font-family: var(--f-display); font-size: 1.12rem; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.mini-body h4 a { color: var(--ink); text-decoration: none; }
.mini-body h4 a:hover { color: var(--accent); }
.mini-body p { color: var(--ink-2); font-size: 0.92rem; }
.mini-links { display: flex; gap: 14px; margin-top: auto; padding-top: 4px; }
.mini-links a { font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.mini-links a:hover { text-decoration: underline; }

/* Transcripción */
.transcript { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.transcript summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--ink); }
.transcript p { padding: 0 16px; color: var(--muted); font-size: 0.9rem; }
.transcript ol { margin: 10px 0 0; padding: 0 16px 16px 36px; display: grid; gap: 8px; color: var(--ink-2); font-size: 0.92rem; }
.transcript b { color: var(--ink); }

/* Ahora */
.ahora { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(22px, 3vw, 32px); }
.ahora-text { display: grid; gap: 14px; color: var(--ink-2); font-size: var(--step-0); max-width: 72ch; }
.ahora-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ahora-list li { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 6px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ahora-list b { font-weight: 600; color: var(--ink); }
.ahora-list span { color: var(--ink-2); font-size: 0.94rem; }
@media (max-width: 860px) { .ahora { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .brand { font-size: 0; gap: 0; }
  .brand-mark { font-size: 0.78rem; }
}

/* Volver + Inicio arriba a la izquierda en todas las páginas que no son la portada */
.page-nav { display: flex; gap: 6px; flex: none; }
.pn-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; text-decoration: none; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.pn-btn:hover { border-color: var(--muted); background: var(--surface-2); }
@media (max-width: 560px) { .pn-btn { padding: 0 10px; } .pn-btn .pn-t { display: none; } }

/* Accesos por puesto bajo los botones de la portada (coinciden con los tres CVs) */
.rutas { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 14px; font-size: 0.92rem; color: var(--muted); }
.rutas a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.rutas a:hover { color: var(--accent); text-decoration-color: currentColor; }
.pick { scroll-margin-top: 90px; }
.pick:target { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Portada: el enlace al vídeo alineado con los botones cuando baja de línea */
.hero .actions .text-link { padding: 0; }

/* Páginas con «Volver · Inicio»: entre 901 y 1100 px se oculta el nombre junto al logo para que el menú quepa en una línea */
@media (max-width: 1100px) {
  .topbar:has(.page-nav) .brand { font-size: 0; gap: 0; }
  .topbar:has(.page-nav) .brand-mark { font-size: 0.78rem; }
}

/* Microdemo del buscador de catálogo */
.mb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mb-form { display: flex; gap: 8px; }
.mb-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); font: 500 0.95rem var(--f-body); }
.mb-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mb-go { flex: none; height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink, #0e1311); font: 600 0.9rem var(--f-body); cursor: pointer; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-chip { border: 1px solid var(--line); background: var(--ground); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 500 0.76rem var(--f-mono); cursor: pointer; }
.mb-chip:hover, .mb-chip.on { border-color: var(--accent); color: var(--ink); }
.mb-out { display: grid; gap: 10px; min-height: 176px; align-content: start; padding: 12px 14px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); font-family: var(--f-body); font-size: 0.88rem; line-height: 1.45; color: var(--ink-2); }
.mb-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.mb-row .verdict { justify-self: start; font-family: var(--f-mono); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; margin-top: 2px; }
.mb-body b { color: var(--ink); font-weight: 600; }
.mb-big { display: inline-block; margin-left: 8px; font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); }
.mb-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.mb-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; border-top: 1px dashed var(--line); padding-top: 4px; }
.mb-list li span:last-child { text-align: right; white-space: nowrap; }
.mb-muted { color: var(--muted); margin: 4px 0 0; font-size: 0.84rem; }
.mb-stock { font-family: var(--f-mono); font-size: 0.7rem; padding: 1px 6px; border-radius: 5px; }
.mb-stock.ok { background: var(--ok-soft); color: var(--ok); }
.mb-stock.low { background: var(--signal-soft); color: var(--signal); }
.mb-stock.no { background: var(--stop-soft); color: var(--stop); }
@media (max-width: 520px) {
  .mb-row { grid-template-columns: 1fr; gap: 4px; }
  .mb-list li { flex-direction: column; gap: 0; }
  .mb-list li span:last-child { text-align: left; white-space: normal; }
}

/* Portada: vídeo a la derecha del titular */
.hero-video { display: grid; gap: 10px; min-width: 0; }
.hero-video-tit { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hero-video .video-note { margin-top: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

/* Franja «Pruébalo» con la microdemo del buscador */
.try { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 48px); align-items: start;
  margin: 18px 0 clamp(28px, 4vw, 44px); padding: clamp(18px, 2.6vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.try-text { display: grid; gap: 10px; align-content: start; }
.try-text .eyebrow { color: var(--accent); }
.try-text h3 { font-family: var(--f-display); font-size: var(--step-2); line-height: 1.15; }
.try-text p { color: var(--ink-2); }
.try-text .try-muted { color: var(--muted); font-size: 0.9rem; }
.try .microdemo { box-shadow: none; background: var(--ground); }
@media (max-width: 860px) { .try { grid-template-columns: 1fr; } }

/* Transcripción en un diálogo */
.transcript-dlg { width: min(760px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.transcript-dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlg-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: var(--step-1); }
.dlg-close { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.dlg-body { padding: 14px 18px 20px; display: grid; gap: 10px; }
.dlg-body p { color: var(--muted); font-size: 0.9rem; }
.dlg-body ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); font-size: 0.93rem; }
.dlg-body b { color: var(--ink); }

/* Secciones recortadas (27/09): la tabla «Yo / Agente» sola y el máster sin fichas */
.ai-block { grid-template-columns: minmax(0, 1fr); }

/* Datos clave debajo del vídeo de la portada */
.hero .hero-facts { margin-top: 6px; }

/* Títulos de caso en móvil: más compactos para que no pasen de 3–4 líneas */
@media (max-width: 560px) { .case-hero h1 { font-size: 1.95rem; } }

/* ——— Portada como CV (27/09) ——— */
.cv-timeline { max-width: 900px; }
.cv-timeline .what { gap: 2px; }
.cv-timeline .tl-note { color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.cv-timeline .tl-org { color: var(--muted); font-size: 0.95rem; }
.tl-points { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; color: var(--ink-2); }
.tl-points li::marker { color: var(--accent); }
.edu-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.edu-main { display: grid; gap: 12px; color: var(--ink-2); padding: clamp(18px, 2.4vw, 26px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.edu-main h3 { font-size: var(--step-2); color: var(--ink); }
.edu-meta { color: var(--muted); font-size: 0.95rem; margin-top: -6px; }
.edu-main b { color: var(--ink); }
.edu-note { color: var(--muted); font-size: 0.88rem; }
.edu-side { display: grid; gap: 18px; }
.edu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.edu-list li { display: grid; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.edu-list b { font-weight: 600; }
.edu-list span { color: var(--muted); font-size: 0.93rem; }
.edu-side .langs { margin-top: 0; }
.como-tabla { margin-top: clamp(28px, 4vw, 40px); }
.como-tabla .split-list li { grid-template-columns: 90px minmax(0, 1fr); }
.roles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
@media (max-width: 1100px) { .roles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.roles-grid .role { grid-template-columns: 1fr; gap: 6px; align-content: start; }
@media (max-width: 860px) { .edu-grid, .roles-grid { grid-template-columns: 1fr; } }
.cv-timeline > li { grid-template-columns: 170px 22px minmax(0, 1fr); }
.cv-timeline .tl-points li { display: list-item; }
.section-head p { text-wrap: pretty; }
@media (max-width: 640px) { .cv-timeline > li { grid-template-columns: 22px minmax(0, 1fr); } }
.cv-timeline .when { white-space: nowrap; }
#mb .md-body { grid-template-columns: minmax(0, 1fr); }
.try > * { min-width: 0; }

/* Traducción bajo cada ejemplo del buscador (versión inglesa) */
.mb-chip em { display: block; font: italic 400 0.72rem var(--f-body); color: var(--muted); margin-top: 1px; }
.mb-chips:has(em) .mb-chip { border-radius: 10px; text-align: left; }

/* «Qué busco»: dos prioridades y una línea complementaria */
.roles-prio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 0; }
.roles-prio .role { grid-template-columns: 1fr; gap: 8px; align-content: start; padding: 18px 20px; }
.roles-prio .role span { font-family: var(--f-display); font-size: var(--step-1); line-height: 1.3; font-weight: 600; }
.roles-also { margin-top: 16px; color: var(--ink-2); }
.roles-also b { color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .roles-prio { grid-template-columns: 1fr; } }

/* Teaser de ARX con botón de pausa */
.shot-video { position: relative; }
.shot-video > a { display: block; width: 100%; height: 100%; }
.vid-toggle { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(10,14,12,.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vid-toggle:hover { background: rgba(10,14,12,.9); }
.vid-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vid-toggle .i-play { display: none; }
.vid-toggle.parado .i-play { display: inline; }
.vid-toggle.parado .i-pausa { display: none; }
@media (max-width: 560px) { .group-label { flex-direction: column; align-items: flex-start; gap: 4px; } }

/* Vídeo de la cabecera: alineado con el titular y botón de play grande */
@media (min-width: 901px) {
  .hero .wrap { align-items: start; }
  .hero-video { margin-top: 0; }
}
.video-frame .play-big { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); transition: transform .15s ease; }
.video-frame .play-big svg { width: 34px; height: 34px; margin-left: 4px; }
.video-frame .play-big:hover { transform: scale(1.06); }
.video-frame .play-big:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.video-frame.en-marcha .play-big { display: none; }
@media (max-width: 560px) { .video-frame .play-big { width: 64px; height: 64px; } .video-frame .play-big svg { width: 26px; height: 26px; } }

/* Cabecera de CV: nombre como titular junto a la foto */
.hero-id { align-items: center; gap: clamp(16px, 2vw, 24px); margin-bottom: 28px; }
.hero-id .who { gap: 6px; }
.hero-id .who h1 { font-size: clamp(2.1rem, 1.5rem + 2.1vw, 3.3rem); line-height: 1.02; max-width: none; letter-spacing: -0.025em; }
.hero-id .who-rol { font-family: var(--f-display); font-weight: 600; font-size: var(--step-1); color: var(--accent); line-height: 1.25; }
.hero-id .who-lugar { color: var(--muted); font-size: 0.95rem; }
.hero .lead { margin-top: 0; }
@media (max-width: 480px) { .hero-id { align-items: flex-start; } .hero-id .avatar { width: 84px; height: 105px; } }
.hero-id .who-rol { font-size: clamp(0.98rem, 0.9rem + 0.35vw, 1.12rem); }
.hero-id .who-rol .nw { white-space: nowrap; }
.hero-id .who .who-rol .nw { color: inherit; font-size: inherit; }

/* Cabecera en dos filas: presentación arriba; explicación + vídeo debajo (27/09) */
.hero .wrap { display: block; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-top .hero-id { margin-bottom: 0; }
.hero-intro .lead { margin-top: 0; }
.hero-intro .actions { margin-top: 22px; }
.hero-vid { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(36px, 5vw, 64px);
  padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.hero-vid-text { display: grid; gap: 12px; align-content: center; }
.hero-vid-text h2 { font-size: var(--step-2); }
.hero-vid-text p { color: var(--ink-2); }
.hero-vid-text .hero-vid-muted { color: var(--muted); font-size: 0.93rem; }
.hero-vid-text .video-note { margin-top: 6px; }
.hero-vid .hero-video { margin-top: 0; }
@media (max-width: 900px) { .hero-top, .hero-vid { grid-template-columns: 1fr; } .hero-vid { gap: 16px; } }

/* Presentación en una columna: foto + nombre en una línea, explicación justo debajo (27/09) */
.hero-top { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.hero-top .hero-id .who h1 { white-space: nowrap; }
.hero-intro { max-width: 78ch; }
.hero-intro .actions { margin-top: 20px; }
@media (max-width: 560px) { .hero-top .hero-id .who h1 { white-space: normal; } }
.hero-intro, .hero-intro .lead { max-width: none; }

/* Cabecera: identidad arriba; presentación (40 %) + vídeo (60 %) debajo, sin separador (27/09) */
.hero .wrap > .hero-id { margin-bottom: clamp(24px, 3vw, 36px); }
.hero .wrap > .hero-id .who h1 { white-space: nowrap; }
.hero-row { display: grid; grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr); gap: clamp(24px, 3.5vw, 52px); align-items: start; }
.hero-row .hero-intro .lead { margin-top: 0; }
.hero-row .hero-vid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 0; padding-top: 0; border-top: 0; }
.hero-row .hero-vid-text { gap: 6px; }
.hero-row .hero-vid-text h2 { font-size: var(--step-1); }
.hero-row .hero-vid-text p { font-size: 0.95rem; }
.hero-row .hero-vid-text .video-note { margin-top: 2px; }
@media (max-width: 900px) { .hero-row { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hero .wrap > .hero-id .who h1 { white-space: normal; } }
.hero-row .hero-vid { gap: 10px; }
.hero-row .hero-vid .video-note { margin: 0; }

/* Cabecera compacta: dos párrafos cortos centrados respecto al vídeo y menos aire antes de Experiencia (27/09) */
.hero-row { align-items: center; }
.hero-intro .lead-2 { margin-top: 14px; }
.hero { padding-bottom: clamp(28px, 3.5vw, 44px); }
#experiencia { padding-top: clamp(40px, 5vw, 64px); }
.hero-row .hero-intro .lead-2 { margin-top: 14px; }
/* Clip de IA para Humanos: 16:9 entero, sin recortar los textos */
#p-ia-humanos .shot video { object-fit: contain; background: #050907; }
