/* ==========================================================================
   DANIEL ZAMBRANO (@danielz.effects) - VFX PORTFOLIO
   Design System & Master Stylesheet
   Palette "IA": #07070B, #EDEDF2, #7B5CFF -> #00E5FF -> #FF3DDB
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Theme & Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg-primary: #07070B;
  --bg-surface: #0E0E16;
  --bg-surface-elevated: #151520;
  --bg-glass: rgba(14, 14, 22, 0.75);
  
  --text-primary: #EDEDF2;
  --text-secondary: #9B9BAA;
  --text-muted: #565668;
  
  /* Gradient IA */
  --color-violet: #7B5CFF;
  --color-cyan: #00E5FF;
  --color-magenta: #FF3DDB;
  
  --gradient-ai: linear-gradient(135deg, var(--color-violet) 0%, var(--color-cyan) 50%, var(--color-magenta) 100%);
  --gradient-ai-h: linear-gradient(90deg, var(--color-violet) 0%, var(--color-cyan) 50%, var(--color-magenta) 100%);
  --gradient-ai-soft: linear-gradient(135deg, rgba(123, 92, 255, 0.15) 0%, rgba(0, 229, 255, 0.15) 50%, rgba(255, 61, 219, 0.15) 100%);
  
  /* Subtle Glows (40% opacity) */
  --glow-violet: 0 0 24px rgba(123, 92, 255, 0.4);
  --glow-cyan: 0 0 24px rgba(0, 229, 255, 0.4);
  --glow-magenta: 0 0 24px rgba(255, 61, 219, 0.4);
  --glow-accent: 0 0 30px rgba(123, 92, 255, 0.35), 0 0 50px rgba(0, 229, 255, 0.25);
  --glow-text: 0 0 20px rgba(0, 229, 255, 0.4), 0 0 35px rgba(255, 61, 219, 0.3);

  /* Borders & Dividers */
  --border-subtle: rgba(237, 237, 242, 0.08);
  --border-active: rgba(0, 229, 255, 0.35);

  /* Typography */
  --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Space Grotesk', monospace;

  /* Layout & Spacing */
  --container-max-w: 1400px;
  --header-height: 80px;
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  scroll-behavior: auto; /* Handled smoothly by Lenis */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: clip; /* clip (not hidden) so position: sticky keeps working */
  position: relative;
  line-height: 1.5;
}

body.menu-open {
  overflow: hidden;
}

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

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

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* Monospace Micro-labels */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Pulsing AI Dot */
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan);
  animation: pulseAiDot 2s infinite ease-in-out;
}

@keyframes pulseAiDot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 8px var(--color-cyan);
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    box-shadow: 0 0 16px var(--color-magenta), 0 0 24px var(--color-cyan);
  }
}

/* Gradient Text Utility */
.gradient-text {
  background: var(--gradient-ai-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   3. Film Noise / Grain Filter (CSS Noise)
   -------------------------------------------------------------------------- */
.noise-svg-filter {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
}

.film-grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.038;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. Preloader Sequence (Stage 1 -> Stage 2 -> Stage 3)
   -------------------------------------------------------------------------- */
.preloader-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: opacity 0.5s var(--transition-smooth), visibility 0.5s ease;
}

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

.preloader-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 90%;
  max-width: 600px;
}

/* Stage 1: Big Counter & Bar */
.preloader-stage-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.preloader-stage-counter.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.preloader-number {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 30px rgba(123, 92, 255, 0.2);
}

.preloader-bar-wrap {
  width: min(320px, 80vw);
  height: 3px;
  background: rgba(237, 237, 242, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
}

.preloader-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--gradient-ai-h);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.6);
}

.preloader-tech-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Stage 2 & 3: Scramble Name (resolves to DANIEL ZAMBRANO) */
.preloader-stage-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.preloader-stage-name.is-active {
  opacity: 1;
  pointer-events: auto;
}

