/* ============================================================
   CYBERPUNK PORTFOLIO – styles.css
   Centered composition + wider content + smooth section motion
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Inter:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --bg: #05080d;
  --text: #dce8ff;
  --text-soft: #8ea7d2;
  --text-muted: #415474;
  --heading: #ffffff;

  --cyan: #00e5ff;
  --mint: #00ff9d;
  --violet: #b84fff;
  --pink: #ff2d6e;

  --glow-c: 0 0 14px rgba(0, 229, 255, 0.55), 0 0 50px rgba(0, 229, 255, 0.15);
  --glow-v: 0 0 14px rgba(184, 79, 255, 0.5), 0 0 50px rgba(184, 79, 255, 0.12);

  --r-lg: 26px;
  --r-pill: 999px;

  --dur-flip: 1.34s;
  --ease-flip: cubic-bezier(0.16, 0.84, 0.22, 1);
  --dur-fast: 240ms;

  --header-h: 68px;
  --container: 1480px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

/* ============================================================
   GLOBAL CRT OVERLAY
   ============================================================ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  will-change: opacity;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.07) 0px,
    rgba(0, 0, 0, 0.07) 1px,
    transparent 1px,
    transparent 4px
  );
  animation: crtFlicker 12s ease-in-out infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: noiseShift 0.5s steps(1) infinite;
}

/* ============================================================
   CYBERPUNK LOADER & TV OFF EFFECT
   ============================================================ */

#cyber-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #02040a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

/* ============================================================
   ESTÁTICA DE TELEVISIÓN (Ruido)
   ============================================================ */

/* Ocultar el texto/barra cuando sale la estática */
.hide-content .loader-content {
  display: none;
}

/* La clase que muestra el ruido suave */
.show-static {
  background-color: #737373 !important;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") !important;
  background-size: 180px 180px;
  animation: noiseShift 0.12s steps(1) infinite;
  filter: contrast(220%) brightness(125%) grayscale(1);
}

/* Al apagar la tele, combinamos ruido + shrink */
.show-static.tv-turn-off {
  animation: noiseShift 0.12s steps(1) infinite, tvOff 0.6s cubic-bezier(0.8, 0, 0.2, 1) forwards !important;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: min(300px, calc(100vw - 40px));
  text-align: center;
}

.loader-glitch {
  position: relative;
  font-family: "Share Tech Mono", monospace;
  font-size: 2rem;
  color: var(--mint);
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.6);
  animation: glitchText 2s infinite;
}

.loader-glitch::before,
.loader-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.loader-glitch::before {
  color: var(--pink);
  transform: translateX(1px);
  clip-path: inset(0 0 45% 0);
  animation: loaderGlitchBefore 1.8s steps(1) infinite;
}

.loader-glitch::after {
  color: var(--cyan);
  transform: translateX(-1px);
  clip-path: inset(55% 0 0 0);
  animation: loaderGlitchAfter 1.8s steps(1) infinite;
}

.loader-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--cyan);
  position: relative;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan);
  animation: loadProgress 2.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

.loader-status {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: blinkText 1s infinite;
}

.tv-turn-off {
  animation: tvOff 0.6s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

/* Cuando ambas clases están presentes, la regla de .show-static.tv-turn-off toma prioridad */

/* ============================================================
   ACCESSIBILITY / NAV
   ============================================================ */

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  padding: 10px 18px;
  background: var(--cyan);
  color: #010810;
  border-radius: var(--r-pill);
  z-index: 10001;
  font-weight: 700;
  transition: top 200ms ease;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 500;
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  background: rgba(5, 8, 13, 0.72);
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  display: flex;
  align-items: center;
}

.nav {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #010a13;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: var(--glow-c);
  animation: brandPulse 4s ease-in-out infinite;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--heading);
}

