/* Reset minimal for hero */
:root {
  /** Alto del hero al estar reducido (barra superior); mismo valor en scroll-snap-stack.js vía esta variable. */
  --hero-collapsed-height: 100px;

  /* Replace with your brand / accent color (hex, rgb, etc.) */
  --hero-name-color: #ff552b;

  /* Hero background (para debug / toggle rápido) */
  --hero-bg-image: url("../images/h1.jpg");
  --hero-bg-color: #111118;

  /* Overlay del efecto (normalmente usa la misma imagen) */
  --hero-effect-bg-image: url("../images/h1.jpg");
  --hero-effect-bg-color: #ff2bd6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

/**
 * Franja fija izquierda (22px, left -7px): menú por snaps; top 200px, alto máx. 400px.
 */
.edge-bar {
  --edge-indicator-frac: 0;
  position: fixed;
  z-index: 6000;
  left: -7px;
  top: 200px;
  width: 22px;
  height: 400px;
  max-height: 400px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 2px solid #aaaaaa;
  border-radius: 0;
}

.edge-bar__strip {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.edge-bar__strip:focus {
  outline: none;
}

.edge-bar__strip:focus-visible {
  outline: 2px solid #aaaaaa;
  outline-offset: -2px;
}

/**
 * Un solo indicador: posición vertical según --edge-indicator-frac (0–7) = scroll;
 * left calc(100% - 35px): barra más estrecha (22px); mantiene asomo similar a la derecha.
 */
.edge-bar__indicator {
  position: absolute;
  z-index: 4;
  left: calc(100% - 35px);
  top: calc((var(--edge-indicator-frac, 0) + 0.5) / 8 * 100%);
  transform: translateY(-50%);
  width: 35px;
  height: min(52px, 10%);
  background-color: var(--hero-name-color, #ff552b);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

/**
 * Panel de etiqueta: top = franja del menú; slide desde/hacia translateX(-300px).
 */
.edge-bar-back {
  position: fixed;
  z-index: 5990;
  box-sizing: border-box;
  width: max-content;
  max-width: min(960px, calc(100vw - 16px));
  padding: 12px 24px 12px 20px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background-color: #999999;
  border: 2px solid #aaaaaa;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-300px);
  transition:
    transform 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.38s ease,
    visibility 0.48s step-end;
}

.edge-bar-back.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transform: translateX(0);
  transition:
    transform 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.38s ease,
    visibility 0s step-start;
}

.edge-bar-back.is-exiting {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translateX(-300px);
}

.edge-bar-back.is-visible:focus-visible {
  outline: 2px solid var(--hero-name-color, #ff552b);
  outline-offset: 2px;
}

.edge-bar-back__text {
  margin: 0;
  padding: 0;
  max-width: 100%;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: #111111;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .edge-bar-back {
    transition-duration: 0.01ms;
  }

  .edge-bar-back.is-visible,
  .edge-bar-back.is-exiting {
    transform: none;
  }
}

.edge-bar__strip--1 {
  background-color: #999999;
}

.edge-bar__strip--2 {
  background-color: #888888;
}

.edge-bar__strip--3 {
  background-color: #777777;
}

.edge-bar__strip--4 {
  background-color: #666666;
}

.edge-bar__strip--5 {
  background-color: #555555;
}

.edge-bar__strip--6 {
  background-color: #444444;
}

.edge-bar__strip--7 {
  background-color: #333333;
}

.edge-bar__strip--8 {
  background-color: #222222;
}

/**
 * Contenido bajo el hero fijo: scroll global (scroll-snap-stack.js).
 * .stack-spacer da altura para que el primer snap lleve a #c1 debajo del hero colapsado.
 */
.main-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.main-stack > .page-c1,
.main-stack > .page-strip,
.main-stack > .skills,
.main-stack > .page-portfolio,
.main-stack > .page-work,
.main-stack > .page-contact {
  pointer-events: auto;
}

.stack-spacer {
  flex-shrink: 0;
  min-height: 100vh;
  min-height: 100svh;
  pointer-events: none;
  /**
   * Solo color sólido (sin repetir la foto del hero): evita “doble h1” al
   * hacer scroll hero→c1; el hueco lo cubre el vídeo de c1 cuando entra.
   */
  background-color: var(--hero-bg-color, #0a0a0c);
}

.page-c1 {
  --c1-inline-start: 60px;

  position: relative;
  overflow-x: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
  /* Una “pantalla útil” bajo el hero colapsado (coincide con el área visible al hacer snap). */
  min-height: calc(100vh - var(--hero-collapsed-height));
  min-height: calc(100svh - var(--hero-collapsed-height));
  min-height: calc(100dvh - var(--hero-collapsed-height));
  width: 100vw;
  background-color: transparent;
  font-family: "santana-blackregular", system-ui, sans-serif;
  color: #0a0a0c;
  text-align: left;
}

.c1-fixed-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  /* Solo visible en c1 (body.is-c1-view): evita que el fixed “se cuele” sobre hero / otros paneles. */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.38s ease, visibility 0s linear 0.38s;
}

body.is-c1-view .c1-fixed-bg {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

.c1-scroll-layer {
  position: relative;
  width: 100vw;
  min-height: inherit;
  z-index: 1;
}

.c1-panels {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
}

.c1-panel {
  position: absolute;
  left: 0;
  width: 100%;
  background-color: var(--hero-name-color);
}

.c1-panel--top {
  top: 0;
  height: 40vh;
  height: 40svh;
  height: 40dvh;
}

.c1-panel--bottom {
  top: 80vh;
  top: 80svh;
  top: 80dvh;
  height: 20vh;
  height: 20svh;
  height: 20dvh;
}

/**
 * Texto grande en la franja del vídeo (40vh–80vh): negro 50% opacidad,
 * desplazamiento continuo derecha → izquierda, detrás de paneles y slide.
 */
.c1-bg-marquee {
  position: absolute;
  left: 0;
  right: 0;
  top: 40vh;
  top: 40svh;
  top: 40dvh;
  height: 40vh;
  height: 40svh;
  height: 40dvh;
  z-index: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.c1-bg-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  animation: c1-bg-marquee-x 45s linear infinite;
  will-change: transform;
}

.c1-bg-marquee__text {
  flex-shrink: 0;
  padding-right: 0.35em;
  box-sizing: content-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(180px, 28vw, 400px);
  font-weight: normal;
  line-height: 0.82;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.5);
  user-select: none;
}

@keyframes c1-bg-marquee-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .c1-bg-marquee__track {
    animation: none;
    transform: translateX(0);
  }
}

/**
 * js/c1-view-animations.js → body.is-c1-view.
 * Entrada: slide desde la izquierda. Salida: sin transform (suben con el scroll).
 * c1-enter-prep fuerza el origen -100vw un frame antes de la transición al entrar.
 */
.c1-slide {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  flex-shrink: 0;
  width: calc(100% - 100px);
  max-width: calc(100% - 100px);
  box-sizing: border-box;
  margin: 0;
  /* Sobre el panel superior: a 30px del borde superior visible de la foto (que empieza en 40*vh). */
  top: calc(40vh - 30px);
  top: calc(40svh - 30px);
  top: calc(40dvh - 30px);
  translate: 0 -100%;
}

.c1-seccion,
.c1-tit,
.c1-text {
  transform: translateY(-20px);
}

body.c1-enter-prep .c1-seccion,
body.c1-enter-prep .c1-tit,
body.c1-enter-prep .c1-text {
  transform: translateY(-20px) !important;
  transition: none !important;
}

body.is-c1-view .c1-seccion {
  transform: translateY(0);
  transition: transform 0.9s cubic-bezier(0.33, 1, 0.68, 1);
  transition-delay: 0.25s;
}

body.is-c1-view .c1-tit {
  transform: translateY(0);
  transition: transform 1s cubic-bezier(0.33, 1, 0.68, 1);
  transition-delay: 0.75s;
}

body.is-c1-view .c1-text {
  transform: translateY(0);
  transition: transform 1.5s cubic-bezier(0.33, 1, 0.68, 1);
  transition-delay: 0.5s;
}

.c1-seccion {
  margin: 0 0 14px 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: 25px;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #0a0a0c;
  text-align: center;
}

/* Antes de entrar por primera vez: ocultos arriba. Tras entrar: al salir se quedan donde están. */
body:not(.is-c1-view):not(.c1-has-entered) .c1-seccion,
body:not(.is-c1-view):not(.c1-has-entered) .c1-tit,
body:not(.is-c1-view):not(.c1-has-entered) .c1-text {
  transform: translateY(-20px);
  transition: none;
}

body:not(.is-c1-view).c1-has-entered .c1-seccion,
body:not(.is-c1-view).c1-has-entered .c1-tit,
body:not(.is-c1-view).c1-has-entered .c1-text {
  transform: translateY(0);
  transition: none;
}

.c1-tit {
  margin: 0 0 20px 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.8vw + 0.85rem, 40px);
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: center;
}

.c1-text {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.45vw + 0.55rem, 25px);
  font-weight: normal;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: #0a0a0c;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .c1-fixed-bg,
  body.is-c1-view .c1-fixed-bg {
    transition-duration: 0.01ms;
    transition-delay: 0s;
  }

  body.is-c1-view .c1-tit,
  body.is-c1-view .c1-text {
    transition-duration: 0.01ms;
    transition-delay: 0s;
  }
}

