/* Cinematic Tech Editorial · V4 layer. Loaded after style.css and gallery.css; only refines, never restructures.
   Tokens come from style.css (:root). */

/* ---------- Typography: Instrument Serif runs narrower than the old system serif ---------- */
em.acc, .acc { letter-spacing: -0.01em; }
.hero h1 em { font-size: 1.14em; letter-spacing: -0.012em; padding-right: .08em; }
.h2 em { font-size: 1.1em; letter-spacing: -0.01em; }
.process-intro .h2 em { font-size: 1.08em; }
#final-title em { letter-spacing: -0.01em; }
.sub, .lede, .problem { text-wrap: pretty; }

/* ---------- Reading progress (header) ---------- */
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease-out); }
.site-header.scrolled .read-progress { opacity: 1; }
.read-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--navy), var(--blue) 55%, var(--blue-2)); box-shadow: 0 0 12px rgba(63, 123, 234, .55); }

/* ---------- Active section in the main navigation ---------- */
.nav a[aria-current] { color: var(--ink); background: #fff; box-shadow: 0 6px 16px -10px rgba(6, 19, 42, .45), inset 0 0 0 1px rgba(36, 86, 200, .14); }
.nav a[aria-current]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--blue); }
.nav a, .brand b { white-space: nowrap; }
@media (min-width: 921px) and (max-width: 1100px) {
  .nav a { padding: 8px 11px; font-size: 14px; }
  .site-header .brand small { display: none; }
}
@media (min-width: 921px) and (max-width: 1010px) {
  .site-header .wrap { gap: 12px; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .header-cta { padding: 0 16px; }
}
@media (max-width: 920px) { .nav.open a[aria-current] { background: var(--ice); box-shadow: none; } .nav.open a[aria-current]::after { left: auto; right: 18px; bottom: 50%; margin: 0 0 -2px; } }

/* ---------- Case links: visible evidence count ---------- */
.tlink-count { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; margin-left: 2px; border-radius: 999px; background: var(--ice); color: var(--navy); font: 500 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.case.dark .tlink-count { background: rgba(255, 255, 255, .12); color: #DCE7F8; }

/* ---------- Trayectoria: cards on a timeline ---------- */
.band-tra { padding-top: clamp(72px, 9vw, 128px); }
.tra-grid { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-top: 22px; }
.tra-lead { max-width: 56ch; }
.tra-cv { flex: none; }
.journey { list-style: none; padding: 30px 0 0; margin: clamp(40px, 5vw, 64px) 0 0; gap: 16px; }
.journey > li { padding: 26px 24px 24px !important; gap: 8px; align-content: start; border-radius: 20px; background: rgba(255, 255, 255, .66); border: 1px solid var(--glass-line); box-shadow: 0 24px 50px -36px rgba(6, 19, 42, .45); backdrop-filter: blur(10px); transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out), border-color .6s; }
.journey > li::before, .journey > li::after { top: -36px !important; left: 24px !important; }
.js .journey > li.reveal { transition: opacity 1.1s var(--ease-out), transform .9s var(--ease-out), box-shadow .6s var(--ease-out), border-color .6s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .journey > li:hover, .js .journey > li.reveal.in:hover { transform: translateY(-4px); transition-delay: 0s; border-color: rgba(36, 86, 200, .25); box-shadow: 0 34px 60px -34px rgba(6, 19, 42, .5); }
}
.journey .tl-kind { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: var(--ice); color: var(--navy); font: 600 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.journey .tl-kind::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.journey > li:first-child .tl-kind { background: var(--navy); color: #fff; }
.journey > li:first-child .tl-kind::before { background: var(--sky); }
.journey > li > .mono { margin-top: 6px; }
.journey::after { pointer-events: none; }
@media (min-width: 1000px) { .journey { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Below 1000px four cards no longer fit on one row: the timeline turns vertical instead of wrapping
   (a wrapped row would put its nodes on top of the cards above). */
@media (max-width: 999px) {
  .journey { grid-template-columns: minmax(0, 1fr); padding: 0 0 0 26px; }
  .journey::before { left: 6px; right: auto; top: 6px; bottom: 6px; width: 1.5px; height: auto; background: linear-gradient(180deg, var(--blue), var(--sky) 65%, rgba(158, 192, 245, .15)); }
  .journey::after { display: none; }
  .journey > li::before, .journey > li::after { top: 28px !important; left: -26px !important; }
}

/* ---------- Footer ---------- */
.foot-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px 40px; padding-block: clamp(48px, 6vw, 80px) 32px; border-top: 1px solid var(--line); margin-top: clamp(40px, 5vw, 72px); }
.foot-brand p { margin-top: 16px; max-width: 36ch; color: var(--muted); font-size: 15px; }
.foot-brand .brand { display: inline-flex; min-height: 44px; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.foot-col .mono { color: var(--blue); font-size: 11px; margin-bottom: 8px; }
.foot-col a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; color: var(--ink); font-size: 15px; border-radius: 8px; transition: color .3s var(--ease-out); }
.foot-col a:hover { color: var(--blue); }
.foot-col a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.site-footer .foot { align-items: center; }
.foot-build { color: var(--muted); }
@media (max-width: 899px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; } .foot-build { order: 3; flex-basis: 100%; } }

/* ---------- Reduced / paused motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .journey > li, .journey > li:hover, .js .journey > li.reveal, .js .journey > li.reveal.in:hover { transition: none; transform: none; }
}
.no-motion .journey > li:hover, .js.no-motion .journey > li.reveal.in:hover { transform: none; }

/* ---------- Rhythm: tighten the gap between Capacidades and Trayectoria ---------- */
#capacidades { padding-bottom: clamp(64px, 8vw, 112px); }
.foot-brand .brand small { display: block; font: 500 12.5px/1.35 var(--f-text); letter-spacing: 0; text-transform: none; }

/* ---------- V4.1 · Mobile hero (360–599px): earlier presentation and CTAs ----------
   The identity card becomes a horizontal editorial ID (portrait beside name and role) and the headline
   scale tightens, so the lede and the primary CTA reach the first screen. Tablet and desktop untouched. */
@media (max-width: 599px) {
  .hero { padding-top: calc(92px + env(safe-area-inset-top, 0px)); }
  .hero .eyebrow { margin-top: 16px; }
  .hero h1 { margin-top: 12px; font-size: clamp(2.05rem, 9.3vw, 2.5rem); line-height: 1; letter-spacing: -0.045em; }
  .hero h1 em { font-size: 1.12em; }
  [data-variant="con-foto"] .ph-mobile { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; text-align: left; column-gap: 16px; padding: 12px 18px 12px 12px; margin: 20px 0 0; border-radius: 22px; }
  .ph-mobile .phm-wrap { width: clamp(104px, 30vw, 128px); margin: 0; }
  .ph-mobile .phm-tag { display: none; }
  .ph-mobile figcaption { margin: 0; gap: 5px; }
  .ph-mobile figcaption b { font-size: 18px; }
  .ph-mobile figcaption span { font-size: 12.5px; line-height: 1.45; text-wrap: pretty; }
  .ph-mobile figcaption::before { content: "Perfil profesional"; margin-bottom: 1px; font: 500 9.5px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #7FA8F2; }
  /* the role breaks into two lines instead of wrapping around the separator */
  .ph-mobile .phm-sep { display: block; height: 0; overflow: hidden; font-size: 0; }
  .hero .lede { margin-top: 20px; font-size: .98rem; line-height: 1.55; }
  .hero-actions { margin-top: 22px; gap: 10px; }
  .hero-actions .btn { min-height: 50px; }
  .audience { margin-top: 26px; padding-top: 18px; }
}