.brand-role {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition:
    color var(--dur-fast),
    border-color var(--dur-fast),
    background var(--dur-fast),
    box-shadow var(--dur-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
  border-color: rgba(0, 229, 255, 0.25);
  background: rgba(0, 229, 255, 0.07);
  box-shadow: var(--glow-c);
}

/* ============================================================
   SCROLL SNAP ROOT
   ============================================================ */

.snap-root {
  height: 100dvh;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  scroll-behavior: smooth;
}

.snap-root::-webkit-scrollbar {
  display: none;
}

.snap-root::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 78%);
}

/* ============================================================
   PAGES
   ============================================================ */

.snap-page {
  min-height: 100dvh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  perspective: 1600px;
  perspective-origin: 50% 50%;
}

.snap-page--home::before,
.snap-page--about::before,
.snap-page--projects::before,
.snap-page--contact::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.snap-page--home::before {
  background:
    radial-gradient(ellipse 55% 45% at 10% 30%, rgba(0, 229, 255, 0.12), transparent),
    radial-gradient(ellipse 45% 40% at 90% 20%, rgba(184, 79, 255, 0.14), transparent),
    radial-gradient(ellipse 40% 50% at 70% 88%, rgba(0, 255, 157, 0.08), transparent);
  animation: bgBreath 9s ease-in-out infinite alternate;
}

.snap-page--about::before {
  background:
    radial-gradient(ellipse 50% 60% at 80% 40%, rgba(0, 229, 255, 0.08), transparent),
    radial-gradient(ellipse 40% 40% at 15% 70%, rgba(184, 79, 255, 0.09), transparent);
}

.snap-page--projects::before {
  background:
    radial-gradient(ellipse 55% 50% at 5% 20%, rgba(184, 79, 255, 0.1), transparent),
    radial-gradient(ellipse 45% 45% at 90% 70%, rgba(0, 229, 255, 0.09), transparent);
}

.snap-page--contact::before {
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0, 255, 157, 0.07), transparent),
    radial-gradient(ellipse 40% 40% at 90% 20%, rgba(0, 229, 255, 0.08), transparent);
}

.snap-page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 229, 255, 0.3),
    rgba(184, 79, 255, 0.3),
    transparent
  );
  opacity: 0.5;
}

