/* ==========================================================================
   VDN Brands — pages/inicio.css
   Estilos exclusivos de la página de Inicio (index.html).
   ========================================================================== */

/* ---------- Hero ---------- */
/* Ocupa la pantalla, menos el encabezado. Capas, de atrás hacia adelante:
   cuadrícula de respaldo, malla 3D (canvas, js/hero3d.js), velo para que
   el texto se lea bien y contenido. */
.hero {
  --hero-header: 88px;
  position: relative;
  isolation: isolate;
  display: flex;
  overflow: hidden;
  min-height: max(640px, calc(100vh - var(--hero-header)));
  min-height: max(640px, calc(100svh - var(--hero-header)));
}

.hero__fallback,
.hero__canvas,
.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Respaldo sin WebGL: cuadrícula en perspectiva con un brillo lima */
.hero__fallback {
  z-index: -3;
  overflow: hidden;
  perspective: 560px;
  perspective-origin: 50% 30%;
  transition: opacity 1.2s ease;
}

.hero__fallback::before {
  content: "";
  position: absolute;
  top: 38%;
  left: -50%;
  width: 200%;
  height: 100%;
  background-image:
    linear-gradient(rgba(245, 243, 238, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 243, 238, 0.1) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: rotateX(68deg);
  transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%);
  mask-image: linear-gradient(to bottom, transparent, #000 35%);
}

.hero__fallback::after {
  content: "";
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(1100px, 140vw);
  aspect-ratio: 2.4 / 1;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(212, 255, 63, 0.1), transparent);
}

.hero__canvas {
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--ease-out);
}

.hero.is-3d .hero__canvas {
  opacity: 1;
}

.hero.is-3d .hero__fallback {
  opacity: 0;
}

/* Velo: funde la malla con el encabezado y con la sección siguiente, y
   oscurece el lado izquierdo, donde van el título y el texto */
.hero__scrim {
  z-index: -1;
  background:
    linear-gradient(to bottom, var(--ink) 0%, rgba(11, 11, 12, 0) 26%, rgba(11, 11, 12, 0) 76%, var(--ink) 100%),
    linear-gradient(to right, rgba(11, 11, 12, 0.6) 0%, rgba(11, 11, 12, 0.25) 40%, rgba(11, 11, 12, 0) 62%);
}

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(40px, 5vw, 72px);
  padding-top: clamp(40px, 6vw, 88px);
  padding-bottom: clamp(56px, 6vw, 88px);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Indicación para descubrir el efecto (solo con mouse) */
.hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero__hint-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

@media (hover: none), (max-width: 960px), (prefers-reduced-motion: reduce) {
  .hero__hint {
    display: none;
  }
}

/* Título: se inclina siguiendo al cursor (--tilt-x y --tilt-y los pone
   js/hero3d.js, entre -1 y 1) */
.hero__title {
  font-size: clamp(52px, 9.4vw, 140px);
  line-height: 0.95;
  transform:
    perspective(1600px)
    rotateX(calc(var(--tilt-y, 0) * -3deg))
    rotateY(calc(var(--tilt-x, 0) * -4deg))
    translate3d(calc(var(--tilt-x, 0) * 10px), calc(var(--tilt-y, 0) * -6px), 0);
  transition: transform 0.9s var(--ease-out);
}

.hero__line--indent {
  padding-left: 12%;
}

.hero__word {
  position: relative;
  display: inline-block;
}

/* "Estrategia": la malla se ordena y aparecen guías tipográficas */
.hero__line--guides {
  position: relative;
}

.hero__line--guides::before,
.hero__line--guides::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: max(1px, 0.011em);
  background: var(--accent);
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.8s var(--ease-out);
}

.hero__line--guides::before {
  top: 0.04em;
}

.hero__line--guides::after {
  bottom: 0.02em;
  transition-delay: 0.08s;
}

.hero__title.is-order .hero__line--guides::before,
.hero__title.is-order .hero__line--guides::after {
  transform: scaleX(1);
}

/* "ruido.": la malla se alborota y la palabra hace glitch */
.hero__word--noise::before,
.hero__word--noise::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.hero__word--noise::before {
  color: var(--accent);
}

.hero__word--noise::after {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__title.is-chaos .hero__word--noise {
    animation: glitch-jitter 0.36s steps(1, end) infinite;
  }

  .hero__title.is-chaos .hero__word--noise::before {
    opacity: 1;
    animation: glitch-slice-a 0.9s steps(1, end) infinite;
  }

  .hero__title.is-chaos .hero__word--noise::after {
    opacity: 1;
    animation: glitch-slice-b 0.7s steps(1, end) infinite;
  }
}

@keyframes glitch-slice-a {
  0% { clip-path: inset(8% 0 70% 0); transform: translateX(-0.035em); }
  20% { clip-path: inset(62% 0 12% 0); transform: translateX(0.03em); }
  40% { clip-path: inset(30% 0 48% 0); transform: translateX(-0.02em); }
  60% { clip-path: inset(80% 0 4% 0); transform: translateX(0.04em); }
  80% { clip-path: inset(44% 0 34% 0); transform: translateX(-0.04em); }
  100% { clip-path: inset(16% 0 66% 0); transform: translateX(0.02em); }
}

@keyframes glitch-slice-b {
  0% { clip-path: inset(70% 0 10% 0); transform: translateX(0.04em); }
  25% { clip-path: inset(20% 0 60% 0); transform: translateX(-0.03em); }
  50% { clip-path: inset(50% 0 30% 0); transform: translateX(0.025em); }
  75% { clip-path: inset(6% 0 82% 0); transform: translateX(-0.045em); }
  100% { clip-path: inset(36% 0 44% 0); transform: translateX(0.03em); }
}

