/* ==========================================================================
   Ale Gil · Asesoría de tesis
   Sistema visual minimalista: papel cálido, tinta profunda, un solo acento.
   ========================================================================== */

@font-face {
  font-family: "Playfair Display";
  src: url("../assets/fonts/playfair-display.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../assets/fonts/playfair-display-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url("../assets/fonts/poppins-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url("../assets/fonts/poppins-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --paper: #faf8f5;
  --surface: #ffffff;
  --tint: #f3efea;
  --ink: #1f1b18;
  --ink-2: #4a433e;
  --muted: #7a716b;
  --line: #e7e0d9;
  --line-strong: #d6ccc3;
  --accent: #8c4a55;          /* rosa vino: un solo acento */
  --accent-soft: #f4e7e8;
  --on-dark: #faf8f5;
  --dark: #1f1b18;
  --logo-chip: transparent;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: .625rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --shadow: 0 1px 2px rgb(31 27 24 / .04), 0 8px 24px -12px rgb(31 27 24 / .12);
  --shadow-lg: 0 2px 4px rgb(31 27 24 / .04), 0 24px 48px -24px rgb(31 27 24 / .22);

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --max: 72rem;
  --section: clamp(4.5rem, 10vw, 8.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);

  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151312;
    --surface: #1d1a18;
    --tint: #1a1716;
    --ink: #f2ede8;
    --ink-2: #d2cac3;
    --muted: #a29891;
    --line: #2c2724;
    --line-strong: #3b3431;
    --accent: #e2b0b6;
    --accent-soft: #2c2023;
    --dark: #f2ede8;
    --on-dark: #151312;
    --logo-chip: #f2ede8;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 48px -24px rgb(0 0 0 / .6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1, h2 { font-family: var(--serif); letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; }
em { font-style: italic; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section-tint { background: var(--tint); }
.lede { font-size: clamp(1rem, 1.4vw, 1.125rem); color: var(--ink-2); max-width: 56ch; }
.kicker {
  margin-bottom: .9rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 50; top: .75rem; left: .75rem; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Botones y enlaces ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3rem;
  padding: .75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-dark { background: var(--dark); color: var(--on-dark); }
.btn-dark:hover { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 2.5rem; padding: .55rem 1.1rem; font-size: .875rem; }
.btn-block { width: 100%; }
@media (prefers-color-scheme: dark) { .btn-dark:hover { color: #151312; } }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.link-arrow svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}
/* Sobre el hero: texto claro, como el diseño original */
.nav.on-hero { color: #f6f4f1; border-bottom-color: rgb(246 244 241 / .22); }
.nav.on-hero.is-dim {
  background: rgb(24 17 15 / .55);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom-color: rgb(246 244 241 / .12);
}
.nav.on-hero .brand-text small, .nav.on-hero .nav-menu nav a { color: rgb(246 244 241 / .85); }
.nav.on-hero .nav-menu nav a:hover { color: #fff; }
.nav.on-hero .btn-dark { background: transparent; color: #f6f4f1; border-color: rgb(246 244 241 / .58); }
.nav.on-hero .btn-dark:hover { background: rgb(246 244 241 / .14); box-shadow: none; }
.nav.on-hero .nav-toggle { background: transparent; border-color: rgb(246 244 241 / .4); }
.nav.on-hero :focus-visible { outline-color: #f6f4f1; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; text-decoration: none; white-space: nowrap; }
.brand img { width: 2.4rem; }
.brand-text { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; letter-spacing: .14em; line-height: 1; text-transform: uppercase; }
.brand-text small { font-size: .74rem; font-weight: 400; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.nav-menu { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.5rem); }
.nav-menu nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.nav-menu nav a {
  position: relative;
  padding-block: .5rem;
  font-size: .9rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-menu nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 .2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-menu nav a:hover, .nav-menu nav a[aria-current="true"] { color: var(--ink); }
.nav-menu nav a:hover::after, .nav-menu nav a[aria-current="true"]::after { transform: scaleX(1); }
.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.nav-toggle svg { width: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.nav-toggle path { transform-box: view-box; transform-origin: 12px 12px; transition: transform .25s var(--ease); }
.nav-toggle[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero (diseño original) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #201814;
  color: #f6f4f1;
}
.hero-image, .hero::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { object-fit: cover; object-position: 67% 50%; z-index: -2; }
.hero::before {
  content: "";
  z-index: -1;
  background:
    linear-gradient(0deg, rgb(24 17 15 / .84), transparent 27%, transparent 80%, rgb(24 17 15 / .75)),
    linear-gradient(90deg, rgb(24 17 15 / .92), rgb(24 17 15 / .7) 38%, rgb(24 17 15 / .13) 70%, transparent);
}
.hero :focus-visible { outline-color: #f6f4f1; }
.hero-inner {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: clamp(1.5rem, 4vh, 3.5rem);
  padding-top: clamp(7rem, 16vh, 12rem);
  padding-bottom: clamp(1rem, 3vh, 2rem);
}
.hero-copy { align-self: center; }
.hero h1 { font-size: clamp(3.3rem, 7vw, 6rem); line-height: 1; letter-spacing: -.035em; margin-bottom: 1.25rem; text-wrap: initial; }
.hero h1 em { display: block; font-style: normal; color: #e4c3c6; font-weight: inherit; }
.hero-copy > p { font-size: clamp(1rem, 2vw, 1.17rem); max-width: 41ch; margin-bottom: 1.75rem; }
.hero-footer { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.hero-next { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; font-size: .9rem; font-weight: 600; }
.hero-next svg { width: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.hero-credit { margin: 0; text-align: right; font-size: .83rem; }
.hero-credit span { display: block; }
.btn-primary {
  min-height: 3.25rem;
  padding-inline: 1.6rem 1.4rem;
  border-radius: .5rem;
  background: #f6f4f1;
  color: #1f1b18;
  letter-spacing: .01em;
}
.btn-primary:hover { background: #fff; box-shadow: 0 10px 30px -12px rgb(0 0 0 / .5); }

/* ---------- Encabezados de sección ---------- */
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); max-width: 44rem; }
.section-head > :last-child { margin-bottom: 0; }
.section-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  max-width: none;
}
.section-head-row h2 { margin-bottom: 0; }

/* ---------- Servicios ---------- */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 7vw, 6rem); }
.service {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.75rem 1.25rem;
  border-top: 1px solid var(--line);
}
.service > * { grid-column: 2; }
.num { grid-column: 1; grid-row: 1; padding-top: .55rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; color: var(--muted); }
.service h3 { font: 500 clamp(1.5rem, 2.4vw, 1.9rem)/1.15 var(--serif); letter-spacing: -.015em; margin-bottom: .6rem; }
.service p { font-size: .95rem; color: var(--muted); margin-bottom: .5rem; max-width: 46ch; }
.service .link-arrow { justify-self: start; }

/* ---------- Proceso ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
  counter-reset: step;
  position: relative;
}
.steps::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: var(--line-strong);
}
.steps li { position: relative; }
.step-num {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--tint);
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--accent);
}
.steps h3 { margin-bottom: .4rem; }
.steps p { margin: 0; font-size: .9rem; color: var(--muted); max-width: 26ch; }

/* ---------- Sobre mí ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(2.5rem, 7vw, 6.5rem); }
.about-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 72% 50%;
  border-radius: var(--radius-lg);
}
.credentials { list-style: none; padding: 0; margin: 2rem 0 1.5rem; }
.credentials li { padding-block: .9rem; border-top: 1px solid var(--line); }
.credentials li:last-child { border-bottom: 1px solid var(--line); }
.credentials strong { display: block; font-weight: 600; font-size: .95rem; }
.credentials span { display: block; font-size: .87rem; color: var(--muted); }
.note { color: var(--ink-2); font-size: .95rem; }
.note strong { font-weight: 600; color: var(--ink); }

/* ---------- Logos (carrusel original con descripción) ---------- */
.training { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.training-head { margin-bottom: 1.75rem; }
.training-head h2 { margin-bottom: 0; font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
.training-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #2e2a27;
}
.training-list {
  display: flex;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 1.5rem 0;
  animation: marquee 60s linear infinite;
}
.training-window:hover .training-list,
.training-window:focus-within .training-list { animation-play-state: paused; }
.training-list li {
  display: grid;
  grid-template-rows: 3.25rem auto;
  justify-items: center;
  align-content: start;
  gap: .7rem;
  width: 11.5rem;
  padding: 0 1rem;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.35;
}
.training-list li { border-right: 1px solid #eee8e2; }
.training-list img { width: 8rem; height: 3.25rem; object-fit: contain; }
/* Logos blancos (IPMA, APPROLOG): se muestran en tono oscuro sobre el panel claro */
.training-list .logo-light img { filter: invert(.86); }
.training-list small { display: block; margin-top: .2rem; color: #7a716b; font-size: .72rem; font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .training-list { animation: none; flex-wrap: wrap; justify-content: center; width: auto; row-gap: 1.75rem; }
  .training-list li { border-right: 0; }
  .training-list [aria-hidden="true"] { display: none; }
}

/* ---------- Split (trayectoria / FAQ) ---------- */
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2.5rem, 7vw, 6.5rem); align-items: start; }
.split-aside { position: sticky; top: 7rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline time { padding-top: .1rem; font-size: .82rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.timeline h3 { margin-bottom: .3rem; }
.timeline p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ---------- Publicaciones ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: .5rem 1.5rem;
  align-items: baseline;
  padding-block: 1.35rem;
  border-top: 1px solid var(--line-strong);
}
.pub-list li:last-child { border-bottom: 1px solid var(--line-strong); }
.date { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pub-list h3 { font: 500 clamp(1.1rem, 1.8vw, 1.3rem)/1.35 var(--serif); letter-spacing: -.01em; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / .65rem 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px .65rem no-repeat;
  transition: transform .25s var(--ease), background-color .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover::after { background-color: var(--accent-soft); }
.faq details p { margin: 0; padding: 0 3rem 1.5rem 0; color: var(--muted); }

/* ---------- Contacto ---------- */
.contact { background: var(--tint); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 7vw, 6.5rem);
  align-items: start;
}
.contact-info > p { color: var(--ink-2); max-width: 38ch; }
.contact-list { list-style: none; margin: 2rem 0 0; padding: 1.25rem 0 0; display: grid; gap: .15rem; border-top: 1px solid var(--line-strong); }
.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  font-size: .95rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-list a:hover { color: var(--accent); }
.contact-list svg { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { font-size: .85rem; font-weight: 600; }
.field label span { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .7rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a716b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 1rem;
}
textarea { resize: vertical; min-height: 7rem; }
.form-note { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem; }
.footer-inner p { margin: 0; font-size: .82rem; color: var(--muted); }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 30;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: #1f8f4e;
  color: #fff;
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / .35);
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.wa-float.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 1.6rem; height: 1.6rem; }

/* ==========================================================================
   Animaciones ligadas al scroll
   Solo se activan con la clase .motion (JS activo y sin "reducir movimiento").
   ========================================================================== */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* Barra de progreso de lectura */
.progress {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.nav.on-hero .progress { background: #e4c3c6; }

/* Hero: entrada al cargar */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.motion .hero-image { animation: fade 1.6s var(--ease-out) both; transform: scale(1.08); will-change: transform; }
.motion .hero-copy { will-change: transform, opacity; }
.motion .hero h1,
.motion .hero h1 em,
.motion .hero-copy > p,
.motion .hero-copy > .btn { animation: rise 1.2s var(--ease-out) both; }
.motion .hero h1 { animation-delay: .15s; }
.motion .hero h1 em { animation-delay: .32s; }
.motion .hero-copy > p { animation-delay: .5s; }
.motion .hero-copy > .btn { animation-delay: .65s; }
.motion .hero-footer { animation: fade 1.2s .9s var(--ease-out) both; }
.motion .nav { animation: fade 1s .1s var(--ease-out) both; }

/* Elementos sueltos: suben y aparecen */
.motion .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.motion .reveal.is-in { opacity: 1; transform: none; }

/* Grupos (etiqueta, título, párrafo): escalonados con un leve desenfoque */
.motion .reveal-group > * {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms);
}
.motion .reveal-group.is-in > * { opacity: 1; transform: none; filter: none; }
.motion .reveal-group .kicker { letter-spacing: .32em; transition-property: opacity, transform, filter, letter-spacing; }
.motion .reveal-group.is-in .kicker { letter-spacing: .16em; }

/* Líneas divisorias que se dibujan */
.motion :is(.service, .timeline li, .pub-list li, .credentials li).reveal { position: relative; border-top-color: transparent; }
.motion :is(.service, .timeline li, .pub-list li, .credentials li).reveal::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.motion .faq details.reveal { position: relative; border-color: transparent; }
.motion .faq details.reveal::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + 150ms);
}
.motion .faq details.reveal:first-child { border-top-color: var(--line); }
.motion .reveal.is-in::before, .motion .faq details.reveal.is-in::after { transform: scaleX(1); }

/* Proceso: la línea se traza y los pasos aparecen en secuencia */
.motion .reveal-steps::before { transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--ease-out) .1s; }
.motion .reveal-steps.is-in::before { transform: scaleX(1); }
.motion .reveal-steps .step-num { opacity: 0; transform: scale(.4); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.motion .reveal-steps :is(h3, p) { opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.motion .reveal-steps li .step-num { transition-delay: calc(var(--i, 0) * 220ms + 200ms); }
.motion .reveal-steps li :is(h3, p) { transition-delay: calc(var(--i, 0) * 220ms + 320ms); }
.motion .reveal-steps.is-in :is(.step-num, h3, p) { opacity: 1; transform: none; }
.motion .reveal-steps li.reveal { opacity: 1; transform: none; }

/* Imagen: se revela con una máscara y se mueve con parallax */
.about-media { overflow: hidden; border-radius: var(--radius-lg); }
.motion .reveal-img {
  clip-path: inset(18% 8% 18% 8% round var(--radius-lg));
  transition: clip-path 1.5s var(--ease-out);
}
.motion .reveal-img.is-in { clip-path: inset(0 0 0 0 round var(--radius-lg)); }
.motion .reveal-img img { transform: translate3d(0, var(--py, 0px), 0) scale(1.14); will-change: transform; }

/* ---------- Responsive ---------- */
@media (max-width: 64rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.5rem; }
  .steps::before { display: none; }
}

@media (max-width: 52rem) {
  .nav-toggle { display: grid; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    gap: 1rem;
    padding: .5rem var(--gutter) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-menu nav { display: grid; gap: 0; }
  .nav-menu nav a { padding-block: .85rem; font-size: 1rem; border-bottom: 1px solid var(--line); }
  .nav-menu nav a::after { display: none; }
  .nav-menu .btn { width: 100%; min-height: 3rem; }

  .about-grid, .split, .section-head-row, .contact-grid, .service-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-image { object-position: 88% center; }
  .hero::before {
    background: linear-gradient(180deg, rgb(24 17 15 / .82), transparent 21%, rgb(24 17 15 / .1) 31%, rgb(24 17 15 / .9) 58%, rgb(24 17 15 / .98));
  }
  .hero-inner { padding-top: max(7rem, 37svh); }
  .hero-copy { align-self: end; }
  .hero h1 { font-size: clamp(2.65rem, 10vw, 4.65rem); }
  .hero-credit { font-size: .72rem; }
  .about-media img { aspect-ratio: 3 / 2; object-position: 60% 50%; }
  .split-aside { position: static; }
}

@media (max-width: 36rem) {
  .brand-text small { display: none; }
  .pub-list li { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .steps li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 1rem; padding-bottom: 1.5rem; }
  .steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.25rem; top: 2.5rem; bottom: 0; width: 1px; background: var(--line-strong); }
  .motion .reveal-steps li::after { transform: scaleY(0); transform-origin: top; transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 220ms + 450ms); }
  .motion .reveal-steps.is-in li::after { transform: none; }
  .step-num { grid-row: span 2; margin: 0; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .faq details p { padding-right: 0; }
}
