/* =========================================================
   Bastián Tapia · Abogado
   Lujo silencioso, precisión jurídica, sofisticación editorial.
   Instrument Serif (titulares) + Inter (texto e interfaz).
   ========================================================= */

:root {
  /* Paleta */
  --navy: #101F32;          /* azul marino profundo: color institucional */
  --paper: #F8F7F4;         /* blanco cálido: amplitud */
  --slate: #667584;         /* gris pizarra: textos secundarios grandes */
  --mist: #A9B9C9;          /* azul grisáceo: acentos sobre azul marino */
  --ink: #20262D;           /* negro suave: texto */

  /* Derivados (para contraste AA y superficies) */
  --slate-text: #56606C;    /* pizarra oscurecido: texto pequeño con contraste AA */
  --tint: #EFEEE9;          /* blanco cálido apenas más denso: franjas */
  --navy-2: #172A42;        /* superficie sobre azul marino */
  --line: rgba(16, 31, 50, .13);
  --line-strong: rgba(16, 31, 50, .28);
  --line-dark: rgba(248, 247, 244, .14);

  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --header: 68px;
  --t: 200ms;
  --ease: cubic-bezier(.2, .6, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--navy); color: var(--paper); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
section[id] { scroll-margin-top: var(--header); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { font: 500 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--slate-text); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px;
  font: 500 14.5px/1 var(--sans); letter-spacing: .01em;
  text-decoration: none; border: 1px solid transparent; border-radius: 1px;
  cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn-arrow { transition: transform .35s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }

.btn--solid { background: var(--navy); color: var(--paper); }
.btn--solid::before { background: #23395A; }
.btn--line { color: var(--navy); border-color: var(--line-strong); }
.btn--line::before { background: var(--navy); }
.btn--line:hover { color: var(--paper); border-color: var(--navy); }
.btn--paper { background: var(--paper); color: var(--navy); }
.btn--paper::before { background: var(--mist); }

/* Enlace y botones de texto: subrayado fino que se dibuja al pasar el cursor */
.link, .toggle, .more summary, .case-link {
  font: 500 14px/1.4 var(--sans); color: var(--navy);
  text-decoration: none; background: none; border: 0; padding: 0 0 3px; cursor: pointer;
  background-image: linear-gradient(var(--line-strong), var(--line-strong)), linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%, 0 100%; background-size: 100% 1px, 0 1px;
  transition: color var(--t) var(--ease), background-size .45s var(--ease-out);
}
.link:hover, .toggle:hover, .more summary:hover, .case-link:hover { background-size: 100% 1px, 100% 1px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header);
  background: rgba(248, 247, 244, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), transform .5s var(--ease-out);
}
.site-header.is-scrolled { border-color: var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 30px; width: auto; transition: opacity var(--t) var(--ease); }
.brand:hover .brand-logo { opacity: .7; }
.nav { display: flex; align-items: center; gap: 30px; font: 500 13.5px/1.4 var(--sans); }
.nav a { text-decoration: none; color: var(--ink); padding: 4px 0; border-bottom: 1px solid transparent; transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.nav a:hover { color: var(--navy); border-color: var(--line-strong); }
.nav a.is-active { color: var(--navy); border-color: var(--navy); }
.nav .nav-cta { padding: 10px 18px; border: 1px solid var(--navy); color: var(--navy); transition: color var(--t) var(--ease), background-color var(--t) var(--ease), translate .5s var(--ease-out); }
.nav .nav-cta:hover, .nav .nav-cta.is-active { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.menu-btn { display: none; }
.read-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--navy);
  transform: scaleX(var(--sp, 0)); transform-origin: left; pointer-events: none;
}

/* ---------- Portada ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header) + clamp(28px, 4vw, 56px)) 0 clamp(28px, 3vw, 44px);
}
.hero-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 34%; background: var(--navy); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-text, .hero-facts { position: relative; }
.hero-name {
  font: 400 clamp(64px, 10.5vw, 168px)/.88 var(--serif);
  letter-spacing: -.02em; color: var(--navy);
  margin: 20px 0 32px;
}
.hero-claim { font: 400 clamp(26px, 2.6vw, 38px)/1.18 var(--serif); color: var(--navy); margin-bottom: 24px; }
.hero-claim em { display: block; font-style: italic; color: var(--slate); }
.hero-lead { max-width: 54ch; font-size: clamp(16px, 1.2vw, 18px); color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
/* Escritorio: la foto queda centrada dentro del panel azul (34% del ancho) y escala con él */
.hero-figure {
  --fw: clamp(230px, 20.5vw, 330px);
  position: absolute; z-index: 0;
  width: var(--fw);
  right: calc(17% - var(--fw) / 2);
  top: calc(50% - var(--fw) * .625);
}
.hero-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--navy-2); }
.hero-photo img { width: 100%; height: 110%; object-fit: cover; object-position: 50% 22%; }
.hero-figure::after {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
  border: 1px solid rgba(169, 185, 201, .55); pointer-events: none;
}
.hero-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); width: 62%;
}
.hero-facts div { padding: 16px 24px 0 0; }
.hero-facts dt { font: 500 11.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--slate-text); margin-bottom: 6px; }
.hero-facts dd { font-size: 14.5px; line-height: 1.45; }