/** Paneles intermedios c2–c3 (misma altura útil que #c1). */
.page-strip {
  position: relative;
  min-height: calc(100vh - var(--hero-collapsed-height));
  min-height: calc(100svh - var(--hero-collapsed-height));
  min-height: calc(100dvh - var(--hero-collapsed-height));
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(2rem, 8vw, 4rem);
  color: #0a0a0c;
  text-align: center;
}

.page-strip--c2 {
  background-color: #e65c38;
  isolation: isolate;
  --c2-ph-p: 0;
  /** Textos abajo (desde ~65% vh); ph* arriba en 10%–65%. */
  align-items: stretch;
  justify-content: flex-start;
}

.page-strip--c3 {
  background-color: #d14f2e;
  isolation: isolate;
  --c3-ai-y: 0px;
  --c3-hu-y: 0px;
  --c3-marquee-text: #de6648;
}

/**
 * Textos en movimiento detrás de los cerebros (c3): arriba LTR, abajo RTL.
 */
.c3-bg-marquees {
  position: absolute;
  left: 0;
  right: 0;
  top: 4vh;
  top: 4svh;
  top: 4dvh;
  height: 58vh;
  height: 58svh;
  height: 58dvh;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5vh;
}

.c3-bg-marquee {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.c3-bg-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.c3-bg-marquee__track--ltr {
  animation: c3-bg-marquee-ltr 45s linear infinite;
}

.c3-bg-marquee__track--rtl {
  animation: c3-bg-marquee-rtl 55s linear infinite;
}

.c3-bg-marquee__text {
  flex-shrink: 0;
  padding-right: 0.4em;
  box-sizing: content-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(120px, 18vw, 280px);
  font-weight: normal;
  line-height: 0.85;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--c3-marquee-text, #de6648);
  user-select: none;
}

.c3-bg-marquee__text--long {
  font-size: clamp(68px, 11vw, 150px);
  letter-spacing: 0.03em;
}

@keyframes c3-bg-marquee-ltr {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes c3-bg-marquee-rtl {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .c3-bg-marquee__track--ltr,
  .c3-bg-marquee__track--rtl {
    animation: none;
    transform: translateX(0);
  }
}

/**
 * c2–c3: misma “estructura” de entrada/salida que c1.
 * Entrada: slide desde la izquierda. Salida: sin transform (suben con el scroll).
 */
/**
 * Paneles tipo “teléfono” en c2: 250×560, escalan en viewport menor manteniendo proporción.
 */
.c2-phone-stack {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}

.page-strip--c2 .c2-phone-stack {
  inset: auto;
  left: 0;
  right: 0;
  top: 3vh;
  top: 3svh;
  top: 3dvh;
  /** Termina donde empieza el bloque de texto (62vh). */
  height: 59vh;
  height: 59svh;
  height: 59dvh;
  width: 100%;
}

/**
 * Texto gigante detrás de los ph_*: naranja ligeramente más oscuro que #e65c38,
 * desplazamiento lento derecha → izquierda en bucle.
 */
.c2-bg-marquee {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.c2-bg-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  animation: c2-bg-marquee-x 45s linear infinite;
  will-change: transform;
}

.c2-bg-marquee__text {
  flex-shrink: 0;
  padding-right: 0.35em;
  box-sizing: content-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: 400px;
  font-weight: normal;
  line-height: 0.82;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #d85532;
  user-select: none;
}

@keyframes c2-bg-marquee-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .c2-bg-marquee__track {
    animation: none;
    transform: translateX(0);
  }
}

.c2-ph {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  aspect-ratio: 250 / 560;
  /** ~32% del alto de la ventana; mismo aspect ratio 250/560. */
  height: min(32vh, calc((100vw - 100px) * 560 / 250));
  height: min(32svh, calc((100vw - 100px) * 560 / 250));
  height: min(32dvh, calc((100vw - 100px) * 560 / 250));
  width: auto;
}

/** Posiciones relativas al centro; --c2-ph-p lo anima js/c2-phone-stack.js (0–1). */
.c2-ph--1 {
  transform: translate(
    calc(-50% + 250px * var(--c2-ph-p, 0)),
    calc(-50% - 125px * var(--c2-ph-p, 0))
  );
}

.c2-ph--2 {
  transform: translate(
    calc(-50% + 150px * var(--c2-ph-p, 0)),
    calc(-50% - 75px * var(--c2-ph-p, 0))
  );
}

.c2-ph--3 {
  transform: translate(
    calc(-50% + 50px * var(--c2-ph-p, 0)),
    calc(-50% - 25px * var(--c2-ph-p, 0))
  );
}

/** Offset + escala 100%→150% en la nueva posición. */
.c2-ph--4 {
  transform-origin: center center;
  transform: translate(
    calc(-50% - 50px * var(--c2-ph-p, 0)),
    calc(-50% + 25px * var(--c2-ph-p, 0))
  ) scale(calc(1 + 0.5 * var(--c2-ph-p, 0)));
}

/** Magic: mismo --c2-ph-p que el resto; escala pequeña apilado (p≈0), tamaño pleno en c2 (p≈1). */
.c2-ph--magic {
  transform-origin: center center;
  transform: translate(
    calc(-50% + 60px * var(--c2-ph-p, 0)),
    calc(-50% + 75px * var(--c2-ph-p, 0))
  ) scale(calc(0.46 + 0.95 * var(--c2-ph-p, 0)));
}

.c2-ph--magic .c2-ph-magic-shake {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes c2-magic-drift {
  from {
    transform: translateX(-10px);
  }
  to {
    transform: translateX(10px);
  }
}

body.is-c2-view .c2-ph--magic .c2-ph-magic-shake {
  animation: c2-magic-drift 1s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  body.is-c2-view .c2-ph--magic .c2-ph-magic-shake {
    animation: none;
  }
}

.c2-ph--hpcamera {
  transform: translate(
    -50%,
    calc(-50% - 150px * var(--c2-ph-p, 0))
  );
}

.c2-ph--5 {
  transform: translate(
    calc(-50% - 150px * var(--c2-ph-p, 0)),
    calc(-50% + 75px * var(--c2-ph-p, 0))
  );
}

.c2-ph--6 {
  transform: translate(
    calc(-50% - 250px * var(--c2-ph-p, 0)),
    calc(-50% + 125px * var(--c2-ph-p, 0))
  );
}

.c2-ph--7 {
  transform: translate(
    calc(-50% + 250px * var(--c2-ph-p, 0)),
    calc(-50% - 25px * var(--c2-ph-p, 0))
  );
}

.c2-ph--8 {
  transform: translate(
    calc(-50% + 270px * var(--c2-ph-p, 0)),
    calc(-50% - 125px * var(--c2-ph-p, 0))
  );
}

.c2-ph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c2-ph.c2-ph--1 {
  z-index: 1;
}

.c2-ph.c2-ph--2 {
  z-index: 2;
}

.c2-ph.c2-ph--3 {
  z-index: 3;
}

.c2-ph.c2-ph--4 {
  z-index: 4;
}

.c2-ph.c2-ph--magic {
  z-index: 5;
}

.c2-ph.c2-ph--hpcamera {
  z-index: 5;
}

.c2-ph.c2-ph--7 {
  z-index: 5;
}

.c2-ph.c2-ph--8 {
  z-index: 5;
}

.c2-ph.c2-ph--5 {
  z-index: 6;
}

.c2-ph.c2-ph--6 {
  z-index: 7;
}

.page-strip--c2 .c2-slide {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 62vh;
  top: 62svh;
  top: 62dvh;
  bottom: 0;
  flex-shrink: 0;
  width: calc(100% - 100px);
  max-width: calc(100% - 100px);
  box-sizing: border-box;
  margin: 0;
  padding: 8px 0 max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}

.c2-slide,
.c3-slide {
  position: relative;
  flex-shrink: 0;
  width: calc(100% - 100px);
  max-width: calc(100% - 100px);
  box-sizing: border-box;
  margin: 0 50px;
  z-index: 10;
}

.c2-seccion {
  margin: 0 0 14px 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: 25px;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #0a0a0c;
  text-align: center;
}

.c3-seccion {
  margin: 0 0 14px 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: 25px;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #0a0a0c;
  text-align: center;
}

.c2-seccion,
.c2-tit,
.c2-text,
.c3-seccion,
.c3-tit,
.c3-text {
  transform: translateX(-100vw);
}

body.c2-enter-prep .c2-seccion,
body.c2-enter-prep .c2-tit,
body.c2-enter-prep .c2-text,
body.c3-enter-prep .c3-seccion,
body.c3-enter-prep .c3-tit,
body.c3-enter-prep .c3-text {
  transform: translateX(-100vw) !important;
  transition: none !important;
}

body.is-c2-view .c2-seccion {
  transform: translateX(0);
  transition: transform 0.9s cubic-bezier(0.33, 1, 0.68, 1);
}

body.is-c3-view .c3-seccion {
  transform: translateX(0);
  transition: transform 0.9s cubic-bezier(0.33, 1, 0.68, 1);
}

body.is-c2-view .c2-tit,
body.is-c3-view .c3-tit {
  transform: translateX(0);
  transition: transform 1s cubic-bezier(0.33, 1, 0.68, 1);
}

body.is-c2-view .c2-text,
body.is-c3-view .c3-text {
  transform: translateX(0);
  transition: transform 1.5s cubic-bezier(0.33, 1, 0.68, 1);
}

body:not(.is-c2-view) .c2-seccion,
body:not(.is-c2-view) .c2-tit,
body:not(.is-c2-view) .c2-text,
body:not(.is-c3-view) .c3-seccion,
body:not(.is-c3-view) .c3-tit,
body:not(.is-c3-view) .c3-text {
  transform: translateX(0);
  transition: none;
}

.page-strip--c3 .c3-slide {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: calc(100% - 100px);
  max-width: calc(100% - 100px);
  box-sizing: border-box;
  margin: 0;
  padding: 8px 0 max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
}

.page-strip--c3 .c3-brains-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}

.page-strip--c3 .c3-brains {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 6vh;
  top: 6svh;
  top: 6dvh;
  /* Para centrar el rayo relativo a las imágenes. */
  isolation: isolate;
  width: calc(100% - 100px);
  max-width: calc(100% - 100px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 1;
  pointer-events: none;
}

.page-strip--c3 .c3-brain-wrap {
  height: min(48vh, 48svh, 48dvh);
  width: auto;
  max-width: calc((100% - 10px) / 2);
  aspect-ratio: 370 / 720;
  will-change: transform;
}

.page-strip--c3 .c3-brain-shake {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.page-strip--c3 .c3-brain-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-strip--c3 .c3-ray {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 115px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 50;
}

.page-strip--c3 .c3-ray img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-strip--c3 .c3-ray-shake {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.page-strip--c3 .c3-brain-wrap--ai {
  transform: translateY(var(--c3-ai-y, 0px));
}

.page-strip--c3 .c3-brain-wrap--hu {
  transform: translateY(var(--c3-hu-y, 0px));
}

@keyframes c3-zap-shake-ray {
  0% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(10px, -8px);
  }
  20% {
    transform: translate(-10px, 10px);
  }
  35% {
    transform: translate(8px, 10px);
  }
  50% {
    transform: translate(-10px, -10px);
  }
  65% {
    transform: translate(10px, 6px);
  }
  80% {
    transform: translate(-8px, 10px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.page-strip--c3.c3-zap-active .c3-ray {
  opacity: 1;
}

.page-strip--c3.c3-zap-active .c3-ray .c3-ray-shake {
  animation: c3-zap-shake-ray 0.14s linear infinite;
}

@keyframes c3-zap-shake-ai {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(10px, -10px);
  }
  40% {
    transform: translate(-10px, 8px);
  }
  60% {
    transform: translate(8px, 10px);
  }
  80% {
    transform: translate(-8px, -10px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes c3-zap-shake-hu {
  0% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-10px, 10px);
  }
  35% {
    transform: translate(10px, 6px);
  }
  55% {
    transform: translate(-8px, -10px);
  }
  75% {
    transform: translate(10px, -8px);
  }
  100% {
    transform: translate(0, 0);
  }
}

.page-strip--c3.c3-zap-active .c3-brain-wrap--ai .c3-brain-shake {
  animation: c3-zap-shake-ai 0.18s linear infinite;
}

.page-strip--c3.c3-zap-active .c3-brain-wrap--hu .c3-brain-shake {
  animation: c3-zap-shake-hu 0.18s linear infinite;
}

.c2-tit,
.c3-tit {
  margin: 0 0 clamp(0.65rem, 2vw, 1.1rem) 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.8vw + 0.85rem, 40px);
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: center;
}

.c2-text,
.c3-text {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.45vw + 0.55rem, 25px);
  font-weight: normal;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: #0a0a0c;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  body.is-c2-view .c2-tit,
  body.is-c2-view .c2-text,
  body.is-c3-view .c3-tit,
  body.is-c3-view .c3-text {
    transition-duration: 0.01ms;
  }
}

/* First view — full viewport; fixed so it does not scroll with the page */
.hero {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: var(--hero-bg-color, #0a0a0c);
  background-image: var(--hero-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
  padding-bottom: clamp(1rem, 4vw, 2.5rem);
  /** Altura fija de la franja naranja (email): foto y CV se anclan a esto. */
  --hero-orange-bar-height: 72px;
  transition: height 0.55s cubic-bezier(0.33, 1, 0.68, 1),
    min-height 0.55s cubic-bezier(0.33, 1, 0.68, 1);
  transition-delay: 0s;
}

/* Al entrar en la fase de paneles (primer scroll), el home queda como header de 100px y encima. */
body.is-scrolled .hero {
  inset: 0 0 auto 0;
  height: var(--hero-collapsed-height);
  min-height: var(--hero-collapsed-height);
  overflow: hidden;
  z-index: 30;
  transition-delay: 0.75s;
  /* Fondo h1 en la franja ~100px; el spacer solo usa color para no duplicar la foto al hacer scroll. */
  background-image: var(--hero-bg-image, none);
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
}

.hero__fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Puntero para distort; la rueda puede hacer scroll en #all bajo el hero (pointer-events:none en el resto). */
  pointer-events: auto;
  opacity: 0.58;
  mix-blend-mode: screen;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--hero-effect-bg-color, transparent);
  background-image: var(--hero-effect-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.16s ease;

  /* “Distorsión” de color: un tinte fuerte + contraste alrededor del cursor */
  filter: saturate(2.8) contrast(1.45) brightness(1.18) hue-rotate(38deg);
  mix-blend-mode: screen;

  /* Revelar solo cerca del mouse */
  -webkit-mask-image: radial-gradient(
    circle 190px at var(--hero-mx, 50%) var(--hero-my, 50%),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.92) 18%,
    rgba(0, 0, 0, 0.55) 36%,
    rgba(0, 0, 0, 0.12) 54%,
    rgba(0, 0, 0, 0) 62%
  );
  mask-image: radial-gradient(
    circle 190px at var(--hero-mx, 50%) var(--hero-my, 50%),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.92) 18%,
    rgba(0, 0, 0, 0.55) 36%,
    rgba(0, 0, 0, 0.12) 54%,
    rgba(0, 0, 0, 0) 62%
  );
}

.hero.hero--mouse-active::before {
  opacity: 0.92;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
}

/* Encima de la barra naranja: 20px entre el borde inferior del enlace y el borde superior de la barra */
.hero__resume-download {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hero-orange-bar-height) + 20px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.95rem;
  width: 100vw;
  margin-left: -50vw;
  padding-left: calc(100px + env(safe-area-inset-left, 0px));
  padding-right: 1rem;
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  font-size: clamp(1rem, 2.85vw, 1.25rem);
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 0.08em 0.35em rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: hero-bottom-bar-intro 0.4s cubic-bezier(0.33, 1, 0.68, 1) 1s both;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.5s ease;
}

.hero__resume-download:hover,
.hero__resume-download:focus-visible {
  color: var(--hero-name-color);
  text-decoration: none;
}

.hero__resume-download:focus-visible {
  outline: 2px solid var(--hero-name-color);
  outline-offset: 3px;
}

/* Franja naranja inferior; altura = --hero-orange-bar-height para alinear foto arriba */
.hero__bottom-bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100vw;
  box-sizing: border-box;
  height: var(--hero-orange-bar-height);
  margin-left: -50vw;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: calc(100px + env(safe-area-inset-left, 0px));
  padding-right: 1rem;
  overflow: visible;
  background-color: var(--hero-name-color);
  pointer-events: none;
  animation: hero-bottom-bar-intro 0.4s cubic-bezier(0.33, 1, 0.68, 1) 1s both;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1) 0.18s,
    opacity 0.48s ease 0.18s;
}