.preloader-scramble-text {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
  min-height: 1.2em;
  display: inline-block;
  will-change: transform, opacity;
}

.preloader-role-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--color-cyan);
  text-transform: uppercase;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preloader-role-tag.visible {
  opacity: 0.9;
}

/* Letter Scramble Glow & Flash States */
.char-resolved {
  display: inline-block;
  color: var(--text-primary);
  white-space: pre;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.char-resolved.flash {
  animation: letterGlowFlash 0.35s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes letterGlowFlash {
  0% {
    color: #FFFFFF;
    text-shadow: 0 0 20px var(--color-cyan), 0 0 35px var(--color-magenta);
    transform: translateY(-2px);
  }
  50% {
    color: var(--color-cyan);
    text-shadow: 0 0 15px var(--color-violet), 0 0 25px var(--color-magenta);
  }
  100% {
    color: var(--text-primary);
    text-shadow: none;
    transform: translateY(0);
  }
}

.char-glitch {
  display: inline-block;
  color: var(--color-cyan);
  opacity: 0.85;
  font-family: var(--font-mono);
  white-space: pre;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.char-idle {
  display: inline-block;
  white-space: pre;
  color: rgba(237, 237, 242, 0.2);
}

.char-word {
  display: inline-block;
  white-space: nowrap;
}

.char-space {
  display: inline-block;
  width: 0.32em;
  white-space: pre;
}

/* Skip Intro Button */
.skip-intro-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: rgba(14, 14, 22, 0.65);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.725rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: all 0.25s var(--transition-fast);
}

.skip-intro-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: rgba(20, 20, 32, 0.85);
  box-shadow: 0 0 20px rgba(123, 92, 255, 0.3);
  transform: translateY(-1px);
}

.skip-intro-btn .skip-arrow {
  transition: transform 0.2s ease;
}

.skip-intro-btn:hover .skip-arrow {
  transform: translateX(3px);
  color: var(--color-cyan);
}

/* --------------------------------------------------------------------------
   5. Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  pointer-events: none; /* Children enable pointer-events */
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(7, 7, 11, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand Logo (Top-Left) */
.brand-logo {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  opacity: 0; /* Revealed when preloader FLIP finishes */
  transition: opacity 0.3s ease;
  user-select: none;
}

.brand-logo.is-visible {
  opacity: 1;
}

/* Brand signature (marca/kit): visor icon + name, same as the logo */
.brand-logo {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: transform 0.4s var(--transition-smooth);
}

.brand-logo:hover .brand-icon {
  transform: scale(1.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .brand-name {
  font-family: 'Anton', var(--font-main);
  font-weight: 400;
  letter-spacing: 0.04em;
}

@media (max-width: 479px) {
  .brand-icon {
    width: 34px;
    height: 34px;
  }
}

.brand-name {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.1;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.brand-logo:hover .brand-name {
  color: #FFFFFF;
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.brand-handle {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Menu Toggle Button (Top-Right) */
.menu-toggle-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: rgba(14, 14, 22, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  transition: all 0.3s var(--transition-fast);
}

.menu-toggle-btn:hover {
  border-color: var(--border-active);
  background: rgba(20, 20, 32, 0.85);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
  transform: translateY(-1px);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 12px;
}

.menu-icon .line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.menu-toggle-btn:hover .menu-icon .line {
  background: var(--color-cyan);
}

/* --------------------------------------------------------------------------
   6. Fullscreen Menu Panel
   -------------------------------------------------------------------------- */
.menu-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--transition-smooth), visibility 0.4s ease;
}

.menu-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-panel-bg {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 11, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.menu-panel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: calc(var(--header-height) + 1rem) 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.menu-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.menu-close-btn:hover {
  border-color: var(--color-magenta);
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(255, 61, 219, 0.35);
  transform: rotate(90deg scale(1.05));
}

.menu-panel-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .menu-panel-content {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
  }
}

/* Nav Column */
.menu-nav-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.menu-nav-heading {
  margin-bottom: 1.5rem;
  color: var(--color-cyan);
}

.menu-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.menu-nav-item {
  overflow: hidden;
}

.menu-nav-link {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(237, 237, 242, 0.06);
  transition: transform 0.3s var(--transition-smooth), border-color 0.3s ease;
}

.menu-nav-link:hover {
  transform: translateX(8px);
  border-color: var(--border-active);
}

.menu-nav-link .nav-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-violet);
  margin-bottom: 0.2rem;
}

.menu-nav-link .nav-text {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.25s ease;
}

.menu-nav-link:hover .nav-text {
  background: var(--gradient-ai-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-nav-link .nav-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  transition: color 0.25s ease;
}

.menu-nav-link:hover .nav-desc {
  color: var(--text-primary);
}

/* Socials inside Menu */
.menu-socials {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(237, 237, 242, 0.08);
}

.social-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.social-chip span {
  color: var(--color-cyan);
  font-weight: 700;
}

.social-chip:hover {
  color: var(--text-primary);
  border-color: var(--color-violet);
  background: rgba(123, 92, 255, 0.15);
  box-shadow: 0 0 15px rgba(123, 92, 255, 0.25);
  transform: translateY(-2px);
}

/* Right Video Grid (Desktop only / compact on mobile) */
.menu-video-col {
  display: none;
}

@media (min-width: 1024px) {
  .menu-video-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

.menu-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(237, 237, 242, 0.08);
}

.live-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
}

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

.menu-video-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.35s var(--transition-smooth);
}

.menu-video-card:hover,
.menu-video-card.is-highlighted {
  border-color: var(--border-active);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.25);
  transform: translateY(-3px) scale(1.02);
}

.card-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.menu-video-card:hover .card-video {
  transform: scale(1.08);
}

.card-glow-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7, 7, 11, 0.9) 100%);
  pointer-events: none;
}

