/* Brian Colquhoun — Experience
   Figma: Portfolio 2025 › Experience (15088:6469), 1920 × 3162 + footer.
   Escritorio (≥1280): lienzo de 1920 px con las posiciones exactas del Figma, escalado con `zoom`
   (--k = ancho de ventana / 1920, lo pone js/experience.js). Por debajo: una columna con la línea a la izquierda.
   Animación (solo con JS): la línea se dibuja a medida que bajas; cuando llega a una entrada, el círculo
   aparece, sale el conector, el icono y el texto se escribe letra a letra. */

.page-xp, .footer-panel {
  --xp-ink: #222; --xp-weak: #4e4e4e; --xp-weaker: #7a7a7a; --xp-surface: #f4f4f4; --xp-dash: #2d2d2d;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}

/* ── Panel de Experience en el footer de la home ───────────────────────────
   Figma DS Framework Display (15196:9357): bajo el nombre y los enlaces, a 160 px: la leyenda en una
   fila, 96 px, la línea de tiempo a tamaño real (el lienzo de experience.html recortado desde el
   círculo de EPAM), 96 px y «[ Close ]» a la derecha; 80 px hasta «Brands built as systems».
   js/site.js mete aquí el contenido de experience.html. */
/* Arriba 160 hasta la leyenda (Figma, ajuste del 2026-11-17); abajo, los 80 los pone el margen de .footer__bottom */
.footer-panel .row-panel__body { padding: var(--spacing-x20) 0 0; }
.footer-panel .xp-logo { display: none; }
.footer-panel .xp-legend { position: static; margin: 0; }
/* La infografía ocupa todo el ancho de la ventana, aunque el footer tenga margen */
.footer-panel .xp-crop { margin: var(--spacing-x12) calc(-1 * (var(--page-x) + var(--indent))) 0; overflow: hidden; }
.footer-panel .row-panel__foot { display: flex; justify-content: flex-end; margin-top: var(--spacing-x12); }
@media (min-width: 1280px) {
  /* El lienzo empieza 211,5 px por encima del borde del círculo de EPAM y 19,5 px a la derecha de
     la posición del Figma: se recorta arriba y se corre a la izquierda (dentro del zoom) */
  .footer-panel .xp-stage { margin: -211.5px 0 0 -19.5px; }
}

/* ── Base (móvil y tablet) ─────────────────────────────────────────────── */
.xp-stage { position: relative; padding: var(--spacing-x3) var(--page-x) var(--spacing-x10); }
.xp-logo { display: inline-block; width: 48px; transition: transform var(--t-fast) var(--ease-out); }
.xp-logo:hover { transform: rotate(-8deg) scale(1.06); }

.xp-legend { display: flex; flex-wrap: wrap; gap: var(--spacing-x1-5) var(--spacing-x3); margin: var(--spacing-x7) 0 0; padding: 0; list-style: none; font-size: var(--fonts-size-body-s); line-height: 1.5; color: var(--xp-ink); }
.xp-legend li { display: flex; align-items: center; gap: var(--spacing-x1-5); }
.xp-legend__mark { flex: none; display: block; }
.xp-legend__mark--line { width: 1px; height: 32px; background: repeating-linear-gradient(to bottom, var(--xp-ink) 0 2px, transparent 2px 4px); }
.xp-legend__mark--remote { width: 24px; height: 24px; background: url(../assets/xp-remote.svg) center / 24px no-repeat; }
.xp-legend__mark--onsite { width: 24px; height: 24px; border: 2px solid var(--xp-ink); border-radius: 50%; }
.xp-legend__mark--uni { width: 12px; height: 32px; background: var(--xp-ink); }
.xp-legend__mark--course { width: 32px; height: 12px; background: var(--xp-ink); }

.xp-list { position: relative; margin-top: var(--spacing-x7); padding-left: 64px; }
/* La caja de la línea no se transforma (JS la mide); lo que crece es su ::before */
.xp-rail { position: absolute; left: 20px; top: 0; width: 1px; height: 100%; --rail-bg: repeating-linear-gradient(to bottom, var(--xp-ink) 0 2px, transparent 2px 4px); }
.xp-rail::before { content: ""; position: absolute; inset: 0; background: var(--rail-bg); transform-origin: 50% 0; transform: scaleY(var(--p, 1)); }
.xp-rail--uni { display: none; }
.xp-items { display: flex; flex-direction: column; gap: var(--spacing-x5); margin: 0; padding: 0; list-style: none; }

.xp { position: relative; display: flex; align-items: flex-start; gap: var(--spacing-x2); --iw: 24px; --g: 24px; }
.xp--lead { --iw: 32px; }
.xp--study { --iw: 32px; --g: 16px; }

/* Círculo: exterior gris, anillo claro y punto oscuro (Figma Frame 3374xx) */
.xp__node {
  position: absolute; left: -43.5px; top: 18px; translate: -50% -50%;
  width: max(16px, calc(var(--o) * .35px)); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--xp-surface); border: 1px solid var(--xp-ink);
}
.xp__node::before, .xp__node::after { content: ""; grid-area: 1 / 1; border-radius: 50%; }
.xp__node::before { width: calc(var(--r, 0) * .35px); aspect-ratio: 1; background: var(--page); border: 1px solid var(--xp-ink); }
.xp__node::after { width: calc(var(--d, 0) * .35px); aspect-ratio: 1; background: var(--xp-ink); }
.xp__node--plain { background: var(--page); }
.xp__node--plain::before, .xp__node--plain::after { display: none; }