.container {
  width: min(var(--container), calc(100% - 72px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.page-content {
  width: 100%;
  height: 100dvh;
  padding-top: var(--header-h);
  padding-bottom: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  will-change: transform, opacity, filter;
}

.page-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ============================================================
   ALTERNATING SECTION TRANSITIONS (3 Effects)
   ============================================================ */

/* Transición base compartida (Estado VISIBLE) */
.snap-page .page-content {
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

.snap-page.is-visible .page-content {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(0, 0) scale(1) skew(0, 0) !important;
  filter: blur(0) brightness(1) contrast(1) sepia(0) hue-rotate(0) !important;
  
  transition:
    opacity 600ms ease-out 200ms,
    transform 700ms cubic-bezier(0.16, 0.84, 0.22, 1) 200ms,
    filter 600ms ease-out 200ms;
}

/* EFECTO 1: Digital Swipe (Secciones 1 y 4) - Estado OCULTO */
.snap-page:nth-child(3n+1) .page-content {
  opacity: 0;
  transform: translateX(-60px) skewX(8deg);
  filter: blur(6px) brightness(1.8) contrast(2);
  transition:
    opacity 150ms ease-in,
    transform 200ms cubic-bezier(0.4, 0, 1, 1),
    filter 150ms ease-in;
}

/* EFECTO 2: Data Drop (Secciones 2 y 5) - Estado OCULTO */
.snap-page:nth-child(3n+2) .page-content {
  opacity: 0;
  transform: translateY(-80px) scale(0.95);
  filter: blur(8px) sepia(1) hue-rotate(140deg);
  transition:
    opacity 150ms ease-in,
    transform 200ms cubic-bezier(0.4, 0, 1, 1),
    filter 150ms ease-in;
}

/* EFECTO 3: System Breach (Sección 3) - Estado OCULTO */
.snap-page:nth-child(3n+3) .page-content {
  opacity: 0;
  transform: translateY(60px) skewY(-4deg);
  filter: blur(4px) brightness(2.5) contrast(3);
  transition:
    opacity 150ms ease-in,
    transform 200ms cubic-bezier(0.4, 0, 1, 1),
    filter 150ms ease-in;
}

.snap-page.is-visible .page-content {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(0, 0) scale(1) !important;
  filter: blur(0) brightness(1) contrast(1) !important;
  transition:
    opacity 600ms ease-out 200ms,
    transform 700ms cubic-bezier(0.16, 0.84, 0.22, 1) 200ms,
    filter 600ms ease-out 200ms;
}

/* ============================================================
   INNER CASCADE ANIMATION
   ============================================================ */

.snap-page .page-content .eyebrow,
.snap-page .page-content .section-label,
.snap-page .page-content h1,
.snap-page .page-content h2,
.snap-page .page-content .hero-description,
.snap-page .page-content .hero-name,
.snap-page .page-content .section-lead,
.snap-page .page-content .section-copy,
.snap-page .page-content .projects-list,
.snap-page .page-content .hero-actions {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 400ms cubic-bezier(0.16, 0.84, 0.22, 1),
    transform 400ms cubic-bezier(0.16, 0.84, 0.22, 1);
  will-change: opacity, transform;
}

.snap-page.is-visible .page-content .eyebrow,
.snap-page.is-visible .page-content .section-label {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 140ms;
}

.snap-page.is-visible .page-content h1,
.snap-page.is-visible .page-content h2 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 220ms;
}

.snap-page.is-visible .page-content .hero-description,
.snap-page.is-visible .page-content .section-lead {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 320ms;
}

.snap-page.is-visible .page-content .hero-name,
.snap-page.is-visible .page-content .section-copy {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 420ms;
}

.snap-page.is-visible .page-content .projects-list,
.snap-page.is-visible .page-content .hero-actions {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 520ms;
}

.snap-page.is-visible h1 .glitch-wrap,
.snap-page.is-visible h2 .glitch-wrap {
  animation: signalGlitch 2.1s ease-out forwards;
}

.glitch-wrap {
  position: relative;
  display: inline;
}

.glitch-wrap::before,
.glitch-wrap::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  opacity: 0;
  pointer-events: none;
}

.snap-page.is-visible h1 .glitch-wrap::before,
.snap-page.is-visible h2 .glitch-wrap::before {
  color: var(--pink);
  animation: glitchSlice1 2.1s steps(1) forwards;
}

.snap-page.is-visible h1 .glitch-wrap::after,
.snap-page.is-visible h2 .glitch-wrap::after {
  color: var(--cyan);
  animation: glitchSlice2 2.1s steps(1) forwards;
}

.page-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cyan),
    var(--violet),
    var(--mint),
    transparent
  );
  box-shadow: 0 0 18px var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}

.snap-page.is-visible .page-scan {
  animation: scanLine 1.45s ease-out 0.24s forwards;
}

.page-number {
  position: absolute;
  bottom: 24px;
  right: 24px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  opacity: 0.6;
  z-index: 10;
}

/* ============================================================
   TYPOGRAPHY / SECTIONS
   ============================================================ */

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(0, 229, 255, 0.22);
  background: rgba(0, 229, 255, 0.07);
  color: var(--cyan);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