.hero__bottom-bar-email {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  color: #ffffff;
  font-size: clamp(0.98rem, 2.65vw, 1.3rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  pointer-events: auto;
  padding: 0.25rem 0;
}

/* Same pixel size as envelope (matches previous 22×22 look) */
.hero__bottom-bar-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.hero__bottom-bar-email:hover {
  color: #000000;
  text-decoration: none;
}

.hero__bottom-bar-email:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Invisible until 1s, then short fade-in */
@keyframes hero-bottom-bar-intro {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Same 2s timeline as text: hidden until 50%, then enters with second half */
@keyframes hero-portrait-intro {
  0%,
  50% {
    opacity: 0;
    transform: translateY(12%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-tagline-intro {
  0%,
  82% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
 * Retrato fluido (layout texto izquierda / foto derecha): crece por alto hasta ~80svh en pantallas grandes;
 * el ancho nunca supera el 55% del viewport ni 55rem (tope previo). Al estrechar, 55vw va reduciendo la foto.
 */
.hero__portrait {
  position: absolute;
  right: calc(0px + env(safe-area-inset-right, 0px));
  bottom: var(--hero-orange-bar-height);
  z-index: 2;
  width: auto;
  height: auto;
  max-height: calc(80vh - 50px);
  max-height: calc(80svh - 50px);
  max-width: min(55vw, 55rem);
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  user-select: none;
  animation: hero-portrait-intro 2s cubic-bezier(0.33, 1, 0.68, 1) both;
}

/* 2s total: 0–50% = 1s hold centered; 50–100% = move up + left + resize */
@keyframes hero-inner-intro {
  0%,
  50% {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  100% {
    left: calc(100px + env(safe-area-inset-left, 0px));
    top: calc(100px + env(safe-area-inset-top, 0px));
    transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes hero-name-intro {
  0%,
  50% {
    font-size: clamp(2.85rem, 9.5vw + 1.35rem, 6.75rem);
  }
  100% {
    font-size: clamp(1.55rem, 5vw + 0.65rem, 3.5rem);
  }
}

@keyframes hero-role-intro {
  0%,
  50% {
    font-size: clamp(1.28rem, 3vw + 0.62rem, 2.15rem);
    margin-top: clamp(0.75rem, 2.5vw, 1.25rem);
  }
  100% {
    font-size: clamp(1.05rem, 2.4vw + 0.5rem, 1.75rem);
    margin-top: clamp(0.12rem, 0.9vw, 0.35rem);
  }
}

.hero__inner {
  position: absolute;
  left: 50%;
  z-index: 4;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: min(90vw, calc(100vw - 100px - env(safe-area-inset-left, 0px) - 1rem));
  width: max-content;
  animation: hero-inner-intro 2s cubic-bezier(0.33, 1, 0.68, 1) both;
}

.hero__name {
  margin: 0;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  font-size: clamp(2.85rem, 9.5vw + 1.35rem, 6.75rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--hero-name-color);
  text-shadow: 0 0.08em 0.35em rgba(0, 0, 0, 0.55);
  text-align: left;
  animation: hero-name-intro 2s cubic-bezier(0.33, 1, 0.68, 1) both;
}

.hero__role {
  margin: clamp(0.75rem, 2.5vw, 1.25rem) 0 0;
  font-family: "santanaregular", system-ui, sans-serif;
  font-weight: normal;
  font-size: clamp(1.28rem, 3vw + 0.62rem, 2.15rem);
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: hero-role-intro 2s cubic-bezier(0.33, 1, 0.68, 1) both;
}

/*
 * Bloque tagline + icono ratón: anclado abajo (desktop); ratón justo encima del párrafo.
 */
.hero__tagline-wrap {
  --hero-tagline-overlap: clamp(50px, 8vw, 100px);
  position: absolute;
  z-index: 3;
  left: calc(100px + env(safe-area-inset-left, 0px));
  right: auto;
  bottom: calc(var(--hero-orange-bar-height) + 20px + 3.6rem);
  width: calc(45vw + var(--hero-tagline-overlap));
  max-width: calc(
    100% - 100px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)
  );
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.28rem, 1vw, 0.55rem);
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.5s ease;
  animation: hero-tagline-intro 2s cubic-bezier(0.33, 1, 0.68, 1) both;
}

.hero__tagline-wrap .hero__mouse {
  display: block;
  width: clamp(34px, 5vw, 52px);
  height: auto;
  margin: 0;
  flex-shrink: 0;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 0.12em 0.25em rgba(0, 0, 0, 0.45));
}

.hero__tagline {
  margin: 0;
  width: 100%;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  font-size: 30px;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--hero-name-color);
  text-shadow: 0 0.08em 0.35em rgba(0, 0, 0, 0.45);
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  .hero__resume-download {
    animation: none;
    opacity: 1;
  }

  .hero__bottom-bar {
    animation: none;
    opacity: 1;
  }

  .hero__portrait {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero__inner {
    animation: none;
    left: calc(100px + env(safe-area-inset-left, 0px));
    top: calc(100px + env(safe-area-inset-top, 0px));
    transform: none;
    opacity: 1;
  }

  .hero__name {
    animation: none;
    font-size: clamp(1.55rem, 5vw + 0.65rem, 3.5rem);
  }

  .hero__role {
    animation: none;
    font-size: clamp(1.05rem, 2.4vw + 0.5rem, 1.75rem);
    margin-top: clamp(0.12rem, 0.9vw, 0.35rem);
  }

  .hero__tagline-wrap {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .hero__inner {
    left: 50%;
    top: calc(100px + env(safe-area-inset-top, 0px));
    transform: translate(-50%, 0);
  }
}

/* --- After intro: lock layout so scroll transitions can run --- */
body.intro-done .hero__inner {
  animation: none;
  left: calc(100px + env(safe-area-inset-left, 0px));
  top: calc(100px + env(safe-area-inset-top, 0px));
  transform: none;
  transition: left 0.55s ease, top 0.55s ease;
}

body.intro-done .hero__name {
  animation: none;
  font-size: clamp(1.55rem, 5vw + 0.65rem, 3.5rem);
  transition: font-size 0.55s ease;
}

body.intro-done .hero__role {
  animation: none;
  font-size: clamp(1.05rem, 2.4vw + 0.5rem, 1.75rem);
  margin-top: clamp(0.12rem, 0.9vw, 0.35rem);
  transition: font-size 0.55s ease, margin-top 0.55s ease;
}

body.intro-done .hero__portrait {
  animation: none;
  transform: translate3d(0, 0, 0);
  opacity: 1;
  transition: transform 1s cubic-bezier(0.33, 1, 0.68, 1);
}

body.intro-done .hero__tagline-wrap {
  animation: none;
  opacity: 1;
  transform: none;
}

/* --- First scroll down --- */
body.intro-done.is-scrolled .hero__inner {
  left: calc(50px + env(safe-area-inset-left, 0px));
  top: calc(10px + env(safe-area-inset-top, 0px));
  transition: left 0.55s ease, top 0.55s ease;
}

body.intro-done.is-scrolled .hero__name {
  font-size: clamp(1.28rem, 4.2vw + 0.52rem, 2.85rem);
}

body.intro-done.is-scrolled .hero__role {
  font-size: clamp(0.92rem, 2.05vw + 0.44rem, 1.52rem);
  margin-top: clamp(0.1rem, 0.75vw, 0.3rem);
}

body.is-scrolled .hero__resume-download {
  transform: translateX(-130vw);
  opacity: 0;
  pointer-events: none;
}

body.is-scrolled .hero__tagline-wrap {
  transform: translateX(-130vw);
  opacity: 0;
  pointer-events: none;
}

body.is-scrolled .hero__bottom-bar {
  transform: translateX(-130vw);
  opacity: 0;
  pointer-events: none;
}

body.intro-done.is-scrolled .hero__portrait {
  transform: translate3d(calc(100vw + 40px), 0, 0);
}

/* Hero en celular/tablet estrecha: 10px + safe-area a lados, bloque centrado */
/** Móvil: scroll vertical lo controla scroll-snap-stack (menú ±1), no el dedo libre. */
@media (max-width: 820px) {
  html.portfolio-mobile-nav,
  html.portfolio-mobile-nav body {
    touch-action: none;
    overscroll-behavior-y: none;
  }

}

@media (max-width: 820px) {
  @keyframes hero-inner-intro-mobile {
    0%,
    50% {
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      opacity: 1;
    }
    100% {
      left: 50%;
      top: calc(100px + env(safe-area-inset-top, 0px));
      transform: translate(-50%, 0);
      opacity: 1;
    }
  }

  .hero {
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
  }

  .hero__inner {
    animation-name: hero-inner-intro-mobile;
    left: 50%;
    transform: translate(-50%, 0);
    max-width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    width: 100%;
    align-items: center;
    box-sizing: border-box;
  }

  .hero__name {
    text-align: center;
    width: 100%;
  }

  .hero__tagline-wrap {
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    top: calc(100px + env(safe-area-inset-top, 0px) + clamp(6.65rem, 27vw, 8.75rem));
    bottom: auto;
    width: auto;
    max-width: none;
    align-items: center;
    box-sizing: border-box;
  }

  .hero__tagline {
    text-align: center;
    font-size: clamp(16px, 4.2vw, 30px);
  }

  /* Apilado: hasta ~45% del alto del viewport (caps en px eran demasiado bajos) */
  .hero__portrait {
    width: auto;
    height: auto;
    max-height: 45vh;
    max-height: 45svh;
    max-width: min(
      92vw,
      calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
    );
    object-fit: contain;
    object-position: bottom right;
  }

  .hero__resume-download {
    justify-content: center;
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
  }

  .hero__bottom-bar {
    align-items: center;
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
  }

  body.intro-done .hero__inner {
    left: 50%;
    transform: translate(-50%, 0);
  }

  /* Header compacto + iconos CV/email: nombre/título a la izquierda (10px); iconos siguen a la derecha */
  body.intro-done.is-scrolled .hero__inner {
    left: calc(20px + env(safe-area-inset-left, 0px));
    transform: none;
    top: calc(30px + env(safe-area-inset-top, 0px));
    align-items: flex-start;
    width: auto;
    max-width: calc(
      100vw - 30px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
        152px
    );
  }

  body.intro-done.is-scrolled .hero__name {
    text-align: left;
  }

  body.intro-done.is-scrolled .hero__role {
    text-align: left;
    align-self: stretch;
  }

  /** Barra 100px: CV y correo juntos, pegados al borde derecho. */
  body.is-scrolled .conocimientos-top-actions {
    right: calc(10px + env(safe-area-inset-right, 0px));
    gap: 0.25rem;
  }

  body.is-scrolled .conocimientos-top-actions__link {
    width: 52px;
    height: 52px;
  }

  body.is-scrolled .conocimientos-top-actions__icon {
    width: 30px;
    height: 30px;
  }

  body.intro-done.is-scrolled .hero__inner {
    max-width: calc(
      100vw - 30px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
        118px
    );
  }

  /**
   * #c1 móvil: alto = pantalla − hero 100px, sin scroll interno; textos más compactos.
   */
  .page-c1 {
    --c1-usable: calc(100dvh - var(--hero-collapsed-height));
    height: var(--c1-usable);
    min-height: var(--c1-usable);
    max-height: var(--c1-usable);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .c1-scroll-layer {
    height: var(--c1-usable);
    min-height: 0;
    max-height: var(--c1-usable);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  .c1-panels {
    height: 100%;
    top: 0;
    bottom: auto;
  }

  .c1-panel--top {
    top: 0;
    height: 36%;
  }

  .c1-panel--bottom {
    top: auto;
    bottom: 0;
    height: 18%;
    max-height: 18%;
  }

  .c1-bg-marquee {
    top: 36%;
    height: 46%;
    max-height: 46%;
  }

  .c1-bg-marquee__text {
    font-size: clamp(64px, 20vw, 120px);
  }

  .c1-slide {
    top: 6%;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: 34%;
    padding: 0 18px;
    box-sizing: border-box;
    overflow: hidden;
    translate: none;
    transform: translateX(-50%);
  }

  .c1-seccion {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .c1-tit {
    font-size: clamp(1rem, 4.6vw, 1.25rem);
    margin-bottom: 10px;
    line-height: 1.12;
  }

  .c1-text {
    font-size: clamp(0.8rem, 3.3vw, 0.9rem);
    line-height: 1.38;
  }

  /** Vídeo c1: ocultar al instante al ir a c2+ (evita flash sobre naranja). */
  body:not(.is-c1-view) .c1-fixed-bg {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
  }

  /** #c2: mismo alto útil que c1, sin scroll interno. */
  .page-strip--c2 {
    --strip-usable: calc(100dvh - var(--hero-collapsed-height));
    height: var(--strip-usable);
    min-height: var(--strip-usable);
    max-height: var(--strip-usable);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  .page-strip--c2 .c2-phone-stack {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 54%;
    inset: auto;
  }

  .page-strip--c2 .c2-slide {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 0;
    height: 44%;
    max-height: 44%;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 0;
    padding: 50px 18px max(12px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    box-sizing: border-box;
    transform: translateX(-50%);
  }

  .c2-seccion {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .c2-tit {
    font-size: clamp(1rem, 4.6vw, 1.25rem);
    margin-bottom: 10px;
    line-height: 1.12;
  }

  .c2-text {
    font-size: clamp(0.8rem, 3.3vw, 0.9rem);
    line-height: 1.38;
  }

  .c2-bg-marquee__text {
    font-size: clamp(64px, 18vw, 110px);
  }

  /**
   * Dispersión ph*: menor que desktop; apilado (p=0) igual.
   * ph4 y magic sin override → mismos valores que escritorio.
   */
  .page-strip--c2 {
    --c2-ph-mob: 0.52;
  }

  .c2-ph--1 {
    transform: translate(
      calc(-50% + 250px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% - 125px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--2 {
    transform: translate(
      calc(-50% + 150px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% - 75px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--3 {
    transform: translate(
      calc(-50% + 50px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% - 25px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--5 {
    transform: translate(
      calc(-50% - 150px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% + 75px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--6 {
    transform: translate(
      calc(-50% - 250px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% + 125px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--7 {
    transform: translate(
      calc(-50% + 250px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% - 25px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--8 {
    transform: translate(
      calc(-50% + 270px * var(--c2-ph-p, 0) * var(--c2-ph-mob)),
      calc(-50% - 125px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  .c2-ph--hpcamera {
    transform: translate(
      -50%,
      calc(-50% - 150px * var(--c2-ph-p, 0) * var(--c2-ph-mob))
    );
  }

  /** #c3: textos y padding horizontal como c1 / c2. */
  .page-strip--c3 .c3-slide {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 0;
    left: 50%;
    bottom: 30px;
    padding: 0 18px max(12px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    transform: translateX(-50%);
  }

  .c3-seccion {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .c3-tit {
    font-size: clamp(1rem, 4.6vw, 1.25rem);
    margin-bottom: 10px;
    line-height: 1.12;
  }

  .c3-text {
    font-size: clamp(0.8rem, 3.3vw, 0.9rem);
    line-height: 1.38;
  }

}

/* Iconos fijos (CV + email): visibles al scrollear paneles o skills; ocultos solo en home */
.conocimientos-top-actions {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: calc(50px + env(safe-area-inset-right, 0px));
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.35rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, -6px, 0);
  transition: opacity 0.45s ease 0.2s, visibility 0.45s ease 0.2s,
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1) 0.2s;
  isolation: isolate;
}

body.is-scrolled .conocimientos-top-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.conocimientos-top-actions__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 0.06em 0.25em rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.conocimientos-top-actions__link:hover,
.conocimientos-top-actions__link:focus-visible {
  color: var(--hero-name-color);
  background-color: rgba(255, 255, 255, 0.12);
}

.conocimientos-top-actions__link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.conocimientos-top-actions__icon {
  flex-shrink: 0;
  display: block;
  width: 36px;
  height: 36px;
}

/* Skills después de #c3 en #main-stack */
.skills {
  --skills-chrome-top: 70px;
  --skills-chrome-bottom: clamp(1rem, 2vh, 1.5rem);
  --skills-panel-height: calc(100dvh - var(--hero-collapsed-height));
  --skills-graph-height: calc(
    var(--skills-panel-height) - var(--skills-chrome-top) - var(--skills-chrome-bottom)
  );

  position: relative;
  width: 100%;
  min-height: var(--skills-panel-height);
  height: var(--skills-panel-height);
  z-index: auto;
  background-color: #ffffff;
  pointer-events: auto;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/**
 * Franjas de texto fijas detrás del grafo: 5 líneas, alto completo de la sección, sin gap.
 */
.skills__bg-labels {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.skills__bg-labels--focus {
  overflow: visible;
}

.skills__bg-label {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: "santana-blackregular", system-ui, sans-serif;
  --label-font-base: clamp(2.5rem, calc(var(--skills-graph-height) / 5 * 0.58), 10rem);
  font-size: var(--label-font-base);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #eeeeee;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  opacity: 1;
  transition: font-size 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.skills__bg-labels--focus .skills__bg-label {
  font-size: calc(var(--label-font-base) * 0.68);
}

.skills__bg-labels--focus .skills__bg-label.is-highlighted {
  position: relative;
  z-index: 1;
  overflow: visible;
  font-size: calc(var(--label-font-base) * 1.9);
}

@media (prefers-reduced-motion: reduce) {
  .skills__bg-label {
    transition-duration: 0.01ms;
  }
}

.skills__inner {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* Poco aire arriba; el título define el respiro respecto al borde. */
  padding: 4px clamp(1rem, 4vw, 2.5rem) var(--skills-chrome-bottom);
  box-sizing: border-box;
}

.skills__graph-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: var(--skills-graph-height);
  height: var(--skills-graph-height);
  isolation: isolate;
}

.skills__heading {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin: clamp(6px, 1.2vh, 14px) 0 0;
  padding: 0;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: normal;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: left;
}

/* Snaps tras #skills: portafolio, experiencia laboral, contacto */
.page-portfolio,
.page-work,
.page-contact {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--hero-collapsed-height));
  min-height: calc(100svh - var(--hero-collapsed-height));
  min-height: calc(100dvh - var(--hero-collapsed-height));
  z-index: 2;
  pointer-events: auto;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.page-portfolio {
  background-color: #f4f4f2;
  overflow: hidden;
  box-sizing: border-box;
  min-height: calc(100dvh - var(--hero-collapsed-height));
  max-height: calc(100dvh - var(--hero-collapsed-height));
}

.page-portfolio.snap-section {
  display: flex;
  flex-direction: column;
}

/* Portafolio: cuadrícula 70% + marquesina "Other projects" 30% */
.page-portfolio__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
  overflow: hidden;
}

.page-portfolio__featured {
  flex: 7 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 14px);
  overflow: visible;
}

.page-portfolio__other {
  flex: 3 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.page-portfolio__other-title {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.15rem;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666666;
}

.page-portfolio__marquee {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
}

.page-portfolio__marquee-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: max-content;
  height: 100%;
  animation: page-portfolio-marquee var(--marquee-duration, 45s) linear infinite;
  will-change: transform;
}

.page-portfolio__marquee-set {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(10px, 1.8vw, 16px);
  padding-right: clamp(10px, 1.8vw, 16px);
  height: 100%;
}

.page-portfolio__marquee-item {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 1050 / 850;
  border-radius: 8px;
  overflow: hidden;
  background-color: #e0e0de;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-portfolio__marquee-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

@keyframes page-portfolio-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.portfolio-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  perspective: 1100px;
  cursor: pointer;
  outline: none;
  opacity: 0;
  will-change: transform, opacity;
}

.portfolio-card[data-index="0"] {
  transform: translate(-112%, -112%);
}

.portfolio-card[data-index="1"] {
  transform: translate(112%, -112%);
}

.portfolio-card[data-index="2"] {
  transform: translate(-112%, 112%);
}

.portfolio-card[data-index="3"] {
  transform: translate(112%, 112%);
}

.portfolio-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.33, 1, 0.68, 1);
}

.portfolio-card__face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.portfolio-card__face--front {
  background-color: #d8d8d6;
  border: 1px solid #bbbbbb;
  box-sizing: border-box;
  z-index: 2;
}

.portfolio-card__face--back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.45rem;
  padding: clamp(0.55rem, 2vw, 1rem);
  box-sizing: border-box;
  background-color: #1a1a1c;
  transform: rotateY(180deg);
  z-index: 1;
}

.portfolio-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.portfolio-card__title {
  margin: 0;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(0.72rem, 1.8vw, 1.05rem);
  font-weight: normal;
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.portfolio-card__desc {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.62rem, 1.35vw, 0.78rem);
  line-height: 1.38;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.portfolio-card__link {
  margin-top: 0.15rem;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.6rem, 1.2vw, 0.74rem);
  line-height: 1.3;
  color: #ff552b;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  word-break: break-word;
}

.portfolio-card__link:hover {
  color: #ff7a55;
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-card:hover .portfolio-card__inner,
  .portfolio-card:focus-visible .portfolio-card__inner {
    transform: rotateY(180deg);
  }
}

.portfolio-card.is-flipped .portfolio-card__inner {
  transform: rotateY(180deg);
}

.page-portfolio__error {
  margin: 0;
  padding: 1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: #444444;
}

@media (prefers-reduced-motion: reduce) {
  .page-portfolio__marquee-track {
    animation: none;
  }

  .portfolio-card {
    opacity: 1;
    transform: none;
    will-change: auto;
  }

  .portfolio-card__inner {
    transition-duration: 0.01ms;
  }
}

.page-work {
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
}

/* Work Experience: estados iniciales para animación al scroll */
.page-work.is-work-anim-idle .page-work__timeline {
  transform: translateX(-100%);
}

.page-work__timeline {
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.page-work__timeline-year {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.34s ease,
    transform 0.38s cubic-bezier(0.33, 1, 0.68, 1);
}

.page-work__timeline-year.is-in {
  opacity: 1;
  transform: translateY(0);
}

.page-work__timeline-year-label {
  transition: opacity 0.28s ease;
}

.page-work__timeline-year.is-in .page-work__timeline-year-label {
  opacity: 0.8;
}

.page-work__timeline-year--milestone.is-in .page-work__timeline-year-label {
  opacity: 1;
}

.page-work__entry {
  opacity: 0;
  transform: translateX(48px);
  transition:
    opacity 0.38s ease,
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.page-work__entry.is-in {
  opacity: 1;
  transform: translateX(0);
}

.page-work__bracket,
.page-work__connector-line {
  opacity: 0;
  transition: opacity 0.36s ease;
}

.page-work__bracket.is-in,
.page-work__connector-line.is-in {
  opacity: 1;
}

.page-work.is-work-active .page-work__timeline {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .page-work__timeline,
  .page-work__timeline-year,
  .page-work__entry,
  .page-work__bracket,
  .page-work__connector-line {
    transition-duration: 0.01ms;
  }

  .page-work.is-work-anim-idle .page-work__timeline {
    transform: none;
  }
}

.page-contact {
  background-color: #ffffff;
  padding: 0;
}

.page-portfolio__inner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px clamp(1rem, 4vw, 2.5rem) clamp(0.65rem, 1.2vh, 1rem);
  box-sizing: border-box;
}

.page-work__connectors {
  position: absolute;
  inset: 0;
  /* Por encima de las cajas (.page-work__inner z-index 2) para ver diagonal + tramo de 10px */
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.page-work__connectors-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.page-work__connector-line {
  fill: none;
  stroke: #cccccc;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.page-work__inner {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-left: 30%;
  padding: clamp(6px, 1.2vh, 14px) 0 clamp(1rem, 2vh, 1.5rem) 0;
  box-sizing: border-box;
}

@media (max-width: 699px) {
  .page-work__inner {
    margin-left: max(30%, 100px);
  }
}

.page-portfolio__heading {
  flex-shrink: 0;
  margin: clamp(6px, 1.2vh, 14px) 0 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: normal;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: center;
}

.page-work__heading {
  flex-shrink: 0;
  margin: clamp(6px, 1.2vh, 14px) 0 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: 50px;
  font-weight: normal;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: center;
}

.page-work__heading {
  padding-left: 50px;
  padding-right: 20px;
  text-align: left;
  box-sizing: border-box;
}

@media (max-width: 699px) {
  .page-work__heading {
    font-size: clamp(1.15rem, 5.5vw, 1.65rem);
    line-height: 1.08;
    white-space: nowrap;
  }
}

.page-work__timeline {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 30%;
  background-color: #ee613c;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

@media (max-width: 699px) {
  .page-work__timeline {
    width: max(30%, 100px);
    min-width: 100px;
  }
}

.page-work__timeline-track {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: visible;
  padding-right: clamp(0.35rem, 1.2vw, 0.55rem);
  padding-bottom: clamp(0.65rem, 1.8vh, 1rem);
  padding-left: clamp(0.4rem, 1vw, 0.5rem);
  box-sizing: border-box;
}

.page-work__timeline-year {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  pointer-events: none;
}

.page-work__timeline-year--milestone {
  z-index: 3;
}

.page-work__timeline-year-label {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.38rem, 0.68vw, 0.52rem);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #ffffff;
  opacity: 0.8;
  text-align: right;
  white-space: nowrap;
}

.page-work__timeline-year--milestone .page-work__timeline-year-label {
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: 30px;
  font-weight: normal;
  line-height: 1;
  color: #0a0a0c;
  opacity: 1;
}

.page-work__timeline-tick {
  flex: 0 0 10px;
  width: 10px;
  height: 2px;
  margin-left: 0.35rem;
  background-color: #ffffff;
}

.page-work__timeline-error {
  margin: 0;
  padding: 1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: #ffffff;
}

/** Franja de 50px entre timeline y tarjetas: brackets por empleo. */
.page-work__brackets {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30%;
  z-index: 2;
  width: 50px;
  pointer-events: none;
  overflow: visible;
}

@media (max-width: 699px) {
  .page-work__brackets {
    left: max(30%, 100px);
  }
}

.page-work__bracket {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-work__bracket-h {
  position: absolute;
  left: 3px;
  width: 10px;
  height: 2px;
  background-color: #cccccc;
}

.page-work__bracket-h--end {
  width: calc(10px + 10px);
}

.page-work__bracket-v {
  position: absolute;
  left: 13px;
  width: 2px;
  background-color: #cccccc;
}

.page-work__body {
  flex: 1 1 auto;
  min-height: 12rem;
  min-width: 0;
  width: 100%;
  margin-top: 0.5rem;
  background: none;
  border-radius: 0;
  box-sizing: border-box;
}

.page-work__entries {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  padding-left: 50px;
  padding-right: 20px;
  box-sizing: border-box;
}

.page-work__entry {
  width: 100%;
  margin: 0;
  padding: clamp(1rem, 2.2vh, 1.35rem) clamp(1rem, 2.5vw, 1.5rem);
  box-sizing: border-box;
  background-color: #eeeeee;
  border-radius: 14px;
}

.page-work__entry-period {
  margin: 0 0 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.5vw, 0.9rem);
  line-height: 1.35;
  color: #444444;
}

.page-work__entry-company {
  margin: 0 0 0.65rem;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #0a0a0c;
}

.page-work__entry-positions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-work__entry-position {
  margin: 0 0 0.4rem;
  font-family: system-ui, sans-serif;
  font-size: clamp(0.8rem, 1.55vw, 0.92rem);
  line-height: 1.4;
  color: #1a1a1a;
}

.page-work__entry-position:last-child {
  margin-bottom: 0;
}

.page-work__entry-position-title {
  font-weight: 600;
}

.page-contact__layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
  width: 100%;
}

.page-contact__col {
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}

.page-contact__col--form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.2vh, 14px) clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 2vh, 1.5rem);
  background-color: #ffffff;
}

.page-contact__col--info {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-height: 100%;
  padding: clamp(6px, 1.2vh, 14px) clamp(1.25rem, 4vw, 2.5rem) 0;
  background-color: #ee613c;
  color: #ffffff;
  overflow: hidden;
}

.page-contact__heading {
  flex-shrink: 0;
  width: 100%;
  max-width: 26rem;
  margin: 0 0 clamp(0.75rem, 2vh, 1.25rem);
  padding: 0;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(2rem, 6vw, 50px);
  font-weight: normal;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #0a0a0c;
  text-align: center;
}

.page-contact__form {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-contact__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.page-contact__fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  box-sizing: border-box;
}

.page-contact__label {
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #0a0a0c;
}

.page-contact__input,
.page-contact__textarea {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(10, 10, 12, 0.2);
  border-radius: 4px;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  color: #0a0a0c;
  background-color: #ffffff;
  box-sizing: border-box;
}

.page-contact__textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.page-contact__input:focus,
.page-contact__textarea:focus {
  outline: 2px solid #0a0a0c;
  outline-offset: 1px;
}

.page-contact__submit {
  align-self: center;
  min-width: 9rem;
  padding: 0.65rem 1.35rem;
  border: none;
  border-radius: 4px;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #ffffff;
  background-color: #0a0a0c;
  cursor: pointer;
}

.page-contact__submit:hover:not(:disabled) {
  opacity: 0.92;
}

.page-contact__submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.page-contact__submit:focus-visible {
  outline: 2px solid #ee613c;
  outline-offset: 3px;
}

.page-contact__status {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #0a0a0c;
  white-space: pre-line;
}

.page-contact__status[hidden] {
  display: none;
}

.page-contact__status.is-error {
  color: #b42318;
}

.page-contact__status.is-success {
  color: #0a6b3a;
}

.page-contact__info {
  flex-shrink: 0;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.page-contact__name {
  margin: 0 0 0.35rem;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.page-contact__role,
.page-contact__langs {
  margin: 0 0 0.65rem;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.page-contact__location {
  margin: 0.35rem 0 0;
  font-family: "santanaregular", system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

/* Misma tipografía e iconos que el hero; texto negro sobre naranja */
.page-contact__action {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  font-size: clamp(0.98rem, 2.65vw, 1.3rem);
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #000000;
  text-decoration: none;
}

.page-contact__action--resume {
  gap: 0.95rem;
  font-size: clamp(1rem, 2.85vw, 1.25rem);
}

.page-contact__action--email {
  gap: 0.5rem;
}

.page-contact__action-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.page-contact__action:hover,
.page-contact__action:focus-visible {
  color: #000000;
  text-decoration: none;
  opacity: 0.82;
}

.page-contact__action:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .page-contact__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .page-contact__col--info {
    min-height: 16rem;
  }

  .page-contact__col--form {
    justify-content: flex-start;
  }

  .page-contact__form,
  .page-contact__heading {
    max-width: none;
  }
}

.skills-graph {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  --skills-meter-duration: 0.72s;
  --skills-node-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.16),
    0 18px 40px rgba(0, 0, 0, 0.14);
  --skills-node-shadow-hover:
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 14px 28px rgba(0, 0, 0, 0.2),
    0 26px 52px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .skills-graph {
    --skills-meter-duration: 0.06s;
  }
}

.skills-graph__node-wrap {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  pointer-events: auto;
  box-sizing: border-box;
  overflow: visible;
}

.skills-graph__node-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 0.22s ease;
  box-sizing: border-box;
}

.skills-graph__node-wrap:hover .skills-graph__node-inner {
  transform: scale(1.08);
}

.skills-graph__meter {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.skills-graph__node-wrap:hover .skills-graph__meter {
  opacity: 1;
}

.skills-graph__meter-arc {
  transition: stroke-dashoffset var(--skills-meter-duration) cubic-bezier(0.32, 0.72, 0.25, 1);
}

.skills-graph__node-icon {
  display: block;
  flex-shrink: 0;
  width: 1.45em;
  height: 1.45em;
  max-width: 48%;
  max-height: 48%;
  object-fit: contain;
  margin-bottom: 0.1em;
  pointer-events: none;
  user-select: none;
  filter: brightness(0) invert(1);
}

.skills-graph__node--with-icon {
  gap: 0.08em;
  padding-top: min(0.18rem, 5%);
}

.skills-graph__node-title {
  display: block;
  max-width: 100%;
}

.skills-graph__node-pct {
  display: block;
  font-size: 0.78em;
  line-height: 1.1;
  margin-top: 0.1em;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.16s ease;
  text-shadow: 0 0.08em 0.2em rgba(0, 0, 0, 0.25);
}

.skills-graph__node-wrap:hover .skills-graph__node-pct {
  opacity: 1;
}

.skills-graph__edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.skills-graph__node {
  position: relative;
  left: auto;
  top: auto;
  z-index: 2;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: min(0.22rem, 6%);
  text-align: center;
  color: #ffffff;
  font-family: "santana-blackregular", system-ui, sans-serif;
  font-weight: normal;
  line-height: 1.1;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: var(--skills-node-shadow);
  transition: box-shadow 0.22s ease;
  will-change: transform;
  flex-shrink: 0;
}

.skills-graph__node-wrap:hover .skills-graph__node {
  box-shadow: var(--skills-node-shadow-hover);
}

.skills-graph__node:active {
  cursor: grabbing;
}

.skills-graph__node--avatar {
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--skills-node-shadow);
  z-index: 2;
}

.skills-graph__node-wrap:hover .skills-graph__node--avatar {
  box-shadow: var(--skills-node-shadow-hover);
}

.skills-graph__node-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .skills-graph__node {
    will-change: auto;
  }

  .skills-graph__node-inner {
    transition: transform 0.12s ease;
  }

  .skills-graph__node-wrap:hover .skills-graph__node-inner {
    transform: scale(1.04);
  }
}

/** Textos: pantallas menores de 700px — ancho ventana menos 10px por lado. */
@media (max-width: 699px) {
  .c1-slide {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .page-strip--c3 .c3-slide {
    bottom: 30px;
  }

  .page-strip--c3 .c3-brains {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    top: 4vh;
    top: 4svh;
    top: 4dvh;
  }

  .page-strip--c3 .c3-brain-wrap {
    height: min(44vh, 44svh, 44dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.intro-done .hero__inner,
  body.intro-done .hero__name,
  body.intro-done .hero__role,
  body.intro-done .hero__portrait {
    transition-duration: 0.01ms;
  }

  body.intro-done.is-scrolled .hero__portrait {
    transition-duration: 0.01ms;
  }

  .hero__resume-download,
  .hero__bottom-bar,
  .hero__tagline-wrap {
    transition-duration: 0.01ms;
    transition-delay: 0s;
  }

  .conocimientos-top-actions {
    transition-duration: 0.01ms;
    transition-delay: 0s;
  }
}

/**
 * Portafolio + Work Experience — móvil.
 */
@media (max-width: 820px) {
  .page-portfolio {
    --portfolio-usable: calc(100dvh - var(--hero-collapsed-height));
    height: var(--portfolio-usable);
    min-height: var(--portfolio-usable);
    max-height: var(--portfolio-usable);
    overflow: hidden;
  }

  .page-portfolio__inner {
    height: 100%;
    max-height: 100%;
    padding-bottom: 0.5rem;
  }

  .page-portfolio__heading {
    margin-bottom: 0.25rem;
  }

  .page-work {
    --work-usable: calc(100dvh - var(--hero-collapsed-height));
    /* Cajas sin mover; franja naranja ~2× más ancha que el recorte anterior. */
    --work-cards-offset: max(30%, 100px);
    --work-timeline-gap: 15px;
    --work-timeline-w: max(
      calc(var(--work-cards-offset) - var(--work-timeline-gap)),
      80px
    );
    height: var(--work-usable);
    min-height: var(--work-usable);
    max-height: var(--work-usable);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .page-work__timeline {
    top: 0;
    bottom: 0;
    height: auto;
    width: var(--work-timeline-w);
    min-width: 0;
  }

  .page-work__inner {
    margin-left: var(--work-cards-offset);
  }

  .page-work__brackets {
    left: var(--work-timeline-w);
    width: calc(var(--work-cards-offset) - var(--work-timeline-w));
  }

  .page-work__timeline-track {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  /* Años destacados (start/end) en franja naranja — más pequeños */
  .page-work__timeline-year--milestone .page-work__timeline-year-label {
    font-size: 0.82rem;
    line-height: 1.05;
  }

  .page-work__inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .page-work__body {
    flex: 1 1 0;
    min-height: 0;
    margin-top: 0.35rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: transparent;
  }

  .page-work__entries {
    flex: 0 0 auto;
    gap: 14px;
    padding-left: 28px;
    padding-right: 12px;
    padding-bottom: 0;
  }

  .page-work__entry {
    padding: 0.55rem 0.65rem;
  }

  .page-work__entry-period {
    font-size: 0.68rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
  }

  .page-work__entry-company {
    font-size: 0.82rem;
    line-height: 1.1;
    margin-bottom: 0.4rem;
  }

  .page-work__entry-position {
    font-size: 0.65rem;
    line-height: 1.32;
    margin-bottom: 0.28rem;
  }

  .page-work__entry-position-title {
    font-weight: 600;
  }

  /**
   * Contacto: altura = viewport − hero; layout compacto para ver resume y snaps correctos.
   */
  .page-contact {
    --contact-usable: calc(100dvh - var(--hero-collapsed-height));
    height: var(--contact-usable);
    min-height: var(--contact-usable);
    max-height: var(--contact-usable);
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
  }

  .page-contact__layout {
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .page-contact__col--form {
    min-height: 0;
    overflow: hidden;
    justify-content: flex-start;
    padding-top: 0.4rem;
    padding-bottom: 0.5rem;
    padding-left: max(
      clamp(2.75rem, 7.5vw, 3.25rem),
      calc(2.75rem + env(safe-area-inset-left, 0px))
    );
    padding-right: max(
      clamp(2.75rem, 7.5vw, 3.25rem),
      calc(2.75rem + env(safe-area-inset-right, 0px))
    );
  }

  .page-contact__col--info {
    min-height: 0;
    flex: 0 0 auto;
    justify-content: flex-start;
    padding-top: 0.55rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    padding-left: max(
      clamp(2.75rem, 7.5vw, 3.25rem),
      calc(2.75rem + env(safe-area-inset-left, 0px))
    );
    padding-right: max(
      clamp(2.75rem, 7.5vw, 3.25rem),
      calc(2.75rem + env(safe-area-inset-right, 0px))
    );
  }

  .page-contact__heading {
    font-size: clamp(1.25rem, 5.5vw, 1.55rem);
    margin-top: 10px;
    margin-bottom: 0.45rem;
  }

  .page-contact__form {
    gap: 0.55rem;
    min-height: 0;
    overflow: hidden;
  }

  .page-contact__fields {
    gap: 0.45rem;
  }

  .page-contact__label {
    font-size: 0.78rem;
  }

  .page-contact__input,
  .page-contact__textarea {
    font-size: 0.9rem;
    padding: 0.45rem 0.55rem;
  }

  .page-contact__textarea {
    min-height: 3.5rem;
    resize: none;
  }

  .page-contact__submit {
    padding: 0.5rem 1.1rem;
    font-size: 0.88rem;
  }

  .page-contact__info {
    margin-bottom: 0;
    gap: 0.35rem;
  }

  .page-contact__name {
    font-size: clamp(1rem, 4.5vw, 1.2rem);
    margin-bottom: 0.15rem;
  }

  .page-contact__role,
  .page-contact__langs,
  .page-contact__location {
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
  }

  .page-contact__action {
    font-size: 0.82rem;
  }

  .page-contact__action--resume {
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .page-contact__action-icon {
    width: 18px;
    height: 18px;
  }
}
