/* ——— Navbar ——— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: 0 clamp(1.25rem, 4vw, 3rem) 0 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(0) saturate(100%);
  -webkit-backdrop-filter: blur(0) saturate(100%);
  transition:
    background 400ms cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1),
    -webkit-backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__brand {
  justify-self: start;
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  margin-left: 0;
  color: #000000;
  text-decoration: none;
}

.nav__brand-panel {
  --nav-brand-mark: clamp(1.85rem, 3.25vw, 2.5rem);
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.02em;
  height: 100%;
  min-height: var(--nav-height);
  min-width: 0;
  padding: 0 clamp(0.7rem, 1.55vw, 1.05rem);
  background: #0a0c10;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(15, 255, 212, 0.55),
    0 0 22px rgba(15, 255, 212, 0.18);
}

.nav__brand-neural {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.nav__brand-segment {
  position: relative;
  z-index: 1;
  font-family: "Rozha One", "Cinzel", Georgia, serif;
  font-weight: 400;
  font-size: calc(var(--nav-brand-mark) * 0.78);
  font-synthesis: none;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 0.87;
  white-space: nowrap;
  text-rendering: geometricPrecision;
}

.nav__brand-segment--accent {
  margin-left: 0.14em;
  font-size: calc(var(--nav-brand-mark) * 0.7);
  letter-spacing: 0;
  color: #ffffff;
}

.nav__brand-o {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: var(--nav-brand-mark);
  height: var(--nav-brand-mark);
  margin: 0;
  padding: 0.06em;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__brand-o canvas,
.nav__brand-o spline-viewer {
  display: block;
  width: 100% !important;
  height: 100% !important;
  filter: grayscale(1) contrast(1.05) brightness(1.15);
}

.nav__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.2s var(--ease-out);
}

.nav__contact:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(15, 255, 212, 0.22);
  transform: translateY(-1px);
}

.nav__contact-arrow {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
}

.nav__contact--menu {
  display: none;
}

.nav__lang {
  position: relative;
  flex-shrink: 0;
}

.nav__lang.is-open {
  z-index: 130;
}

.nav__lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.55rem 0.38rem 0.38rem;
  border: none;
  border-radius: 999px;
  background: #2f2f2f;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav__lang-toggle:hover {
  background: #3a3a3a;
}

.nav__lang-flag {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
}

.nav__lang-flag img,
.nav__lang-option-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.nav__lang-chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.92;
  transition: transform 0.22s ease;
}

.nav__lang.is-open .nav__lang-chevron {
  transform: rotate(180deg);
}

.nav__lang-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 120;
  width: min(18.5rem, calc(100vw - 2rem));
  padding: 0.65rem;
  border-radius: 0.85rem;
  background: #131313;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.nav__lang-panel[hidden] {
  display: none;
}

.nav__lang-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: min(14rem, 42vh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav__lang-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}

.nav__lang-option-flag {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

.nav__lang-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.nav__lang-option-name {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.2;
}

.nav__lang-option-code {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.nav__lang-option:hover,
.nav__lang-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav__lang-option.is-active {
  background: rgba(255, 255, 255, 0.06);
}

.nav__toggle {
  display: none;
  position: relative;
  z-index: 102;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-direction: column;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.nav__toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(15, 255, 212, 0.22);
}

.nav__toggle-line {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition:
    transform 0.28s var(--ease-out),
    opacity 0.2s ease;
}

.nav--open .nav__toggle-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav--open .nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.nav--open .nav__toggle-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav--scrolled {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav__links {
  position: relative;
  justify-self: center;
  display: flex;
  gap: clamp(1.1rem, 2.8vw, 2.25rem);
  align-items: center;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateX(-4cm);
}

.nav__links a {
  position: relative;
  font-size: 0.88rem;
  font-weight: 500;
  color: #ffffff;
  padding: 0.35rem 0;
  border-radius: 0;
  transition: color 0.2s ease, transform 0.2s var(--ease-out);
}

.nav__links a:hover {
  color: #ffffff;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.nav__links a.nav__link--active {
  color: #ffffff;
  background: transparent;
  box-shadow: none;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: var(--nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: clip;
  overflow-y: visible;
  text-align: center;
  pointer-events: none;
  --hero-brand-left: clamp(0.2rem, 0.85vw, 0.65rem);
  --hero-title-size: clamp(5rem, 17vw, 11.5rem);
  --hero-brand-top: calc(50% - clamp(0.35rem, 1.1vh, 0.75rem) + 1cm);
}

.hero__bg-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    rgba(15, 255, 212, 0.22) 0.5px,
    transparent 0.5px
  );
  background-size: 20px 20px;
  animation: heroDotsPulse 5s ease-in-out infinite;
  opacity: 0.08;
  transform: translateY(var(--hero-dots-parallax, 0px));
  will-change: transform;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 65% 55% at 82% 48%,
    rgba(123, 97, 255, 0.08) 0%,
    transparent 58%
  );
}

.hero__canvas-wrap {
  position: fixed;
  z-index: 0;
  left: var(--brain-scroll-x, 73%);
  right: auto;
  top: var(--brain-scroll-y, 50vh);
  bottom: auto;
  width: min(1320px, 72vw);
  height: min(1320px, 72vw);
  margin: 0;
  flex-shrink: 0;
  transform: translate(-50%, -50%) scale(var(--brain-scale, 1));
  transition:
    filter 300ms ease,
    width 0.65s var(--ease-out),
    height 0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
  will-change: top, left, transform;
  pointer-events: none;
  overflow: visible;
  mask-image: radial-gradient(
    ellipse 84% 80% at 50% 50%,
    #000 42%,
    transparent 88%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 84% 80% at 50% 50%,
    #000 42%,
    transparent 88%
  );
}

.hero__canvas-wrap.hero__canvas-wrap--proceso {
  z-index: 7;
  width: clamp(8rem, 15vw, 11rem);
  height: clamp(8rem, 15vw, 11rem);
  --brain-scale: 1;
  pointer-events: auto;
  mask-image: radial-gradient(
    ellipse 88% 84% at 50% 50%,
    #000 55%,
    transparent 92%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 88% 84% at 50% 50%,
    #000 55%,
    transparent 92%
  );
}

.hero__canvas-wrap canvas,
.hero__canvas-wrap spline-viewer,
.hero__brain-canvas {
  width: 100% !important;
  height: 100% !important;
  margin: 0 auto;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
}

.hero__brain-canvas--interacting,
.hero__canvas-wrap canvas:active,
.hero__brain-canvas:active {
  cursor: grabbing;
}

.hero__canvas-tooltip {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: -1.85rem;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  background: rgba(3, 5, 8, 0.78);
  border: 1px solid rgba(15, 255, 212, 0.28);
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.hero__canvas-wrap:hover .hero__canvas-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 42rem;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2rem);
  margin-top: clamp(1.25rem, 4vh, 2.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero__keywords {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  padding: 0 var(--hero-brand-left) clamp(1.5rem, 4vw, 3rem);
  transform: translateY(calc(clamp(-2rem, -4.5vh, -0.75rem) + 2cm));
}

.hero__keyword {
  position: relative;
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.55vw, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #ffffff;
  white-space: nowrap;
}

.hero__keyword--tech {
  justify-self: start;
  align-self: center;
}

.hero__keyword--innov {
  justify-self: center;
  align-self: center;
}

.hero__keyword--digital {
  position: absolute;
  right: var(--hero-brand-left);
  top: 50%;
  left: auto;
  transform: translateY(-50%);
}

.hero__brand {
  position: absolute;
  z-index: 2;
  top: var(--hero-brand-top);
  bottom: auto;
  left: var(--hero-brand-left);
  margin: 0;
  pointer-events: none;
  font-family: "Allura", cursive;
  font-weight: 400;
  font-size: var(--hero-title-size);
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-align: left;
}

.hero__brand-line {
  display: block;
}

.hero__brand-line--ia {
  color: var(--text-primary);
}

.hero__tagline {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__tagline .gradient-word {
  background: linear-gradient(
    105deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 36rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.25rem;
}

/* ——— Scroll indicator ——— */
.hero__scroll {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 2.75rem);
  right: clamp(1.5rem, 4vw, 3rem);
  left: auto;
  transform: none;
  z-index: 3;
}