.xp__link { display: none; position: absolute; height: 1px; background: var(--xp-ink); }

.xp__icon { flex: none; display: block; width: var(--iw); height: var(--iw); margin-top: 4px; }
.xp__icon--remote { width: 24px; height: 24px; background: url(../assets/xp-remote.svg) center / 24px no-repeat; }
.xp--lead .xp__icon--remote { width: 32px; height: 32px; border: 2px solid var(--xp-ink); border-radius: 50%; margin-top: 0; }
.xp__icon--onsite { width: 24px; height: 24px; border: 2px solid var(--xp-ink); border-radius: 50%; }
.xp__icon--course { width: 32px; height: 12px; margin-top: 12px; background: var(--xp-ink); }

.xp__text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.xp__name {
  position: relative; padding-bottom: var(--spacing-x1-5);
  font-family: var(--font-family-heading); font-weight: var(--font-weight-bold);
  font-size: 28px; line-height: 1.2; letter-spacing: -1px; color: var(--xp-ink);
}
.xp--lead .xp__name { font-size: 36px; line-height: 1.15; letter-spacing: -2px; }
/* Línea de puntos bajo el nombre (Figma: border-bottom dashed #2d2d2d) */
.xp__name::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: repeating-linear-gradient(to right, var(--xp-dash) 0 1px, transparent 1px 3px); transform-origin: 0 50%; }
.xp--study .xp__name { padding-bottom: 0; }
.xp--study .xp__name::after { display: none; }
.xp__role { margin-top: var(--spacing-x1-5); font-size: 18px; line-height: 1.4; color: var(--xp-weak); overflow-wrap: anywhere; } /* «(UX/UI/Visual/Brand)» no cabe entero en móvil */
.xp__place { margin-top: var(--spacing-x0-5); font-size: 14px; line-height: 1.5; color: var(--xp-weaker); }
.xp--year { min-height: 24px; align-items: center; }
.xp--year .xp__node { top: 50%; }
.xp__year { font-size: 14px; line-height: 1.5; color: var(--xp-ink); }

