/* ====================================================
   PORTADA COMÚN · Portafolio Arnau Ramírez Roig
   Estilos base compartidos por las 3 variantes de portada
   ==================================================== */

:root {
  --hero-navy: #0a1522;
  --hero-light: #f3f6f9;
  --hero-muted: #8fa0b5;
  --hero-accent-light: #8fb0ff;
  --hero-ease: cubic-bezier(.16, 1, .3, 1);
}

/* Base del hero nuevo en pantalla completa */
.hero {
  position: relative;
  min-height: 100svh;
  color: var(--hero-light);
  background-color: var(--hero-navy);
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}

/* Desactivar cualquier rastro del hero anterior */
.hero::after {
  display: none !important;
}
.hero-img,
.side {
  display: none !important;
}

/* Franja de peligro en el pie del hero */
.hazard {
  height: 10px;
  background: repeating-linear-gradient(-45deg, #f0b800 0 12px, #101820 12px 24px);
  position: relative;
  z-index: 10;
  flex: none;
  width: 100%;
}

/* Tipografía y elementos comunes del hero */
.hero-oficio {
  font-family: var(--mono);
  font-size: clamp(1rem, .7rem + .9vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--hero-accent-light);
  margin: 0 0 1rem;
  line-height: 1.3;
  font-weight: 400;
}

.hero-identity {
  margin: 0 0 1.2rem;
}

.hero-pname {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
  color: #ffffff;
}

.hero-cname {
  margin: 0.45rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.2;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #d0dce8;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.hero-pinyin {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--hero-accent-light);
  letter-spacing: 0.05em;
  font-weight: 400;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: 0.005em;
  margin: 0;
  color: #ffffff;
  text-wrap: balance;
}

.hero-meta {
  font-family: var(--mono);
  font-size: clamp(0.75rem, 0.68rem + 0.3vw, 0.88rem);
  letter-spacing: 0.05em;
  color: var(--hero-muted);
  margin: 1.4rem 0 0;
  line-height: 1.5;
}

/* Foto recortada de Arnau */
.hero-figure-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.hero-arnau {
  display: block;
  max-height: clamp(520px, 86vh, 920px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform-origin: bottom center;
}

/* ====================================================
   CONMUTADOR DE VARIANTES (.pv-switch)
   Pastilla fija pequeña en mono abajo a la izquierda
   ==================================================== */
.pv-switch {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(10, 21, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8fa0b5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.pv-switch-lbl {
  font-weight: 600;
  color: var(--hero-accent-light);
  margin-right: 2px;
}

.pv-switch-sep {
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
}

.pv-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  color: #d0dce8;
  text-decoration: none;
  font-weight: 600;
  border-radius: 2px;
  transition: background-color 150ms ease, color 150ms ease;
}

.pv-switch-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pv-switch-btn.current {
  background: var(--accent, #1f55e0);
  color: #ffffff;
}

.pv-switch-btn:focus-visible {
  outline: 2px solid #5b8cff;
  outline-offset: 1px;
}

/* ====================================================
   SECCIÓN DE CIFRAS (.stats)
   Cabecera de Trayectoria, mismo fondo var(--bg2),
   sin corte con #camino y animación en cascada
   ==================================================== */
.stats {
  background: var(--bg2);
  padding-top: clamp(3.6rem, 7vw, 5.5rem);
  padding-bottom: clamp(0.5rem, 1.2vw, 1rem);
  margin-bottom: 0;
  border-top: none;
}

.stats ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.4rem 1.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 760px) {
  .stats ul {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stats li {
  position: relative;
  border-top: none;
  padding-top: 0.85rem;
  min-width: 0;
}

/* Línea superior animada */
.stat-rule {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 600ms var(--hero-ease);
}

/* Contenido de la cifra */
.stat-body {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--hero-ease), transform 500ms var(--hero-ease);
}

/* Cascada al entrar en pantalla */
.stats.is-in-view li:nth-child(1) .stat-rule {
  transform: scaleX(1);
  transition-delay: 0ms;
}
.stats.is-in-view li:nth-child(1) .stat-body {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 40ms;
}

.stats.is-in-view li:nth-child(2) .stat-rule {
  transform: scaleX(1);
  transition-delay: 70ms;
}
.stats.is-in-view li:nth-child(2) .stat-body {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 110ms;
}

.stats.is-in-view li:nth-child(3) .stat-rule {
  transform: scaleX(1);
  transition-delay: 140ms;
}
.stats.is-in-view li:nth-child(3) .stat-body {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 180ms;
}

.stats.is-in-view li:nth-child(4) .stat-rule {
  transform: scaleX(1);
  transition-delay: 210ms;
}
.stats.is-in-view li:nth-child(4) .stat-body {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 250ms;
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .stat-rule {
    transform: scaleX(1) !important;
    transition: none !important;
  }
  .stat-body {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
