/* =====================================================================
   0. RESET Y BASE
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background-color: var(--c-red-glow, #ff004f);
  color: var(--c-white, #fff);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--c-bg, #0a0a0c);
}

::-webkit-scrollbar-thumb {
  background: var(--c-surface-2, #1a1a1e);
  border: 1px solid var(--c-bg, #0a0a0c);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-grey-2, #6d6d76);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

ul {
  list-style: none;
}

/* =====================================================================
   1. TOKENS DE DISEÑO
   ===================================================================== */
:root {
  /* Color: negro casi puro con matices de profundidad, blanco cálido, rojo de marca */
  --c-bg: #0a0a0c;
  --c-bg-alt: #0d0d10;
  --c-surface: #131316;
  --c-surface-2: #1a1a1e;
  --c-white: #f5f5f7;
  --c-grey-1: #a9a9b2;
  /* texto secundario */
  --c-grey-2: #6d6d76;
  /* texto terciario / metadatos */
  --c-border: rgba(245, 245, 247, .09);
  --c-border-strong: rgba(245, 245, 247, .18);
  --c-red: #ff004f;
  --c-red-dim: rgba(255, 0, 79, .14);
  --c-red-glow: rgba(255, 0, 79, .38);

  /* Tipografía */
  --f-display: 'Syne', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Ritmo y forma */
  --container: min(1240px, 92vw);
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 26px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-s: .35s;
  --dur-m: .7s;
  --dur-l: 1.1s;
}

/* =====================================================================
   2. BASE TIPOGRÁFICA
   ===================================================================== */
body {
  font-family: var(--f-body);
  background: var(--c-bg);
  color: var(--c-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-red);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--c-red);
  display: inline-block;
}

.lede {
  color: var(--c-grey-1);
  font-size: clamp(1rem, .95rem + .3vw, 1.2rem);
  max-width: 52ch;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section-head h2 {
  font-size: clamp(2rem, 1.5rem + 3vw, 3.4rem);
  max-width: 16ch;
}

.section-alt {
  background-color: var(--c-bg-alt);
  border-block: 1px solid var(--c-border);
}

.container {
  width: var(--container);
  margin-inline: auto;
}

section {
  position: relative;
  padding-block: clamp(5rem, 10vw, 9rem);
}

/* Franja de "capítulo": simula los timestamps de un vídeo de YouTube —
   cada sección de la web es una "escena" del reel, igual que los capítulos
   de sus propios vídeos. */
.chapter-tag {
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--c-grey-2);
  letter-spacing: .08em;
  margin-bottom: .5rem;
}

.chapter-tag b {
  color: var(--c-red);
  font-weight: 500;
}

/* Utilidad: visualmente oculto salvo foco (accesibilidad) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 1rem;
  z-index: 999;
  background: var(--c-red);
  color: var(--c-bg);
  padding: .8rem 1.2rem;
  border-radius: var(--radius-s);
  font-weight: 600;
  transition: top var(--dur-s) var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =====================================================================
   3. BOTONES
   ===================================================================== */
.btn {
  --pad-y: .95rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: .95rem;
  padding: var(--pad-y) 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform var(--dur-s) var(--ease-out),
    background var(--dur-s) var(--ease-out),
    border-color var(--dur-s) var(--ease-out),
    box-shadow var(--dur-s) var(--ease-out);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur-s) var(--ease-out);
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn:active {
  transform: scale(.97);
}

.btn--primary {
  background: var(--c-red);
  color: var(--c-bg);
}

.btn--primary:hover {
  box-shadow: 0 0 0 8px var(--c-red-dim);
}

.btn--outline {
  border-color: var(--c-border-strong);
  color: var(--c-white);
}

.btn--outline:hover {
  border-color: var(--c-red);
  background: var(--c-red-dim);
}

.btn--sm {
  --pad-y: .6rem;
  font-size: .84rem;
  padding-inline: 1.2rem;
}