/* ---------- Secciones ---------- */
.section { position: relative; padding: clamp(80px, 11vw, 160px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section--tint { background: var(--tint); }
.section--navy { background: var(--navy); color: var(--paper); }
.section--navy, .section--navy + .section, .section--tint, .section--tint + .section { border-top-color: transparent !important; }

.section-head {
  display: grid; grid-template-columns: 110px minmax(0, 6fr) minmax(0, 5fr);
  gap: 0 clamp(24px, 4vw, 64px); align-items: end;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.num { font: 400 clamp(44px, 4.4vw, 64px)/1 var(--serif); color: var(--mist); align-self: start; }
.section-head .eyebrow { margin-bottom: 16px; }
.title { font: 400 clamp(42px, 5.2vw, 76px)/1.02 var(--serif); letter-spacing: -.012em; color: var(--navy); max-width: 16ch; }
.section-lead { font-size: clamp(16px, 1.2vw, 18px); color: var(--ink); max-width: 56ch; }
.section-foot { margin-top: 40px; font-size: 15px; color: var(--slate-text); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }

.section--navy .title, .section--navy .contact-title { color: var(--paper); }
.section--navy .eyebrow { color: var(--mist); }
.section--navy .num { color: rgba(169, 185, 201, .55); }
.section--navy .section-lead { color: rgba(248, 247, 244, .82); }
.section--navy :focus-visible { outline-color: var(--paper); }

/* ---------- 01 · Áreas de práctica ---------- */
.practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.practice {
  position: relative; display: flex; flex-direction: column;
  padding: 36px clamp(20px, 2.4vw, 40px) 36px 0;
  border-right: 1px solid var(--line);
}
.practice + .practice { padding-left: clamp(20px, 2.4vw, 40px); }
.practice:last-child { border-right: 0; }
.practice::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--navy);
  transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out);
}
.practice:hover::before, .practice.is-open::before { transform: scaleX(1); }
.practice-num { font: 400 15px/1 var(--serif); color: var(--slate); margin-bottom: 52px; letter-spacing: .04em; }
.practice-title { font: 400 clamp(28px, 2.4vw, 36px)/1.1 var(--serif); color: var(--navy); margin-bottom: 20px; min-height: 2.2em; }
.practice-text p { font-size: 15.5px; color: var(--ink); margin-bottom: .9em; }
.practice-text p:last-child { margin-bottom: 0; }
.practice .toggle, .other .toggle { align-self: flex-start; margin-top: auto; }
.practice-text { overflow: hidden; margin-bottom: 22px; }

/* Divulgación progresiva: primer párrafo recortado, el resto al pedirlo */
.js [data-expand]:not(.is-open) .practice-text p:not(:first-child) { display: none; }
.js [data-expand]:not(.is-open) .practice-text p:first-child {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.toggle { display: none; }
.js .toggle { display: inline-block; }
.toggle::after, .more summary::after { content: " +"; color: var(--slate); font-weight: 400; }
.js [data-expand].is-open .toggle::after, .more[open] summary::after { content: " –"; }

/* ---------- 02 · Enfoque ---------- */
.statement { margin: 0 0 clamp(56px, 7vw, 104px); padding-left: calc(110px + clamp(24px, 4vw, 64px)); }
.statement p { font: 400 clamp(26px, 2.7vw, 42px)/1.28 var(--serif); color: var(--paper); max-width: 25em; }
.method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-dark); }
.method-step { padding: 30px 28px 0 0; }
.method-step + .method-step { padding-left: 28px; border-left: 1px solid var(--line-dark); }
.method-num { font: 400 15px/1 var(--serif); color: var(--mist); margin-bottom: 40px; }
.method-title { font: 500 18px/1.3 var(--sans); color: var(--paper); margin-bottom: 12px; }
.method-step p:last-child { font-size: 15px; color: rgba(248, 247, 244, .76); }