.card-meta {
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  color: var(--text-primary);
  letter-spacing: 0.06em;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  color: var(--color-magenta);
}

/* --------------------------------------------------------------------------
   7. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--header-height) 1.5rem 4rem;
}

/* Background Video & Parallax Wrapper */
.hero-media-wrapper {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.1);
  transform: scale(1.02);
  will-change: transform;
}

/* Dark Overlay 70% with Radial Depth */
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Light touch: the video is the protagonist; only edges are darkened for legibility */
  background:
    linear-gradient(180deg, rgba(7, 7, 11, 0.55) 0%, rgba(7, 7, 11, 0) 22%, rgba(7, 7, 11, 0) 60%, rgba(7, 7, 11, 0.9) 100%),
    radial-gradient(ellipse at center, rgba(7, 7, 11, 0.25) 0%, rgba(7, 7, 11, 0.45) 100%);
}

/* Hero Center Content */
.hero-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 950px;
}

/* Top Tag Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  background: rgba(14, 14, 22, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: fadeInDown 0.8s ease backwards;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan);
}

.hero-badge .badge-text {
  font-size: 0.725rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
}

/* Center Headline (Rotates every 3s with Scramble) */
.headline-container {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .headline-container {
    min-height: 160px;
  }
}

.hero-headline {
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
  word-spacing: normal;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.55));
}

.headline-text {
  display: inline-block;
  word-spacing: normal;
  will-change: transform, opacity;
}

/* Subtitle */
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 400;
  line-height: 1.5;
  color: #C6C6D4;
  max-width: 620px;
  margin-bottom: 2.75rem;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* CTA Button with Animated Gradient Border */
.hero-cta-wrapper {
  position: relative;
  display: inline-flex;
}

.cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px; /* Holds the animated gradient border */
  border-radius: 999px;
  overflow: hidden;
  transition: transform 0.3s var(--transition-smooth), box-shadow 0.3s ease;
  user-select: none;
}