/* =====================================================================
   4. HEADER / NAVEGACIÓN
   ===================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  padding-block: 1.3rem;
  transition: padding var(--dur-s) var(--ease-out),
    background var(--dur-s) var(--ease-out),
    border-color var(--dur-s) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  padding-block: .85rem;
  background: rgba(10, 10, 12, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--c-border);
}

.nav-inner {
  width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--f-mono);
  font-size: .95rem;
  letter-spacing: .06em;
  font-weight: 500;
}

.brand strong {
  font-weight: 600;
  color: var(--c-red);
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 0 0 var(--c-red-glow);
  animation: pulse-dot 2.2s var(--ease-in-out) infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--c-red-glow);
  }

  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

.nav-links {
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  font-size: .92rem;
  color: var(--c-grey-1);
  position: relative;
  padding-block: .2rem;
  transition: color var(--dur-s) var(--ease-out);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-s) var(--ease-out);
}

.nav-links a:hover {
  color: var(--c-white);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--c-white);
  transition: transform var(--dur-s) var(--ease-out), opacity var(--dur-s) var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* =====================================================================
   5. HUD DE TELEMETRÍA (elemento distintivo)
   Un lector de "timecode" fijo, como el visor de una cámara de cine o el
   contador de un editor de vídeo: mientras se hace scroll, la página se
   "reproduce" como si fuese uno de sus propios reels.
   ===================================================================== */
.hud {
  position: fixed;
  top: 1.4rem;
  right: clamp(1rem, 3vw, 2.5rem);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .9rem .5rem .5rem;
  background: rgba(19, 19, 22, .55);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity var(--dur-m) var(--ease-out);
}

.hud.is-ready {
  opacity: 1;
}

.hud__ring {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
}

.hud__ring svg {
  width: 30px;
  height: 30px;
  transform: rotate(-90deg);
}

.hud__ring-bg {
  fill: none;
  stroke: var(--c-border-strong);
  stroke-width: 2.4;
}

.hud__ring-fg {
  fill: none;
  stroke: var(--c-red);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 119.4;
  transition: stroke-dashoffset .15s linear;
}

.hud__dot {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-red);
  animation: pulse-dot 2.2s var(--ease-in-out) infinite;
}

.hud__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hud__time {
  font-family: var(--f-mono);
  font-size: .82rem;
  letter-spacing: .03em;
}

.hud__label {
  font-family: var(--f-mono);
  font-size: .58rem;
  color: var(--c-grey-2);
  letter-spacing: .08em;
}

@media (max-width: 640px) {
  .hud__label {
    display: none;
  }

  .hud {
    top: auto;
    bottom: 1.1rem;
    right: 1rem;
  }
}

/* =====================================================================
   6. HERO
   ===================================================================== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-block: clamp(6rem, 12vw, 8rem) clamp(3.5rem, 7vw, 5.5rem);
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
}

/* Fondo: retícula técnica (guiño al plano/planificación de rodaje) + resplandor */
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 245, 247, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 245, 247, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 30% 30%, #000 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 30%, #000 40%, transparent 90%);
}

.hero__glow {
  position: absolute;
  right: -10%;
  top: 10%;
  width: 60%;
  height: 70%;
  background: radial-gradient(circle, var(--c-red-glow), transparent 65%);
  opacity: .35;
  filter: blur(10px);
  pointer-events: none;
}

.hero__photo-wrap {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(58%, 900px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%);
  mask-image: linear-gradient(90deg, transparent, #000 22%);
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(.55) contrast(1.12) brightness(.78);
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.hero__photo.is-loaded {
  opacity: 1;
}

.hero__photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--c-bg) 0%, transparent 45%),
    linear-gradient(90deg, var(--c-bg) 0%, transparent 30%),
    linear-gradient(180deg, rgba(255, 0, 79, .12), transparent 40%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: var(--container);
  margin-inline: auto;
}

.hero__eyebrow {
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 5.4vw, 5.6rem);
  max-width: 15ch;
}

.hero h1 span {
  display: block;
}

.hero h1 .accent {
  color: var(--c-red);
  text-shadow: 0 0 80px rgba(255, 0, 79, 0.4);
}

.hero__sub {
  margin-top: 1.6rem;
  color: var(--c-grey-1);
  font-size: clamp(1rem, .94rem + .4vw, 1.25rem);
  max-width: 48ch;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  left: var(--edge, 0);
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--c-grey-2);
  text-transform: uppercase;
  z-index: 2;
}

.scroll-cue {
  margin-inline: auto;
  left: 0;
  right: 0;
  width: fit-content;
}

.scroll-cue__line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--c-grey-2), transparent);
  overflow: hidden;
  position: relative;
}

.scroll-cue__line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--c-red), transparent);
  animation: scroll-cue-fall 1.8s var(--ease-in-out) infinite;
}

@keyframes scroll-cue-fall {
  to {
    top: 100%;
  }
}

@media (max-width: 768px),
(max-height: 700px) {
  .scroll-cue {
    display: none;
  }
}