/* ---------- 03 · Trayectoria ---------- */
.journey { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.journey-photo { position: sticky; top: calc(var(--header) + 32px); }
.photo-frame { aspect-ratio: 3 / 4; overflow: hidden; background: var(--tint); }
.photo-frame img { width: 100%; height: 116%; object-fit: cover; object-position: 50% 50%; }
.journey-photo figcaption { margin-top: 12px; font-size: 13px; color: var(--slate-text); }

.chrono { position: relative; border-top: 1px solid var(--line-strong); }
.chrono::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.chrono-item { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 0 28px; padding: 34px 0 36px; border-bottom: 1px solid var(--line); }
.chrono-item::before {
  content: ""; position: absolute; left: 0; top: 42px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--navy);
}
.chrono-item:first-child::before { background: var(--navy); }
.chrono-date { padding-left: 30px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; padding-top: 4px; }
.chrono-date span:first-child { font: 400 26px/1.1 var(--serif); color: var(--navy); }
.chrono-date span:last-child { font-size: 13px; color: var(--slate-text); margin-top: 4px; }
.tag { display: inline-block; font: 500 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--navy); padding: 7px 10px; border: 1px solid var(--line-strong); margin-bottom: 16px; }
.tag--private { color: var(--slate-text); border-color: var(--line); }
.chrono-place { font: 400 clamp(24px, 2.1vw, 30px)/1.15 var(--serif); color: var(--navy); margin-bottom: 8px; }
.chrono-pos { font-size: 14px; color: var(--slate-text); margin-bottom: 14px; }
.chrono-summary { font-size: 16px; max-width: 60ch; }

/* Desplegables */
.more { margin-top: 16px; }
.more summary { display: inline-block; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-body { overflow: hidden; }
.more-body p { font-size: 15.5px; color: var(--ink); max-width: 62ch; margin-top: .9em; }

/* ---------- 04 · Sentencias ---------- */
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.case {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); padding: 32px 30px 30px; border: 1px solid var(--line);
  transition: border-color .4s var(--ease);
}
.case::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--navy);
  transform-origin: left; transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--rd, 0s) + .2s);
}
.js .case:not(.is-in)::before { transform: scaleX(0); }
.case:hover { border-color: var(--line-strong); }
.case-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.case-year { font: 400 64px/.9 var(--serif); color: var(--navy); }
.case-court { font: 500 11.5px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--slate-text); text-align: right; }
.case-title { font: 400 25px/1.18 var(--serif); color: var(--navy); margin-bottom: 20px; }
.case-meta { margin-bottom: 20px; }
.case-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.case-meta div:last-child { border-bottom: 1px solid var(--line); }
.case-meta dt { color: var(--slate-text); }
.case-meta dd { text-align: right; }
.case-result { font-size: 15px; padding-left: 14px; border-left: 2px solid var(--mist); }
.case-result span { display: block; font: 500 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--navy); margin-bottom: 4px; }
.case .more { margin-top: 20px; }
.case-link { align-self: flex-start; margin-top: 20px; }

/* ---------- 05 · Formación ---------- */
.formation { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 104px); align-items: start; padding-left: calc(110px + clamp(24px, 4vw, 64px)); }
.formation-text p { font: 400 clamp(20px, 1.7vw, 24px)/1.45 var(--serif); color: var(--navy); margin-bottom: 1em; }
.credentials { border-top: 1px solid var(--line-strong); }
.credentials li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cred-year { font: 400 20px/1.3 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.cred-body { font-size: 14.5px; color: var(--slate-text); }
.cred-body strong { display: block; font: 500 16px/1.4 var(--sans); color: var(--ink); margin-bottom: 4px; }

/* ---------- 06 · Otras áreas ---------- */
.other-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 80px); padding-left: calc(110px + clamp(24px, 4vw, 64px)); }
.other { display: flex; flex-direction: column; padding: 28px 0 30px; border-top: 1px solid var(--line-strong); }
.other-title { font: 500 18px/1.35 var(--sans); color: var(--ink); margin-bottom: 12px; }
.other .practice-text p { font-size: 15px; color: var(--slate-text); }
.js .other:not(.is-open) .practice-text p:first-child { -webkit-line-clamp: 2; line-clamp: 2; }