.hero {
  min-height: calc(100dvh - var(--header-h) - 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero--home {
  width: min(1200px, 100%);
  margin-inline: auto;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero h1 {
  margin: 22px 0 22px;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(5.8rem, 14vw, 11.5rem);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.08em;
  color: var(--heading);
  max-width: 6.2ch;
  margin-inline: auto;
}

.hero h1 .line {
  display: block;
}

.hero h1 .accent {
  display: block;
  background: linear-gradient(135deg, var(--mint) 0%, var(--cyan) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(0, 229, 255, 0.35));
  animation: gradientShift 6s ease-in-out infinite alternate;
}

.hero-description {
  margin: 0 0 22px;
  max-width: 32ch;
  color: var(--text-soft);
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.55;
  margin-inline: auto;
}

.hero-name {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.24rem, 2.1vw, 1.9rem);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.05em;
  text-align: center;
}

.section-free {
  min-height: calc(100dvh - var(--header-h) - 36px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: min(1480px, 100%);
  max-width: none;
  margin-inline: auto;
  padding-top: clamp(120px, 16vh, 180px);
  transform: none;
}

.section-free h2 {
  margin: 22px 0 22px;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(4.4rem, 9.5vw, 7.6rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.06em;
  color: var(--heading);
  max-width: 10ch;
}

.section-lead {
  max-width: 46ch;
  color: var(--text);
  font-size: clamp(1.45rem, 1.95vw, 2.05rem);
  line-height: 1.58;
}

.section-copy {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--text-soft);
  font-size: clamp(1.18rem, 1.4vw, 1.5rem);
  line-height: 1.68;
}

.section-free--pulse {
  width: min(1600px, 100%);
  padding-top: clamp(72px, 10vh, 116px);
}

.section-free--pulse .section-lead,
.section-free--pulse .section-copy {
  max-width: 54ch;
}

.section-free--pulse .hero-actions {
  margin-top: 38px;
}

.projects-list {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-line {
  display: inline-block;
  width: fit-content;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.18);
  transition: transform var(--dur-fast), text-shadow var(--dur-fast), color var(--dur-fast);
}

.project-line:hover {
  transform: translateX(8px);
  color: var(--mint);
  text-shadow: 0 0 22px rgba(0, 255, 157, 0.4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

/* ============================================================
   BUTTONS / LINKS
   ============================================================ */

.btn {
  min-height: 54px;
  padding: 0 28px;
  border-radius: var(--r-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    transform var(--dur-fast),
    box-shadow var(--dur-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-120%) skewX(-18deg);
  transition: transform 450ms ease;
}

.btn:hover::before {
  transform: translateX(120%) skewX(-18deg);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.btn-primary {
  color: #010810;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  box-shadow: var(--glow-c);
}

.btn-primary:hover {
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.75), 0 0 80px rgba(0, 229, 255, 0.2);
}

.contact-link {
  color: var(--cyan);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: inherit;
  letter-spacing: 0.02em;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  transition: color var(--dur-fast), text-shadow var(--dur-fast);
}

.contact-link:hover {
  color: var(--mint);
  text-shadow: 0 0 28px rgba(0, 255, 157, 0.6);
}

/* Button text lock */
.cta-btn,
.cta-btn:visited,
.cta-btn:hover,
.cta-btn:active,
.cta-btn:focus,
.cta-btn * {
  color: #010810 !important;
  -webkit-text-fill-color: #010810 !important;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes crtFlicker {
  0%, 94%, 100% { opacity: 1; }
  94.5% { opacity: 0.85; }
  95% { opacity: 1; }
  95.5% { opacity: 0.75; }
  96% { opacity: 1; }
  96.5% { opacity: 0.9; }
  97% { opacity: 1; }
}

@keyframes noiseShift {
  0% { background-position: 0% 0%; }
  25% { background-position: 80% 30%; }
  50% { background-position: 40% 70%; }
  75% { background-position: 20% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes brandPulse {
  0%, 100% { box-shadow: var(--glow-c); }
  50% { box-shadow: var(--glow-v); }
}

@keyframes bgBreath {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.75; transform: scale(1.05); }
}

@keyframes gradientShift {
  0% { filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.35)); }
  50% { filter: drop-shadow(0 0 28px rgba(184, 79, 255, 0.45)); }
  100% { filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.4)); }
}

@keyframes scanLine {
  0% { transform: scaleX(0); opacity: 1; }
  65% { transform: scaleX(1); opacity: 1; }
  85% { transform: scaleX(1); opacity: 0.55; }
  100% { transform: scaleX(1); opacity: 0; }
}

@keyframes signalGlitch {
  0% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  4% { opacity: 1; transform: translateX(4px); clip-path: inset(0); }
  8% { clip-path: inset(25% 0 45% 0); transform: translateX(-5px) skewX(1.5deg); opacity: 0.75; }
  10% { clip-path: inset(0); transform: translateX(2px); opacity: 1; }
  15% { clip-path: inset(60% 0 10% 0); transform: translateX(5px); opacity: 0.8; }
  17% { clip-path: inset(0); transform: translateX(-2px); opacity: 1; }
  22% { clip-path: inset(10% 0 65% 0); transform: translateX(-3px) skewX(-0.8deg); opacity: 0.85; }
  24% { clip-path: inset(0); transform: none; opacity: 1; }
  38% { clip-path: inset(40% 0 35% 0); transform: translateX(2px); opacity: 0.9; }
  39.5% { clip-path: inset(0); transform: none; opacity: 1; }
  55% { clip-path: inset(0 0 0 0); transform: translateX(-1px); opacity: 0.95; }
  56% { clip-path: inset(0); transform: none; opacity: 1; }
  100% { opacity: 1; transform: none; clip-path: none; }
}

@keyframes glitchSlice1 {
  0% { opacity: 0; }
  8% { opacity: 0.7; clip-path: inset(28% 0 42% 0); transform: translateX(7px); }
  10% { opacity: 0; }
  16% { opacity: 0.6; clip-path: inset(55% 0 15% 0); transform: translateX(-5px); }
  18% { opacity: 0; }
  23% { opacity: 0.4; clip-path: inset(12% 0 68% 0); transform: translateX(4px); }
  24% { opacity: 0; }
  38% { opacity: 0.3; clip-path: inset(38% 0 38% 0); transform: translateX(3px); }
  39% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes glitchSlice2 {
  0% { opacity: 0; }
  8% { opacity: 0.7; clip-path: inset(55% 0 22% 0); transform: translateX(-8px); }
  10% { opacity: 0; }
  15% { opacity: 0.5; clip-path: inset(8% 0 58% 0); transform: translateX(6px); }
  17% { opacity: 0; }
  22% { opacity: 0.4; clip-path: inset(42% 0 32% 0); transform: translateX(-4px); }
  24% { opacity: 0; }
  55% { opacity: 0.25; clip-path: inset(20% 0 55% 0); transform: translateX(2px); }
  56% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes glitchText {
  0%, 100% {
    transform: translate(0);
    text-shadow:
      0 0 10px rgba(0, 255, 157, 0.6),
      0 0 20px rgba(0, 229, 255, 0.18);
  }
  20% {
    transform: translate(1px, -1px);
    text-shadow:
      -2px 0 rgba(255, 45, 110, 0.45),
      2px 0 rgba(0, 229, 255, 0.45),
      0 0 14px rgba(0, 255, 157, 0.6);
  }
  21% {
    transform: translate(-1px, 1px);
  }
  22% {
    transform: translate(0);
  }
  48% {
    transform: translate(1px, 0);
  }
  49% {
    transform: translate(-1px, 0);
  }
  50% {
    transform: translate(0);
  }
  78% {
    transform: translate(0, 1px);
  }
  79% {
    transform: translate(0, -1px);
  }
  80% {
    transform: translate(0);
  }
}

@keyframes loaderGlitchBefore {
  0%, 100% { opacity: 0; transform: translateX(0); }
  12% { opacity: 0.5; transform: translateX(4px); }
  13% { opacity: 0; transform: translateX(0); }
  44% { opacity: 0.35; transform: translateX(-3px); }
  45% { opacity: 0; transform: translateX(0); }
  76% { opacity: 0.45; transform: translateX(2px); }
  77% { opacity: 0; transform: translateX(0); }
}

@keyframes loaderGlitchAfter {
  0%, 100% { opacity: 0; transform: translateX(0); }
  10% { opacity: 0.4; transform: translateX(-5px); }
  11% { opacity: 0; transform: translateX(0); }
  42% { opacity: 0.3; transform: translateX(3px); }
  43% { opacity: 0; transform: translateX(0); }
  74% { opacity: 0.45; transform: translateX(-2px); }
  75% { opacity: 0; transform: translateX(0); }
}

@keyframes loadProgress {
  0% { width: 0%; }
  40% { width: 45%; }
  60% { width: 60%; }
  90% { width: 95%; }
  100% { width: 100%; }
}

@keyframes blinkText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes tvOff {
  0% {
    transform: scale(1, 1);
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
  40% {
    transform: scale(1, 0.005);
    opacity: 1;
    filter: brightness(3) contrast(3);
  }
  70% {
    transform: scale(0.005, 0.005);
    opacity: 1;
  }
  100% {
    transform: scale(0, 0);
    opacity: 0;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-height: 540px) and (orientation: landscape) {
  body::after {
    display: none;
  }

  .site-header {
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
  }

  .snap-page {
    align-items: stretch;
  }

  .hero,
  .section-free {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 24px;
    padding-bottom: 28px;
    transform: none;
  }

  .hero--home {
    width: min(1200px, 100%);
    padding-inline: 18px;
  }

  .section-free {
    padding-inline: 10px;
  }

  .hero h1 {
    margin-inline: auto;
    max-width: 100%;
  }

  .hero-description,
  .hero-name {
    max-width: 100%;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .page-number {
    right: 16px;
    bottom: 12px;
  }

  .section-free--pulse {
    padding-top: 24px;
  }

  .loader-glitch {
    font-size: 1.5rem;
  }
}

@media (max-width: 1100px) {
  .hero h1,
  .section-free h2 {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .section-free {
    padding-top: clamp(84px, 13vh, 124px);
    transform: none;
  }

  body::after {
    display: none;
  }

  .site-header {
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
  }

  .snap-page--home::before,
  .snap-page--about::before,
  .snap-page--projects::before,
  .snap-page--contact::before {
    animation: none;
  }

  .brand-role {
    display: none;
  }

  .nav-links a {
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .container {
    width: min(var(--container), calc(100% - 28px));
  }

  .hero h1 {
    font-size: clamp(3.8rem, 16vw, 6.2rem);
    line-height: 0.9;
    max-width: 100%;
  }

  .section-free h2 {
    font-size: clamp(3rem, 12vw, 5rem);
    line-height: 0.92;
    max-width: 100%;
  }

  .hero-description,
  .section-lead,
  .section-copy,
  .section-free--pulse .section-lead,
  .section-free--pulse .section-copy {
    max-width: 100%;
  }

  .hero-description,
  .section-lead {
    font-size: clamp(1.08rem, 4.6vw, 1.4rem);
  }

  .section-copy {
    font-size: clamp(1rem, 4vw, 1.18rem);
  }

  .project-line {
    font-size: clamp(1.7rem, 7vw, 2.5rem);
  }

  .section-free--pulse {
    padding-top: clamp(44px, 6vh, 72px);
  }

  .loader-content {
    width: min(280px, calc(100vw - 32px));
  }

  .loader-glitch {
    font-size: 1.45rem;
  }

  .loader-status {
    font-size: 0.74rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

@media (max-width: 760px) and (orientation: portrait) {
  .section-free {
    padding-top: clamp(84px, 12vh, 120px);
  }

  .section-free--pulse {
    padding-top: clamp(44px, 6vh, 72px);
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .snap-root {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .snap-page .page-content,
  .snap-page .page-content .eyebrow,
  .snap-page .page-content .section-label,
  .snap-page .page-content h1,
  .snap-page .page-content h2,
  .snap-page .page-content .hero-description,
  .snap-page .page-content .hero-name,
  .snap-page .page-content .section-lead,
  .snap-page .page-content .section-copy,
  .snap-page .page-content .projects-list,
  .snap-page .page-content .hero-actions {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  #cyber-loader,
  .tv-turn-off {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}