/* Marquee / cinta editorial entre HERO y SOBRE MÍ */
.marquee {
  border-block: 1px solid var(--c-border);
  background: var(--c-bg-alt);
  overflow: hidden;
  padding-block: .9rem;
}

.marquee__track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee span {
  font-family: var(--f-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-grey-2);
  display: flex;
  align-items: center;
  gap: .8rem;
}

.marquee span b {
  color: var(--c-red);
  font-weight: 500;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* =====================================================================
   7. SOBRE MÍ 
   ===================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.about__portrait {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: linear-gradient(160deg, var(--c-surface), var(--c-bg-alt));
  border: 1px solid var(--c-border);
}

.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.5) contrast(1.1) brightness(.85);
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}

.about__portrait img.is-loaded {
  opacity: 1;
}

.about__badge {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  background: rgba(10, 10, 12, .72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-m);
  padding: .9rem 1.2rem;
}

.about__badge b {
  font-family: var(--f-mono);
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  color: var(--c-red);
  display: block;
  letter-spacing: -0.04em;
  margin-bottom: 0.2rem;
}

.about__badge span {
  font-size: .75rem;
  color: var(--c-grey-1);
}

.about__content h2 {
  font-size: clamp(1.8rem, 1.4rem + 2.2vw, 2.7rem);
  max-width: 18ch;
  margin-bottom: 1.6rem;
}

.about__content p {
  color: var(--c-grey-1);
  max-width: 58ch;
}

.about__content p+p {
  margin-top: 1.1rem;
}

.about__content strong {
  color: var(--c-white);
  font-weight: 600;
}

/* =====================================================================
   8. SERVICIOS — grid tipo "bento"
   ===================================================================== */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.service-card {
  background: var(--c-bg);
  padding: clamp(1.7rem, 2.6vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: background var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
  min-height: 210px;
  position: relative;
  z-index: 1;
}

.service-card:hover {
  background: var(--c-surface);
  transform: translateY(-2px);
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.service-card:nth-child(1) {
  grid-column: span 2;
}

.service-card .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-red-dim);
  color: var(--c-red);
  transition: transform var(--dur-s) var(--ease-out);
}

.service-card:hover .icon-wrap {
  transform: translateY(-3px);
}

.service-card .icon-wrap svg {
  width: 20px;
  height: 20px;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.service-card p {
  color: var(--c-grey-1);
  font-size: .92rem;
  max-width: 32ch;
}

@media (max-width: 900px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card:nth-child(1),
  .service-card:nth-child(8) {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .services__grid {
    grid-template-columns: 1fr;
  }

  .service-card:nth-child(1),
  .service-card:nth-child(8) {
    grid-column: span 1;
  }
}

/* =====================================================================
   8b. SERVICIOS + POR QUÉ — cabecera fusionada
   ===================================================================== */
.services-why__header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.services-why__left h2 {
  font-size: clamp(1.9rem, 1.4rem + 2.6vw, 3.2rem);
  max-width: 18ch;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.why-pills {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding-top: .4rem;
}

.why-pill {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
  color: var(--c-grey-1);
  padding: .9rem 1.1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  transition: background var(--dur-s) var(--ease-out), border-color var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out);
}

.why-pill:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
  color: var(--c-white);
}

.why-pill svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--c-red);
}

@media (max-width: 860px) {
  .services-why__header {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =====================================================================
   9. PROYECTOS
   ===================================================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1.4rem;
}

.project-card {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--c-border);
  min-height: 260px;
  isolation: isolate;
}

.project-card:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 420px;
}

.project-card__art {
  position: absolute;
  inset: 0;
  background-color: var(--c-surface);
  background-image: var(--card-bg, none);
  background-size: cover;
  background-position: center;
  transition: transform 1.4s var(--ease-out), filter var(--dur-m) var(--ease-out);
  filter: grayscale(.25) brightness(.7);
}

.project-card__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(245, 245, 247, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 245, 247, .04) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .3;
}

.project-card:hover .project-card__art {
  transform: scale(1.06);
  filter: grayscale(0) brightness(.82);
}

.project-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 6, 7, .95) 0%, rgba(6, 6, 7, .4) 45%, rgba(6, 6, 7, .1) 75%, transparent 100%);
  transition: background var(--dur-m) var(--ease-out);
}

.project-card__body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.project-card__tag {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: .3rem;
}

.project-card__title {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  font-weight: 700;
}

.project-card__stat {
  color: var(--c-grey-1);
  font-size: .95rem;
}