/* ---------- 07 · Contenido ---------- */
.content-block { display: block; padding-left: calc(110px + clamp(24px, 4vw, 64px)); }
.content-text { font: 400 clamp(24px, 2.4vw, 34px)/1.3 var(--serif); color: var(--navy); max-width: 36ch; }
.content-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- 08 · Contacto ---------- */
.section--contact { padding-bottom: 0; }
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 104px); align-items: start; padding-left: calc(110px + clamp(24px, 4vw, 64px)); }
.contact-title { font: 400 clamp(44px, 5.6vw, 88px)/1.02 var(--serif); letter-spacing: -.015em; max-width: 15ch; margin-bottom: 40px; }
.contact-mail {
  display: inline-block; font: 400 clamp(24px, 2.4vw, 34px)/1.2 var(--serif); color: var(--paper);
  text-decoration: none; padding-bottom: 4px; overflow-wrap: anywhere;
  background-image: linear-gradient(rgba(248, 247, 244, .35), rgba(248, 247, 244, .35)), linear-gradient(var(--paper), var(--paper));
  background-repeat: no-repeat; background-position: 0 100%, 0 100%; background-size: 100% 1px, 0 1px;
  transition: background-size .5s var(--ease-out);
}
.contact-mail:hover { background-size: 100% 1px, 100% 1px; }
.contact-actions { margin-top: 32px; }
.contact-links { margin-top: 56px; max-width: 520px; border-top: 1px solid var(--line-dark); }
.contact-links a { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-dark); text-decoration: none; font-size: 15px; color: var(--paper); transition: color var(--t) var(--ease), padding var(--t) var(--ease); }
.contact-links a:hover { color: var(--mist); padding-left: 6px; }
.cl-name { display: inline-flex; align-items: center; gap: 12px; }
.cl-icon { width: 15px; height: 15px; flex: none; color: var(--mist); }
.cl-handle { color: var(--mist); }
.independence { padding: 30px 30px 32px; background: var(--navy-2); border-top: 2px solid var(--mist); }
.independence-title { font: 400 24px/1.2 var(--serif); color: var(--paper); margin-bottom: 16px; }
.independence p { font-size: 14.5px; color: rgba(248, 247, 244, .8); margin-bottom: .9em; }
.independence p:last-child { margin-bottom: 0; }

.site-footer { margin-top: clamp(72px, 9vw, 128px); border-top: 1px solid var(--line-dark); padding: 28px 0 36px; font-size: 13px; color: var(--mist); }
.footer-inner { display: flex; align-items: center; gap: 14px 32px; flex-wrap: wrap; }
.footer-logo { height: 26px; width: auto; filter: brightness(0) invert(.96); opacity: .9; }
.footer-note { margin-left: auto; max-width: 560px; }

/* ---------- Texto justificado: todos los párrafos (no títulos, etiquetas ni botones) ---------- */
.hero-lead, .section-lead, .statement p, .method-step p:last-child,
.practice-text p, .chrono-summary, .more-body p, .case-result,
.formation-text p, .content-text, .independence p, .footer-note {
  text-align: justify; text-justify: inter-word;
  -webkit-hyphens: auto; hyphens: auto;
}

/* =========================================================
   ANIMACIONES (todas dependen de .js; respetan reduced-motion)
   ========================================================= */
