/* ── Floor Counter (building floors) ───────────────────── */
.floor-counter {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floor-counter__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--aa-black);
  opacity: 0.18;
  transition:
    opacity 400ms var(--aa-ease),
    color 400ms var(--aa-ease);
}

.floor-counter__item.is-active {
  opacity: 1;
  color: var(--aa-gold);
}

.floor-counter__tick {
  width: 8px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
  transition: width 300ms var(--aa-ease);
}

.floor-counter__item.is-active .floor-counter__tick {
  width: 18px;
}

.floor-counter__num {
  font-family: var(--aa-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: inherit;
  line-height: 1;
}

/* Dark mode when over firma section */
.floor-counter--dark .floor-counter__item {
  color: var(--aa-white);
}

.floor-counter--dark .floor-counter__item.is-active {
  color: var(--aa-gold);
}

@media (max-width: 1100px) {
  .floor-counter { display: none; }
}

/* ── Capa 1: clip-path wipe for protocol items ──────────── */
/* Reveals bottom-to-top — like floors being laid on a building */
.protocol__item {
  opacity: 1 !important;
  transform: none !important;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.protocol__item.is-visible {
  clip-path: inset(0% 0 0 0);
}

/* ── Capa 2: SVG structural line (ecosystems) ───────────── */
.eco-struct-line {
  display: block;
  width: 100%;
  height: 2px;
  margin-bottom: var(--aa-space-3);
  overflow: visible;
}

.eco-struct-line line {
  stroke: var(--aa-black);
  stroke-width: 1;
  opacity: 0.3;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.eco-struct-line.is-drawn line {
  stroke-dashoffset: 0;
}

/* ── Eco-card build (clip-path upward reveal) ───────────── */
.eco-card.anim-fade-up {
  opacity: 1 !important;
  transform: none !important;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 700ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.eco-card.anim-fade-up.is-visible {
  clip-path: inset(0% 0 0 0);
}

/* ── Protocol engineering grid background ───────────────── */
.protocol {
  position: relative;
}

.protocol::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.protocol__inner {
  position: relative;
  z-index: 1;
}

/* ── Firma word-by-word reveal ──────────────────────────── */
.firma__text {
  opacity: 1 !important;
  transition: none !important;
}

.firma__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 320ms var(--aa-ease),
    transform 320ms var(--aa-ease);
}

.firma__word.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero glitch (demolicion) ───────────────────────────── */
@keyframes aa-demolicion {
  0%   { opacity: 1;   transform: skewX(0deg); }
  8%   { opacity: 0.7; transform: skewX(-1deg) translateX(-3px); }
  16%  { opacity: 1;   transform: skewX(0.5deg) translateX(2px); }
  24%  { opacity: 0.8; transform: skewX(-0.5deg); }
  32%  { opacity: 1;   transform: skewX(0deg); }
  100% { opacity: 1;   transform: skewX(0deg); }
}

.hero--demolicion {
  animation: aa-demolicion 0.5s steps(2) 1;
}

/* ── Phase 4: gold firma location pulse ─────────────────── */
[data-phase="4"] .firma__location {
  animation: goldAppear 1.2s var(--aa-ease) forwards;
}

@keyframes goldAppear {
  from { color: var(--aa-white); opacity: 0.6; }
  to   { color: var(--aa-gold);  opacity: 0.9; }
}

/* ── Letter scramble (nav hover effect) ──────────────────── */
.nav__menu a { position: relative; }

/* ── Noise grain overlay (very subtle) ───────────────────── */
.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}