.project-card__stat span[data-count] {
  font-family: var(--f-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-white);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  margin-top: .7rem;
  color: var(--c-white);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}

.project-card__link svg {
  width: 14px;
  height: 14px;
}

.project-card:hover .project-card__link,
.project-card:focus-within .project-card__link {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: rgba(255, 0, 79, .3);
}

.project-card:hover .project-card__scrim {
  background:
    linear-gradient(0deg, rgba(6, 6, 7, .95) 0%, rgba(6, 6, 7, .4) 45%, rgba(6, 6, 7, .1) 75%, transparent 100%),
    linear-gradient(135deg, rgba(255, 0, 79, .15), transparent 60%);
}

@media (max-width: 900px) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 320px;
  }

  .project-card:nth-child(4) {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .projects__grid {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(1),
  .project-card:nth-child(4) {
    grid-column: span 1;
  }
}

/* =====================================================================
   9b. ÚLTIMO VÍDEO
   ===================================================================== */
.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-bg-alt);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.video-wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

.video-actions {
  padding: 1.2rem;
  display: flex;
  justify-content: flex-end;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}

@media (max-width: 620px) {
  .video-actions {
    justify-content: center;
  }

  .video-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================================
   10. ESTADÍSTICAS
   ===================================================================== */
.stats {
  background: var(--c-bg-alt);
  border-block: 1px solid var(--c-border);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.stat {
  text-align: left;
  padding-inline-end: 1rem;
  border-right: 1px solid var(--c-border);
}

.stat:last-child {
  border-right: none;
}

/* Selector para el número y sufijo */
.stat b {
  font-family: var(--f-mono);
  font-weight: 600;
  /* Tamaño ajustado (mínimo: 3.5rem, preferido: 3rem + 5.5vw, máximo: 7.5rem) */
  font-size: clamp(3.5rem, 3rem + 5.5vw, 7.5rem);
  line-height: 1;
  color: var(--c-white);
  display: block;
  letter-spacing: -.02em;
  margin-bottom: 0.5rem;
}

/* Asegura que la cifra mantenga el tamaño grande */
.stat b span[data-count] {
  font-size: inherit;
  color: inherit;
}

.stat b .unit {
  color: var(--c-red);
}

/* Texto descriptivo en tamaño pequeño */
.stat>span {
  color: var(--c-grey-1);
  font-size: 0.92rem;
  display: block;
}

.stats__foot {
  margin-top: 2.6rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--c-border);
  color: var(--c-grey-2);
  font-family: var(--f-mono);
  font-size: .84rem;
  letter-spacing: .02em;
}

@media (max-width: 700px) {
  .stats__grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .stat {
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 1.4rem;
  }

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



/* =====================================================================
   11. TESTIMONIOS
   ===================================================================== */
.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.testimonial-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.testimonial-card__quote {
  font-size: .78rem;
  font-family: var(--f-mono);
  color: var(--c-red);
}

.testimonial-card p {
  color: var(--c-grey-1);
  font-size: 1rem;
  line-height: 1.65;
}

.testimonial-card__who {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: auto;
}

.testimonial-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--c-surface-2), var(--c-bg-alt));
  border: 1px solid var(--c-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--c-grey-1);
}

.testimonial-card__who b {
  display: block;
  font-size: .92rem;
  font-weight: 600;
}

.testimonial-card__who span {
  font-size: .8rem;
  color: var(--c-grey-2);
}

@media (max-width: 900px) {
  .testimonials__grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   13. CONTACTO
   ===================================================================== */
.contact {
  background: var(--c-bg-alt);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.contact__intro h2 {
  font-size: clamp(2rem, 1.6rem + 2.6vw, 3.2rem);
  max-width: 14ch;
}

.contact__intro p {
  margin-top: 1.2rem;
  color: var(--c-grey-1);
  max-width: 42ch;
}

.contact__direct {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact__email {
  font-family: var(--f-mono);
  font-size: clamp(1rem, .9rem + .5vw, 1.3rem);
  border-bottom: 1px solid var(--c-border-strong);
  width: fit-content;
  padding-bottom: .3rem;
  transition: color var(--dur-s) var(--ease-out), border-color var(--dur-s) var(--ease-out);
}

.contact__email:hover {
  color: var(--c-red);
  border-color: var(--c-red);
}

.socials {
  display: flex;
  gap: .9rem;
  margin-top: .6rem;
}

.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--c-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}

.socials a svg {
  width: 18px;
  height: 18px;
}

.socials a:hover {
  border-color: var(--c-red);
  background: var(--c-red-dim);
  transform: translateY(-3px);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.form-field label {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-grey-2);
}

.form-field input,
.form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-border-strong);
  padding-block: .7rem;
  font-size: 1rem;
  color: var(--c-white);
  transition: border-color var(--dur-s) var(--ease-out);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--c-grey-2);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--c-red);
}