.hero__scroll-text {
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(238, 241, 247, 0.52);
  white-space: nowrap;
}

.hero__scroll-line {
  display: none;
  width: 1px;
  height: 2.25rem;
  background: linear-gradient(
    to bottom,
    var(--accent-primary),
    transparent
  );
  border-radius: 1px;
  animation: scrollPulse 2s ease-in-out infinite;
  transform-origin: top center;
}

.hero__scroll-icon {
  display: none;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--accent-primary);
  opacity: 0.85;
  animation: scrollBounce 2s ease-in-out infinite;
}

/* ——— Párrafo intro (entre hero y stack) ——— */
.hero-intro {
  position: relative;
  z-index: 5;
  margin-top: 4cm;
  min-height: clamp(18rem, 52vh, 30rem);
  display: flex;
  align-items: flex-end;
  overflow-x: clip;
  padding: clamp(1.5rem, 5vh, 3rem) max(0.25rem, env(safe-area-inset-right, 0px))
    clamp(3rem, 8vh, 5rem)
    max(0.15rem, env(safe-area-inset-left, 0px));
  pointer-events: auto;
}

.hero-intro__inner {
  width: 100%;
  margin: 0;
  padding-left: var(--hero-brand-left, clamp(0.2rem, 0.85vw, 0.65rem));
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vh, 2.75rem);
}