.fade { opacity: 0; animation: fadeIn 1s var(--ease-out) var(--d, 0s) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--rd, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.js [data-split] .w-i { display: inline-block; transform: translateY(108%); transition: transform 1.15s var(--ease-out); transition-delay: calc(var(--rd, 0s) + var(--wi, 0) * 70ms); }
.js [data-split].is-in .w-i { transform: none; }

.js .hero-panel { transform: scaleX(0); transform-origin: right; animation: panelIn 1.4s var(--ease-out) .1s forwards; }
@keyframes panelIn { to { transform: scaleX(1); } }
.js .hero-photo { clip-path: inset(100% 0 0 0); animation: unveilUp 1.5s var(--ease-out) .45s forwards; }
.js .hero-photo img { scale: 1.12; animation: settle 2.2s var(--ease-out) .45s forwards; }
.js .hero-figure::after { opacity: 0; transform: translate(-10px, -10px); animation: frameIn 1.2s var(--ease-out) 1.1s forwards; }
@keyframes unveilUp { to { clip-path: inset(0 0 0 0); } }
@keyframes settle { to { scale: 1; } }
@keyframes frameIn { to { opacity: 1; transform: none; } }

.js .chrono::before { transform: scaleY(var(--p, 0)); transform-origin: top; background: var(--navy); }
.js .chrono-item::before { transform: scale(0); transition: transform .6s var(--ease-out) .25s; }
.js .chrono-item.is-in::before { transform: scale(1); }
.js .journey-photo .photo-frame { clip-path: inset(0 0 100% 0); transition: clip-path 1.6s var(--ease-out) .1s; }
.js .journey-photo.is-in .photo-frame { clip-path: inset(0 0 0 0); }
.js .journey-photo { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade, .js .hero-panel, .js .hero-photo, .js .hero-photo img, .js .hero-figure::after { animation-duration: .01s !important; animation-delay: 0s !important; }
  .js .reveal { transform: none; transition: opacity .4s linear; transition-delay: 0s; }
  .js [data-split] .w-i { transform: none; transition: none; }
  .js .journey-photo .photo-frame { clip-path: none; transition: none; }
  .btn::before, .case::before, .practice::before { transition: none; }
}

/* =========================================================
   ADAPTACIÓN A PANTALLAS
   ========================================================= */
@media (max-width: 1100px) {
  .nav { gap: 20px; }
  .section-head { grid-template-columns: 80px minmax(0, 1fr); }
  .section-head .section-lead { grid-column: 2; margin-top: 24px; }
  .statement, .formation, .other-list, .content-block, .contact { padding-left: calc(80px + clamp(24px, 4vw, 64px)); }
  .method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-step:nth-child(3) { padding-left: 0; border-left: 0; }
  .method-step:nth-child(n+3) { margin-top: 32px; padding-top: 30px; border-top: 1px solid var(--line-dark); }
  .cases { grid-template-columns: 1fr; max-width: 720px; }
}

@media (max-width: 1000px) {
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .menu-open .site-header { border-color: var(--line); }
  .menu-btn {
    display: inline-flex; align-items: center; min-height: 44px; margin-right: -10px; padding: 0 10px;
    background: none; border: 0; font: 500 14px/1 var(--sans); color: var(--navy); cursor: pointer;
    -webkit-tap-highlight-color: transparent; position: relative; z-index: 60;
  }
  .nav {
    position: fixed; z-index: 55; top: var(--header); left: 0; right: 0;
    height: calc(100vh - var(--header)); height: calc(100dvh - var(--header));
    overflow-y: auto; overscroll-behavior: contain;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); padding: 8px var(--pad) 40px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav a { display: flex; align-items: center; min-height: 56px; font: 400 26px/1.2 var(--serif); color: var(--navy); padding: 0; border-bottom: 1px solid var(--line); }
  .nav a:hover, .nav a.is-active { border-color: var(--line); }
  .nav a.is-active { box-shadow: inset 2px 0 0 var(--navy); padding-left: 14px; }
  .nav .nav-cta { justify-content: center; margin-top: 28px; min-height: 52px; font: 500 15px/1 var(--sans); background: var(--navy); color: var(--paper); border: 0; }
  .nav .nav-cta.is-active { box-shadow: none; padding-left: 0; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { width: 100%; top: auto; height: 34%; }
  .hero-figure { position: relative; right: auto; top: auto; justify-self: start; width: min(42%, 224px); order: -1; margin: 0 0 8px; }
  .hero-facts { width: 100%; position: relative; }
  .journey { grid-template-columns: 1fr; }
  .journey-photo { position: static; max-width: 460px; }
  .journey-photo .photo-frame { aspect-ratio: 4 / 3; }
  .formation, .contact { grid-template-columns: 1fr; }
}
html.menu-open, html.menu-open body { overflow: hidden; }

@media (max-width: 760px) {
  :root { --header: 58px; }
  body { font-size: 16px; }
  .hero { min-height: auto; }
  .hero-panel { display: none; }
  .hero-figure { width: min(41%, 182px); }
  .hero-figure::after { inset: 12px -12px -12px 12px; border-color: var(--line-strong); }
  .hero-name { margin: 16px 0 24px; }
  .hero-actions .btn, .content-actions .btn { flex: 1 1 100%; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .hero-facts dt { margin: 0; }
  .hero-facts dd { text-align: right; }

  .section-head { grid-template-columns: 1fr; }
  .section-head .section-lead { grid-column: 1; }
  .num { font-size: 40px; margin-bottom: 16px; }
  .statement, .formation, .other-list, .content-block, .contact { padding-left: 0; }

  .practice-grid { grid-template-columns: 1fr; }
  .practice, .practice + .practice { padding: 28px 0 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .practice-num { margin-bottom: 24px; }
  .practice-title { min-height: 0; }
  .method { grid-template-columns: 1fr; }
  .method-step, .method-step + .method-step, .method-step:nth-child(n+3) { padding: 26px 0; border-left: 0; margin-top: 0; }
  .method-step + .method-step { border-top: 1px solid var(--line-dark); }
  .method-num { margin-bottom: 16px; }
  .chrono-item { grid-template-columns: 1fr; gap: 10px; padding-left: 30px; }
  .chrono-date { padding-left: 0; flex-direction: row; align-items: baseline; gap: 10px; }
  .chrono-date span:last-child::before { content: "— "; }
  .case { padding: 26px 22px; }
  .case-year { font-size: 52px; }
  .credentials li { grid-template-columns: 1fr; gap: 4px; }
  .other-list { grid-template-columns: 1fr; }
  .contact-links a .cl-handle { font-size: 13px; }
  .footer-note { margin-left: 0; }
}

/* =========================================================
   ANIMACIONES PREMIUM (capa adicional)
   ========================================================= */

/* Nombre de la portada: letra por letra tras una máscara */
.js .hero-name .hn-w { display: inline-block; white-space: nowrap; }
.js .hero-name .hn-c { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .14em; margin: 0 -.02em -.14em; }
.js .hero-name .hn-ci {
  display: inline-block; transform: translateY(112%) rotate(4deg); transform-origin: left bottom;
  transition: transform 1.2s var(--ease-out); transition-delay: calc(var(--rd, 0s) + var(--ci, 0) * 38ms);
}
.js .hero-name.is-in .hn-ci { transform: none; }

/* Profundidad al salir de la portada (main.js define --hy entre 0 y 1) */
.js .hero-text { translate: 0 calc(var(--hy, 0) * -70px); opacity: calc(1 - var(--hy, 0) * .75); }
.js .hero-figure { translate: 0 calc(var(--hy, 0) * -28px); }
.js .hero-panel { translate: 0 calc(var(--hy, 0) * 48px); }

/* Números de sección que suben desde una máscara y etiquetas que entran */
.js .num { overflow: hidden; }
.js .num-i { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out) .05s; }
.js .section.is-seen .num-i { transform: none; }
.js .section-head .eyebrow { opacity: 0; translate: -14px 0; transition: opacity .9s var(--ease-out) .18s, translate .9s var(--ease-out) .18s; }
.js .section.is-seen .section-head .eyebrow { opacity: 1; translate: 0 0; }

/* Frase de Enfoque: se ilumina palabra por palabra con el scroll */
.js .statement .sw { color: rgba(248, 247, 244, .2); transition: color .5s var(--ease); }
.js .statement .sw.on { color: var(--paper); }

/* Botones magnéticos y fichas que se elevan */
.btn { transition: color .35s var(--ease), border-color .35s var(--ease), translate .5s var(--ease-out); }
.js .case.reveal {
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), translate .5s var(--ease-out), border-color .4s var(--ease);
  transition-delay: var(--rd, 0s), var(--rd, 0s), 0s, 0s;
}
.case:hover { translate: 0 -5px; }
.practice-title { transition: translate .5s var(--ease-out); }
.practice:hover .practice-title { translate: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  .js .hero-name .hn-ci, .js .num-i { transform: none; transition: none; }
  .js .hero-text, .js .hero-figure, .js .hero-panel { translate: none; opacity: 1; }
  .js .section-head .eyebrow { opacity: 1; translate: none; transition: none; }
  .js .statement .sw { color: var(--paper); transition: none; }
  .case:hover, .practice:hover .practice-title { translate: none; }
}