/* Glowing Ambient Aura Behind Button */
.cta-glow-bg {
  position: absolute;
  inset: -10px;
  background: var(--gradient-ai);
  filter: blur(20px);
  opacity: 0.35;
  border-radius: 999px;
  transition: opacity 0.3s ease, filter 0.3s ease;
  pointer-events: none;
}

/* Rotating Gradient Border */
.cta-border {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    var(--color-violet),
    var(--color-cyan),
    var(--color-magenta),
    var(--color-violet)
  );
  animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cta-content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 2.25rem;
  background: #0E0E16;
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background-color 0.25s ease;
}

.cta-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--transition-smooth);
  color: var(--color-cyan);
}

.cta-arrow svg {
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

/* CTA Hover States */
.cta-button:hover {
  transform: scale(1.04);
  box-shadow: 0 0 35px rgba(123, 92, 255, 0.4), 0 0 50px rgba(0, 229, 255, 0.3);
}

.cta-button:hover .cta-glow-bg {
  opacity: 0.65;
  filter: blur(28px);
}

.cta-button:hover .cta-content {
  background: #141420;
}

.cta-button:hover .cta-arrow svg {
  transform: rotate(45deg) translate(2px, -2px);
  color: var(--color-magenta);
}

/* Bottom Center Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-scroll-indicator:hover {
  color: var(--color-cyan);
  transform: translateX(-50%) translateY(3px);
}

.scroll-mouse {
  width: 20px;
  height: 32px;
  border: 1.5px solid rgba(237, 237, 242, 0.35);
  border-radius: 12px;
  position: relative;
  display: flex;
  justify-content: center;
}

.scroll-wheel {
  width: 3px;
  height: 6px;
  background: var(--color-cyan);
  border-radius: 999px;
  position: absolute;
  top: 6px;
  box-shadow: 0 0 8px var(--color-cyan);
  animation: scrollWheelPulse 2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollWheelPulse {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    transform: translateY(12px);
    opacity: 0.2;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.scroll-text {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}

/* --------------------------------------------------------------------------
   8. Section Showcase: Efectos (One-page content & scroll target)
   -------------------------------------------------------------------------- */
.section-showcase {
  position: relative;
  z-index: 20;
  background: var(--bg-primary);
  padding: 7rem 1.5rem 6rem;
  border-top: 1px solid var(--border-subtle);
}

.section-container {
  max-width: var(--container-max-w);
  margin: 0 auto;
}

.section-header {
  max-width: 800px;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--color-cyan);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Filter Bar */
.vfx-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 3.5rem;
}

.filter-pill {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}

.filter-pill:hover,
.filter-pill.active {
  color: var(--text-primary);
  background: rgba(123, 92, 255, 0.15);
  border-color: var(--border-active);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* VFX Grid */
/* Justified rows (Google Photos style): every row has the same height and
   each clip takes the width its aspect ratio (--ar on the card) asks for,
   so vertical and horizontal clips pack edge to edge ~5 per row */
.vfx-grid {
  --row-h: 140px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.vfx-grid > .vfx-card {
  flex: calc(var(--ar, 1) * 100) 1 calc(var(--ar, 1) * var(--row-h));
  min-width: 0;
}

/* No filler: the last row stretches edge to edge too, so there is no empty gap */

@media (min-width: 640px) {
  .vfx-grid {
    --row-h: 170px;
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .vfx-grid {
    --row-h: 195px;
  }
}

@media (min-width: 1400px) {
  .vfx-grid {
    --row-h: 225px;
  }
}

.vfx-card {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .vfx-grid {
    columns: 2;
  }
}

@media (min-width: 1024px) {
  .vfx-grid {
    columns: 3;
  }
}

.vfx-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.35s var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.vfx-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(123, 92, 255, 0.2);
  transform: translateY(-5px);
}

.vfx-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.vfx-grid .vfx-card-media { aspect-ratio: var(--ar, 1); }
.vfx-card-media.is-wide     { aspect-ratio: 16 / 9; }
.vfx-card-media.is-tall     { aspect-ratio: 9 / 16; }
.vfx-card-media.is-square   { aspect-ratio: 1 / 1; }
.vfx-card-media.is-portrait { aspect-ratio: 3 / 4; }

.vfx-card-media .card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition-smooth);
}