.hero-intro__text {
  max-width: none;
  width: 100%;
  margin: 0;
  font-family: "Allura", cursive;
  font-size: clamp(2.1rem, 6.2vw, 4.25rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
}

.hero-intro--visible .hero-intro__text {
  animation: heroIntroReveal 0.75s var(--ease-out) forwards;
}

/* ——— Tecnologías ——— */
.tech {
  --tech-tile-size: 5cm;
  --tech-tile-gap: 3px;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
  background: #000000;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  overflow: hidden;
}

.tech__rows {
  display: flex;
  flex-direction: column;
  gap: var(--tech-tile-gap);
  width: 100%;
}

.tech-row {
  width: 100%;
  overflow: hidden;
  background: #000000;
}

.tech-row__track {
  display: flex;
  align-items: stretch;
  gap: var(--tech-tile-gap);
  width: max-content;
  will-change: transform;
}

.tech-row--ltr .tech-row__track,
.tech-row--rtl .tech-row__track {
  flex-direction: row;
}

.tech-tile {
  flex-shrink: 0;
  width: var(--tech-tile-size);
  height: var(--tech-tile-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  padding: 1.1rem;
}

.tech-tile__logo {
  width: 100%;
  height: 100%;
  max-width: 2.75cm;
  max-height: 2.75cm;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.tech-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
  background: transparent;
}

.hero-intro .tech-metrics {
  margin-top: clamp(6rem, 16vh, 11rem);
}

.tech-metric {
  --reveal-delay: 0ms;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  transform: translateY(24px);
}

.tech-metric--visible {
  animation: techMetricReveal 0.68s var(--ease-out) var(--reveal-delay) forwards;
}

.tech-metric__value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 0.35rem;
  color: #ffffff;
  text-shadow: none;
}

.tech-metric:nth-child(odd) .tech-metric__value,
.tech-metric:nth-child(even) .tech-metric__value {
  color: #ffffff;
  text-shadow: none;
}

.tech-metric__label {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.45;
  max-width: 14rem;
  margin: 0 auto;
  opacity: 0.92;
}

/* ——— Proyectos ——— */
.projects {
  --projects-thumb-size: clamp(5.5rem, 12vw, 9.5rem);
  scroll-margin-top: calc(var(--nav-height) + 1rem);
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(2.5rem, 6vw, 4rem);
  background: #000000;
}

.projects__heading-wrap {
  max-width: 72rem;
  margin: 0 auto clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.projects__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  margin: 0;
}

.projects__list {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.projects__row {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.projects__row:last-child {
  border-bottom: none;
}

.projects__row-inner {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.35rem, 3.2vw, 2.35rem) clamp(1.25rem, 4vw, 3rem);
  cursor: default;
}

.projects__row-thumb {
  flex: 0 0 auto;
  width: 0;
  min-width: 0;
  margin: 0;
  margin-right: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin-right 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
}

.projects__row-thumb img {
  display: block;
  width: var(--projects-thumb-size);
  height: var(--projects-thumb-size);
  object-fit: cover;
}

.projects__row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2.5rem);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects__row-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(0.92rem, 1.55vw, 1.2rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

.projects__row-arrow {
  flex-shrink: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1;
  color: #ffffff;
  opacity: 0.9;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

@media (hover: hover) {
  .projects__row:hover .projects__row-thumb,
  .projects__row.is-active .projects__row-thumb {
    width: var(--projects-thumb-size);
    margin-right: clamp(0.85rem, 2vw, 1.75rem);
    opacity: 1;
  }

  .projects__row:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  .projects__row:hover .projects__row-arrow,
  .projects__row.is-active .projects__row-arrow {
    opacity: 1;
    transform: translate(3px, -3px);
  }
}

.projects__row.is-active {
  background: rgba(255, 255, 255, 0.03);
}

.projects__row.is-active .projects__row-thumb {
  width: var(--projects-thumb-size);
  margin-right: clamp(0.85rem, 2vw, 1.75rem);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .projects__row-thumb,
  .projects__row-body,
  .projects__row-arrow {
    transition: none;
  }
}

/* ——— Proceso (sticky scroll-pinned) ——— */
.proceso {
  --proceso-steps: 6;
  position: relative;
  height: calc(var(--proceso-steps) * 100vh);
  scroll-margin-top: var(--nav-height);
  background: #ffffff;
  isolation: isolate;
}

.proceso__pin {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 100vh;
  width: 100%;
  pointer-events: none;
}

.proceso__slider {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  padding: calc(var(--nav-height) + 1.5rem) clamp(1.25rem, 6vw, 5rem) 2.5rem;
  background: #ffffff;
  pointer-events: auto;
}

.proceso--pinned .proceso__slider {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.06);
}

.proceso__title {
  font-family: "Press Start 2P", monospace;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: #000000;
  text-align: center;
  margin: 0;
}

.proceso__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  min-height: clamp(22rem, 50vh, 34rem);
  padding: 0;
}

.proceso__steps-viewport {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.proceso__steps-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(1.75rem, 4vw, 3.25rem);
  width: max-content;
  will-change: transform;
}

.proceso-step-item {
  position: relative;
  flex: 0 0 clamp(22rem, 42vw, 36rem);
  width: clamp(22rem, 42vw, 36rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  padding-top: 0.35rem;
  opacity: 0.45;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

.proceso-step-item.is-active {
  opacity: 1;
}

.proceso-step-item.is-near {
  opacity: 0.78;
}

.proceso-step-item__num {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #000000;
}

.proceso-step-item__body {
  min-width: 0;
  width: 100%;
}

.proceso-step-item__title {
  margin: 0 0 0.65rem;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: #000000;
}

.proceso-step-item__desc {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.58rem, 1.25vw, 0.72rem);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #000000;
  max-width: 28rem;
}

.proceso-step-item.is-active .proceso-step-item__desc {
  color: #000000;
}

.proceso__brain-anchor {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: clamp(5.5rem, 11vw, 8rem);
  height: clamp(5.5rem, 11vw, 8rem);
  transform: translate(-50%, -72%);
  pointer-events: none;
}

.proceso__scroll-track {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .proceso {
    height: auto;
  }

  .proceso__pin {
    position: relative;
    height: auto;
  }

  .proceso__slider {
    min-height: auto;
    box-shadow: none;
  }
}

.visually-hidden,
.proceso__steps-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Por qué CODEVS (sticky title + scroll focus list) ——— */
.why {
  scroll-margin-top: var(--nav-height);
}

.why__scroll {
  --why-steps: 5;
  position: relative;
  height: calc(var(--why-steps) * 100vh);
}

.why__pin {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 100vh;
  width: 100%;
}

.why__stage {
  display: flex;
  align-items: center;
  height: 100%;
  padding: calc(var(--nav-height) + 1.5rem) clamp(1.25rem, 4vw, 3rem) 2rem;
}

.why__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

.why__aside {
  align-self: center;
}

.why__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.why__list-viewport {
  position: relative;
  height: clamp(16rem, 52vh, 30rem);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 16%,
    #000 84%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 16%,
    #000 84%,
    transparent 100%
  );
}

.why__list-track {
  list-style: none;
  margin: 0;
  padding: 0;
  will-change: transform;
}

.why__list-item {
  display: flex;
  align-items: center;
  min-height: clamp(4.25rem, 11vh, 6.25rem);
  padding: 0.35rem 0;
  opacity: var(--why-item-opacity, 0.3);
  filter: blur(var(--why-item-blur, 8px));
  will-change: opacity, filter;
}

.why__list-text {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.8vw, 2.35rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: rgba(255, 255, 255, 0.28);
  transition: color 0.15s ease;
}

.why__list-item.is-focused .why__list-text {
  font-weight: 700;
  color: var(--text-primary);
}

.why.why--static .why__scroll {
  height: auto;
}

.why.why--static .why__pin {
  position: relative;
  height: auto;
}

.why.why--static .why__stage {
  padding-bottom: 2rem;
}

.why.why--static .why__layout {
  grid-template-columns: 1fr;
  gap: 2rem;
}

.why.why--static .why__list-viewport {
  height: auto;
  mask-image: none;
  -webkit-mask-image: none;
}

.why.why--static .why__list-track {
  transform: none !important;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.why.why--static .why__list-item {
  min-height: auto;
  opacity: 1 !important;
  filter: none !important;
}

.why.why--static .why__list-text {
  font-weight: 600;
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  .why__scroll {
    height: auto;
  }

  .why__pin {
    position: relative;
    height: auto;
  }

  .why__list-item {
    filter: none !important;
  }
}

/* ——— Testimonios ——— */
.testimonials {
  scroll-margin-top: calc(var(--nav-height) + 1rem);
  background:
    radial-gradient(ellipse 82% 52% at 50% 32%, rgba(15, 255, 212, 0.055) 0%, transparent 56%),
    var(--bg-tech-over-neural);
  padding: clamp(4rem, 10vw, 6.5rem) clamp(1.25rem, 4vw, 3rem);
}

.testimonials__inner {
  max-width: 72rem;
  margin: 0 auto;
}

/* Bloque centrado como .tech__header (sin marca; solo título) */
.testimonials__header {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto clamp(2.5rem, 5vw, 3.25rem);
}

.testimonials__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
}

.testimonials__grid {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 1rem;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  perspective: 800px;
  perspective-origin: center top;
}

.testimonials__grid::-webkit-scrollbar {
  height: 6px;
}

.testimonials__grid::-webkit-scrollbar-thumb {
  background: rgba(15, 255, 212, 0.25);
  border-radius: 3px;
}

/* --- Contacto --- */
.contact {
  scroll-margin-top: calc(var(--nav-height) + 1rem);
  position: relative;
  /* Por encima de main/footer (z-index 5) */
  z-index: 6;
  isolation: isolate;
  padding: clamp(4.5rem, 10vw, 7rem) clamp(1.25rem, 4vw, 3rem);
  background: radial-gradient(circle at 50% 28%, rgba(123, 97, 255, 0.1) 0%, transparent 55%);
  overflow: hidden;
}

/* --- Footer --- */
.footer {
  background: var(--bg-tech);
  border-top: 1px solid var(--glass-border);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
  margin-bottom: 0;
  opacity: 0;
  transition: opacity 0.65s var(--ease-out);
}

.footer--visible {
  opacity: 1;
}

/* Reset instantáneo cuando el footer deja el viewport (sections.js): el
 * usuario puede scrollear hacia arriba y bajar otra vez para ver el
 * reveal de nuevo sin un fade-out previo. */
.footer:not(.footer--visible) {
  transition: none !important;
}

.footer__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.footer__top {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  margin-bottom: 1.4rem;
}

.footer__bottom {
  border-top: 1px solid rgba(42, 52, 80, 0.45);
  padding-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.82rem;
}