@keyframes glitch-jitter {
  0%, 100% { transform: none; }
  33% { transform: translate(0.012em, -0.006em); }
  66% { transform: translate(-0.012em, 0.006em); }
}

.hero__bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 40px;
  align-items: end;
}

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 540px;
}

.hero__badge-wrap {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .hero {
    --hero-header: 84px;
  }
}

/* En celulares la insignia se oculta para que el hero quepa en la
   primera pantalla (Servicios sigue en el menú) */
@media (max-width: 600px) {
  .hero__badge-wrap {
    display: none;
  }
}

/* Insignia giratoria */
.spin-badge {
  position: relative;
  display: block;
  width: 172px;
  height: 172px;
  color: var(--paper);
}

.spin-badge__text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spin-badge__text text {
  fill: currentColor;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.spin-badge__center {
  position: absolute;
  inset: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  transition: transform 0.4s var(--ease-snap);
}

.spin-badge:hover .spin-badge__center {
  transform: rotate(-45deg) scale(1.06);
}

/* ---------- Franja de servicios en movimiento ---------- */
.marquee {
  padding: 28px 0;
  overflow: hidden;
}

.marquee__band {
  width: 106%;
  margin-left: -3%;
  overflow: hidden;
  background: var(--accent);
  color: var(--ink);
  transform: rotate(-2deg);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__group {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 22px 40px 22px 0;
  list-style: none;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.marquee__item::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- Enfoque + órbita animada ---------- */
.approach {
  --split-min: 460px;
  /* Las etiquetas de la órbita giran y salen del borde: se recortan aquí
     para que la página no se desplace de lado (hidden es el respaldo) */
  overflow: hidden;
  overflow: clip;
}

.approach__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.approach__title {
  font-size: clamp(34px, 4.2vw, 64px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: pretty;
}

.approach__title-dim {
  color: var(--muted-2);
}

.approach__text .body-lg {
  max-width: 520px;
}

.orbit {
  position: relative;
  justify-self: center;
  width: min(520px, 100%);
  aspect-ratio: 1 / 1;
}

.orbit__ring {
  position: absolute;
  border: 1px solid rgba(245, 243, 238, 0.14);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}

.orbit__ring--outer {
  inset: 0;
  animation-duration: 38s;
}

.orbit__ring--middle {
  inset: 17%;
  border: 1px dashed rgba(245, 243, 238, 0.22);
  animation-duration: 26s;
  animation-direction: reverse;
}

.orbit__ring--inner {
  inset: 33%;
  border-color: rgba(245, 243, 238, 0.18);
  animation-duration: 18s;
}

/* La etiqueta gira al revés que su anillo para mantenerse derecha */
.orbit__label {
  position: absolute;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(245, 243, 238, 0.16);
  border-radius: var(--radius-pill);
  background: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: counter-spin 30s linear infinite;
  animation-duration: inherit;
  animation-direction: inherit;
}

.orbit__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.orbit__label--top {
  top: 0;
  left: 50%;
}

.orbit__label--left {
  top: 50%;
  left: 0;
}

.orbit__label--bottom {
  top: 100%;
  left: 50%;
}

.orbit__satellite {
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% -50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
}

.orbit__core {
  position: absolute;
  inset: 41%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: 0 0 0 14px rgba(212, 255, 63, 0.08), 0 0 90px rgba(212, 255, 63, 0.28);
}

/* ---------- Lista de servicios ---------- */
.service-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px 32px;
  align-items: center;
  padding: clamp(28px, 3vw, 44px) clamp(12px, 1.6vw, 28px);
  border-bottom: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
}

.service-row__name {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.service-row__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.service-row__title {
  font-size: clamp(38px, 4.6vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.service-row__desc {
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.service-row .icon-circle {
  justify-self: end;
}

/* ---------- Proyectos destacados ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 32px 28px;
  align-items: start;
  list-style: none;
}

@media (min-width: 1200px) {
  .work-grid > :nth-child(even) {
    margin-top: 120px;
  }
}

/* ---------- Proceso ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  list-style: none;
}

.process-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 280px;
  padding: 32px 28px;
  border-radius: var(--radius-md);
}

.process-card__num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}

.process-card__title {
  margin-top: auto;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.process-card__text {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Instagram ---------- */
/* Las publicaciones quedan a la misma altura y sin recortes: cada una ocupa
   un ancho proporcional a su formato (--ratio = ancho / alto de la imagen). */
.insta-feed {
  display: flex;
  gap: 16px;
  list-style: none;
}

.insta-feed__item {
  flex: var(--ratio, 1) 1 0;
  min-width: 0;
}

.insta-post {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ratio, 1);
  border-radius: var(--radius-md);
  background: var(--ink-3);
  color: var(--paper);
  text-decoration: none;
}

.insta-post__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}

.insta-post:hover .insta-post__img,
.insta-post:focus-visible .insta-post__img {
  transform: scale(1.04);
}

/* Aviso "Ver en Instagram": aparece al pasar el mouse o al llegar con el teclado */
.insta-post__view {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
}

.insta-post__view svg {
  color: var(--accent);
}

.insta-post:focus-visible .insta-post__view {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .insta-post:hover .insta-post__view {
    opacity: 1;
    transform: none;
  }
}

/* Celular: una fila que se desliza con el dedo, como en Instagram */
@media (max-width: 699px) {
  .insta-feed {
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .insta-feed::-webkit-scrollbar {
    display: none;
  }

  .insta-feed__item {
    flex: 0 0 auto;
    width: calc(min(78vw, 360px) * var(--ratio, 1));
    scroll-snap-align: start;
  }
}