/* ── Escritorio: lienzo del Figma (1920 × 3162) ────────────────────────── */
@media (min-width: 1280px) {
  .xp-stage { width: 1920px; height: 3162px; margin-inline: auto; padding: 0; zoom: var(--k, 1); }
  .xp-logo { position: absolute; left: 157px; top: 64px; }
  .xp-legend { position: absolute; left: 679.5px; top: 72px; margin: 0; flex-wrap: nowrap; gap: 48px; font-size: 20px; line-height: 28px; }
  .xp-legend li { gap: 24px; }

  .xp-list { position: absolute; inset: 0; margin: 0; padding: 0; }
  .xp-rail { left: 979px; top: 299.5px; height: 2862.5px; }
  .xp-rail--uni { display: block; left: 974px; width: 12px; top: 2644.21px; height: 517.8px; --rail-bg: var(--xp-ink); }
  .xp-items { display: block; }

  /* Cada entrada es un punto en el lienzo: su centro vertical es --cy y la línea central está en x 979.5 */
  .xp { position: absolute; left: 0; top: calc(var(--cy) * 1px); width: 1920px; height: 0; display: block; }
  .xp__node { left: 979.5px; top: 0; width: calc(var(--o) * 1px); }
  .xp__node::before { width: calc(var(--r, 0) * 1px); }
  .xp__node::after { width: calc(var(--d, 0) * 1px); }

  .xp__link { display: block; top: -.5px; width: calc(var(--l) * 1px); }
  .xp--r .xp__link { left: calc(979.5px + var(--o) * .5px); }
  .xp--l .xp__link { left: calc(979.5px - var(--o) * .5px - var(--l) * 1px); }

  .xp__icon { position: absolute; top: 0; margin: 0; translate: 0 -50%; }
  .xp--lead .xp__icon--remote { margin: 0; }
  .xp--r .xp__icon { left: calc(979.5px + var(--o) * .5px + var(--l) * 1px); }
  .xp--l .xp__icon { left: calc(979.5px - var(--o) * .5px - var(--l) * 1px - var(--iw)); }

  .xp__text { position: absolute; top: 0; translate: 0 var(--ty, -50%); white-space: nowrap; }
  .xp--r .xp__text { left: calc(979.5px + var(--o) * .5px + var(--l) * 1px + var(--iw) + var(--g)); }
  .xp--l .xp__text { right: calc(940.5px + var(--o) * .5px + var(--l) * 1px + var(--iw) + var(--g)); align-items: flex-end; text-align: right; }
  .xp--l .xp__name::after { transform-origin: 100% 50%; }

  .xp__name { font-size: 40px; line-height: 48px; letter-spacing: -1px; }
  .xp--lead .xp__name { font-size: 56px; line-height: 64px; letter-spacing: -2px; }
  .xp--study .xp__name { line-height: 48px; }
  /* Con el lienzo reducido, los textos pequeños no bajan de ~16 y ~12 px reales */
  .xp__role { font-size: max(24px, calc(16px / var(--k, 1))); line-height: 1.333; }
  .xp__place { font-size: max(16px, calc(12px / var(--k, 1))); line-height: 1.5; }
  .xp--study .xp__place { margin-top: 4px; }

  .xp--year .xp__node { top: 0; }
  .xp__year { position: absolute; right: 960.5px; top: 0; translate: 0 -50%; font-size: 16px; line-height: 24px; }
}

/* Ninguna línea pasa por encima de un círculo: los círculos van delante (su fondo tapa el
   conector y la línea vertical si se cruzan, también durante el rebote de su aparición) */
.xp__node { z-index: 2; }
.xp__link { z-index: 1; }

/* ── Animación (solo con JS; sin JS todo se ve) ────────────────────────── */
/* Orden por entrada: 1) el círculo (0–880 ms, con sus anillos), 2) cuando ya está completo, crece el
   conector (900–1280 ms), 3) el icono (1180 ms) y 4) el texto se escribe (desde 1300 ms, T0 en
   js/experience.js). */
.js .xp-rail { --p: 0; }
.js .xp__node { transform: scale(0); transition: transform 700ms var(--pop); }
.js .xp__node::before { transform: scale(0); transition: transform 600ms var(--pop) 140ms; }
.js .xp__node::after { transform: scale(0); transition: transform 600ms var(--pop) 280ms; }
.js .xp.is-on .xp__node, .js .xp.is-on .xp__node::before, .js .xp.is-on .xp__node::after { transform: none; }

/* El conector sale del círculo hacia el texto, cuando el círculo ya terminó de aparecer */
.js .xp__link { transform: scaleX(0); transition: transform 380ms var(--ease-out) 900ms; }
.js .xp--r .xp__link { transform-origin: 0 50%; }
.js .xp--l .xp__link { transform-origin: 100% 50%; }
.js .xp.is-on .xp__link { transform: none; }

.js .xp__icon { opacity: 0; transform: scale(.4); transition: opacity 250ms ease 1180ms, transform 500ms var(--pop) 1180ms; }
.js .xp.is-on .xp__icon { opacity: 1; transform: none; }

/* Texto que se escribe: js/experience.js envuelve cada letra en un span con --i y da a cada línea
   --t0 (cuándo empieza) y --cps (ms por letra). El texto completo queda para lectores de pantalla. */
.tw > span { opacity: 0; }
.xp.is-on .tw > span { opacity: 1; transition: opacity 1ms linear calc(var(--t0, 0ms) + var(--i, 0) * var(--cps, 30ms)); }
.js .xp__name::after { transform: scaleX(0); transition: transform var(--ud, 600ms) linear var(--t0, 650ms); }
.js .xp.is-on .xp__name::after { transform: none; }