.form-field textarea {
  resize: vertical;
  min-height: 96px;
}

.form-note {
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--c-grey-1);
  display: flex;
  align-items: center;
  gap: .5rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity var(--dur-s) var(--ease-out);
}

.form-note.is-visible {
  opacity: 1;
  max-height: 60px;
}

.form-note b {
  color: var(--c-red);
}

@media (max-width: 860px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   14. FOOTER
   ===================================================================== */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding-block: 2.6rem;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__copy {
  font-size: .82rem;
  color: var(--c-grey-2);
}

.footer__socials {
  display: flex;
  gap: 1.2rem;
}

.footer__socials a {
  color: var(--c-grey-1);
  transition: color var(--dur-s) var(--ease-out);
}

.footer__socials a:hover {
  color: var(--c-red);
}

.footer__socials svg {
  width: 18px;
  height: 18px;
}

/* =====================================================================
   15. SCROLL REVEAL (progressive enhancement)
   ===================================================================== */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
  transition-delay: calc(var(--rd, 0) * 90ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* =====================================================================
   16. RESPONSIVE — NAV Y TIPOGRAFÍA GENERAL
   ===================================================================== */
@media (max-width: 860px) {

  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header .nav-inner {
    position: relative;
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: rgba(10, 10, 12, .98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out), visibility 0s linear var(--dur-m);
  }

  .mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
  }

  .mobile-menu a {
    font-family: var(--f-display);
    font-size: 1.7rem;
    font-weight: 700;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__portrait {
    aspect-ratio: 16/10;
  }

  .hero__photo-wrap {
    width: 100%;
    opacity: .55;
  }

  .hero__photo-wrap::after {
    background: linear-gradient(0deg, var(--c-bg) 10%, transparent 55%), linear-gradient(180deg, rgba(255, 0, 79, .14), transparent 40%);
  }
}

@media (max-width: 520px) {
  section {
    padding-block: 3.6rem;
  }

  .stats__foot {
    font-size: .74rem;
  }
}

/* =====================================================================
   18. CURSOR PERSONALIZADO
   ===================================================================== */
html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}

.cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
}

html.has-custom-cursor .cursor {
  display: block;
  opacity: 1;
  transition: opacity var(--dur-s) var(--ease-out);
}

html.has-custom-cursor.cursor-hidden .cursor {
  opacity: 0;
}

.cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--c-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  transition: transform 0.08s linear, width 0.3s var(--ease-out), height 0.3s var(--ease-out);
  will-change: left, top;
}

.cursor__ring {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 0, 79, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
  will-change: left, top;
}

html.cursor-hover .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: rgba(255, 0, 79, 0.9);
}

html.cursor-clicking .cursor__dot {
  width: 10px;
  height: 10px;
}

html.cursor-clicking .cursor__ring {
  width: 22px;
  height: 22px;
}

/* =====================================================================
   19. PRELOADER
   ===================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease-out), visibility 0.7s;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4rem;
}

.preloader__logo {
  font-family: var(--f-mono);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  font-weight: 500;
  color: var(--c-white);
  animation: preloader-breathe 1.5s var(--ease-in-out) infinite;
}

.preloader__logo strong {
  color: var(--c-red);
  font-weight: 600;
}

@keyframes preloader-breathe {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.preloader__bar {
  width: 140px;
  height: 1px;
  background: var(--c-border-strong);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.preloader__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--c-red);
  border-radius: 999px;
  transition: width 0.3s var(--ease-out);
}

/* =====================================================================
   20. RETRASO DE REVEAL DURANTE PRELOADER
   (primera visita: hero entra justo al terminar el preloader)
   ===================================================================== */
html.has-preloader .js [data-reveal] {
  transition-delay: calc(1.55s + var(--rd, 0) * 90ms);
}

/* =====================================================================
   17. MOVIMIENTO REDUCIDO Y SIN JAVASCRIPT
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .2s !important;
  }

  .js [data-reveal] {
    transform: none;
  }

  .marquee__track {
    animation: none;
  }
}

noscript .hud,
noscript .scroll-cue {
  display: none;
}