.vfx-card:hover .vfx-card-media .card-video {
  transform: scale(1.06);
}

.vfx-badge-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.75rem;
  background: rgba(7, 7, 11, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--color-cyan);
}

.vfx-card-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vfx-card-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.vfx-card-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.vfx-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-tag {
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8b. Section: Arquitecturas & Herramientas (#arquitecturas)
   -------------------------------------------------------------------------- */
.section-architectures {
  background: #08080E;
}

.arch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .arch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .arch-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.arch-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.35s var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.arch-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 229, 255, 0.2);
}

.arch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.arch-icon {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.arch-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.arch-card-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.arch-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.arch-pill {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(123, 92, 255, 0.12);
  border: 1px solid rgba(123, 92, 255, 0.25);
  color: #CFC5FF;
}

/* Pipeline Flowchart Banner */
.pipeline-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
}

.pipeline-banner-header {
  margin-bottom: 1.75rem;
}

.pipeline-banner-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  position: relative;
}

@media (min-width: 768px) {
  .pipeline-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.pipeline-step {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
  margin-bottom: 0.4rem;
}

.step-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.step-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   8c. Section: Biografía (#biografia)
   -------------------------------------------------------------------------- */
.section-biography {
  background: var(--bg-primary);
}

.bio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

.bio-grid > * {
  min-width: 0; /* Prevent long stat labels from pushing the card off-screen on mobile */
}

@media (max-width: 479px) {
  .bio-card-profile {
    padding: 1.75rem 1.25rem;
  }

  .stat-label {
    font-size: 0.58rem;
  }
}

@media (min-width: 1024px) {
  .bio-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3.5rem;
  }
}

.bio-card-profile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.bio-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.bio-title-wrap h3 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.bio-title-wrap .mono-label {
  color: var(--color-cyan);
}

.bio-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.bio-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--gradient-ai-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

.bio-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 999px;
  font-size: 0.775rem;
  color: #B5F5FF;
}

.bio-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bio-quote {
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-cyan);
  text-wrap: balance;
}

.bio-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   8d. Section: Colaboraciones (#colaboraciones)
   -------------------------------------------------------------------------- */
.section-collaborations {
  background: #06060A;
}

.collab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .collab-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .collab-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.social-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.35s var(--transition-smooth);
}

.social-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(123, 92, 255, 0.25);
}

.social-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.social-platform-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.social-card.is-ig .social-platform-badge {
  border-color: rgba(225, 48, 108, 0.4);
  background: rgba(225, 48, 108, 0.12);
  color: #FFA5C9;
}

.social-card.is-tt .social-platform-badge {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.12);
  color: #8CFCFF;
}

.social-card.is-yt .social-platform-badge {
  border-color: rgba(255, 0, 0, 0.4);
  background: rgba(255, 0, 0, 0.12);
  color: #FFA5A5;
}

.social-card.is-fb .social-platform-badge {
  border-color: rgba(24, 119, 242, 0.4);
  background: rgba(24, 119, 242, 0.12);
  color: #A0C6FF;
}

.social-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.social-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
  flex: 1;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.social-card:hover .social-btn {
  background: var(--gradient-ai-soft);
  border-color: var(--border-active);
  color: #FFFFFF;
}

/* Quick Inquiry Card */
.inquiry-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.inquiry-banner h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.inquiry-banner p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2rem;
}

.inquiry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #040407;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1.5rem;
}

.footer-container {
  max-width: var(--container-max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    text-align: left;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. Accessibility & prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .film-grain-overlay {
    display: none;
  }
  
  .hero-video {
    transform: none !important;
  }
  
  .cta-border {
    animation: none;
  }
}
