/* ============================================
   REVELIX LABS — V2: Design with Soul
   "Claridad en la Complejidad"
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Design Tokens ── */
:root {
  --midnight: #0A1931;
  --midnight-rgb: 10, 25, 49;
  --deep: #0D2137;
  --surface: #111D33;
  --surface-light: #162742;
  --white: #FFFFFF;
  --cyan: #00F6FF;
  --cyan-rgb: 0, 246, 255;
  --cyan-soft: #00D4E0;
  --cyan-dim: rgba(0, 246, 255, 0.08);
  --cyan-glow: rgba(0, 246, 255, 0.15);
  --grey-100: #F4F7FA;
  --grey-300: #A0AEC0;
  --grey-500: #6B7A90;
  --grey-700: #3D485F;

  --font-head: 'Inter', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--white);
  background: var(--midnight);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

/* ── Utility ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 800px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--cyan) 0%, #00b4ff 50%, var(--cyan) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* ── Cursor Glow (custom cursor follower) ── */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 246, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* ── Noise Texture Overlay ── */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.025;
  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='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ══════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.25rem 0;
  transition: all 0.4s var(--ease-out-expo);
}

.nav.scrolled {
  padding: 0.75rem 0;
  background: rgba(10, 25, 49, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(0, 246, 255, 0.06);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 101;
}

.logo__mark {
  position: relative;
  width: 42px;
  height: 42px;
}

.logo__mark svg {
  width: 100%;
  height: 100%;
}

.logo__text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  display: flex;
  gap: 0.3rem;
}

.logo__text-labs {
  color: var(--cyan);
  font-weight: 600;
}

/* Nav Links */
.nav__menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__link {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--grey-300);
  letter-spacing: 0.01em;
  transition: color 0.3s;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--cyan);
  transition: width 0.4s var(--ease-out-expo);
}

.nav__link:hover {
  color: var(--white);
}

.nav__link:hover::after {
  width: 100%;
}

/* Nav CTA */
.nav__cta {
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 1.5px solid rgba(0, 246, 255, 0.3);
  border-radius: 100px;
  color: var(--cyan);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s var(--ease-out-expo);
}

.nav__cta:hover {
  background: var(--cyan);
  color: var(--midnight);
  box-shadow: 0 0 30px rgba(0, 246, 255, 0.3);
  transform: translateY(-1px);
}

/* Mobile Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
  z-index: 101;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ══════════════════════════════════════════
   HERO — Storytelling Entry
   ══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 8rem 0 4rem;
  overflow: hidden;
}

/* Animated gradient blob */
.hero__blob {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.08), transparent 70%);
  top: -15%;
  right: -10%;
  animation: blobMorph 12s ease-in-out infinite;
  pointer-events: none;
}

.hero__blob--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0, 180, 255, 0.05), transparent 70%);
  top: auto;
  bottom: -5%;
  right: auto;
  left: -5%;
  animation-delay: -5s;
  animation-duration: 15s;
}

@keyframes blobMorph {

  0%,
  100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: rotate(0deg) scale(1);
  }

  25% {
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
  }

  50% {
    border-radius: 30% 60% 70% 40% / 50% 30% 60% 40%;
    transform: rotate(90deg) scale(1.1);
  }

  75% {
    border-radius: 50% 30% 50% 60% / 40% 60% 30% 50%;
  }
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Left: Copy */
.hero__copy {
  max-width: 560px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.35rem 0.5rem;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 246, 255, 0.15);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.hero__eyebrow-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  animation: dotPulse 2.5s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 246, 255, 0.4);
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 6px rgba(0, 246, 255, 0);
  }
}

.hero__title {
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.4s forwards;
}

.hero__description {
  font-size: 1.15rem;
  color: var(--grey-300);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.6s forwards;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.8s forwards;
}

/* Right: Visualization */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out-expo) 0.5s forwards;
}

/* Data Visualization Card */
.viz-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(13, 33, 55, 0.9), rgba(22, 39, 66, 0.7));
  border: 1px solid rgba(0, 246, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3), 0 0 60px rgba(0, 246, 255, 0.05);
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.6s var(--ease-out-expo);
}

.viz-card:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.viz-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.viz-card__title {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--grey-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.viz-card__badge {
  padding: 0.2rem 0.6rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  color: #10B981;
}

/* Animated Bar Chart */
.viz-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  margin-bottom: 1.5rem;
}

.viz-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  position: relative;
  animation: barGrow 1.2s var(--ease-out-expo) forwards;
  animation-delay: var(--delay, 0s);
  transform-origin: bottom;
  transform: scaleY(0);
}

.viz-bar::after {
  content: attr(data-value);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--grey-300);
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: calc(var(--delay, 0s) + 0.8s);
}

@keyframes barGrow {
  to {
    transform: scaleY(1);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Metric Row */
.viz-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.viz-metric {
  background: rgba(0, 246, 255, 0.04);
  border: 1px solid rgba(0, 246, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.viz-metric__value {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--cyan);
}

.viz-metric__label {
  font-size: 0.65rem;
  color: var(--grey-500);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Floating accent cards around viz */
.float-card {
  position: absolute;
  background: rgba(13, 33, 55, 0.95);
  border: 1px solid rgba(0, 246, 255, 0.12);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  backdrop-filter: blur(10px);
  animation: floatY 4s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

.float-card--1 {
  top: -15px;
  right: -30px;
  animation-delay: 0s;
}

.float-card--2 {
  bottom: -20px;
  left: -20px;
  animation-delay: -2s;
}

.float-card__icon {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.float-card__text {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--grey-300);
}

.float-card__value {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}

@keyframes floatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════
   PAIN SECTION — "The Problem"
   ══════════════════════════════════════════ */
.pain {
  padding: 4.75rem 0 6rem;
  /* Subido ~0.5cm (aprox 20px) */
  position: relative;
}

.pain .container {
  max-width: 900px;
}

.pain__question {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 3rem;
}

.pain__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.pain__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  flex: 1 1 280px;
  max-width: 360px;
  min-height: 160px;
  /* ~4cm de alto como fue solicitado */
  padding: 1.75rem 1.5rem;
  background: rgba(255, 100, 100, 0.03);
  border: 1px solid rgba(255, 100, 100, 0.08);
  border-radius: 14px;
  transition: all 0.3s;
}

.pain__item:hover {
  background: rgba(255, 100, 100, 0.06);
  border-color: rgba(255, 100, 100, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(0, 246, 255, 0.15), 0 0 6px rgba(0, 246, 255, 0.08);
}

.pain__item-icon {
  font-size: 2rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: emojiSpin 8s linear infinite;
}

.pain__item-text {
  font-size: 0.95rem;
  color: var(--grey-300);
  line-height: 1.6;
}

.pain__item-text strong {
  color: var(--white);
  font-weight: 600;
}

.pain__transition {
  text-align: center;
  margin-top: 3rem;
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--cyan);
  font-weight: 600;
}

.pain__transition--highlight {
  color: #4da89e;
}

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

.bento__desc--accent {
  margin-top: 0.75rem;
  color: var(--cyan);
  font-weight: 600;
  font-style: italic;
}

/* ══════════════════════════════════════════
   SERVICES — Bento Grid
   ══════════════════════════════════════════ */
.services {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan);
  margin-bottom: 1rem;
}

.section-tag::before,
.section-tag::after {
  content: '';
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.section-tag::before {
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--grey-300);
  max-width: 600px;
  margin: 0 auto;
}

/* Bento Grid */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1.25rem;
}

.bento__item {
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-light) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

.bento__item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}

.bento__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 40px rgba(0, 246, 255, 0.06);
}

.bento__item:hover::before {
  opacity: 1;
}

/* Bento Grid Layout */
.bento__item--data {
  grid-column: span 7;
  grid-row: span 1;
}

.bento__item--web {
  grid-column: span 5;
  grid-row: span 1;
}

.bento__item--ai {
  grid-column: span 5;
  grid-row: span 1;
}

.bento__item--software {
  grid-column: span 7;
  grid-row: span 1;
}

.bento__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 246, 255, 0.1);
  margin-bottom: 1.25rem;
}

.bento__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--cyan);
  fill: none;
  stroke-width: 1.5;
}

.bento__title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.bento__desc {
  color: var(--grey-300);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

.bento__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.bento__tag {
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--grey-300);
}

/* ══════════════════════════════════════════
   PROCESS — Visual Timeline
   ══════════════════════════════════════════ */
.process {
  padding: 6rem 0;
  background: linear-gradient(180deg, var(--midnight) 0%, var(--deep) 100%);
  position: relative;
  overflow: hidden;
}

.process::before {
  content: '';
  position: absolute;
  inset: -12%;
  pointer-events: none;
  z-index: 0;
  opacity: var(--process-glow-opacity, 0);
  background:
    radial-gradient(
      circle 280px at var(--process-glow-x, 50%) var(--process-glow-y, 50%),
      rgba(0, 246, 255, 0.16) 0%,
      rgba(0, 246, 255, 0.08) 28%,
      transparent 72%
    );
  transition: opacity 0.22s ease-out;
}

.process .container {
  position: relative;
  z-index: 1;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30px;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 246, 255, 0.1));
}

.timeline__step {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  position: relative;
}

.timeline__step:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--midnight);
  border: 2px solid var(--cyan);
  border-radius: 50%;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--cyan);
  transition: all 0.4s var(--ease-out-expo);
  z-index: 1;
}

.timeline__step:hover .timeline__marker {
  background: var(--cyan);
  color: var(--midnight);
  box-shadow: 0 0 30px rgba(0, 246, 255, 0.4);
  transform: scale(1.1);
}

.timeline__content {
  padding-top: 0.5rem;
}

.timeline__title {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.timeline__desc {
  color: var(--grey-300);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   ABOUT — The Team, The Mission
   ══════════════════════════════════════════ */
.about {
  padding: 6rem 0;
  position: relative;
}

.about .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about__text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 1.5rem;
}

.about__text p {
  color: var(--grey-300);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.about__highlight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--cyan-dim);
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  margin-top: 1.5rem;
}

.about__highlight p {
  color: var(--cyan);
  font-weight: 600;
  font-family: var(--font-head);
  font-size: 0.95rem;
  margin: 0;
}

/* Values Pillars */
.about__pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pillar {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.pillar:hover {
  border-color: rgba(0, 246, 255, 0.12);
  transform: translateY(-3px);
}

.pillar__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--cyan-dim);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
  animation: pulse-emoji 2.5s ease-in-out infinite;
}

@keyframes pulse-emoji {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.pillar__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.pillar__desc {
  font-size: 0.8rem;
  color: var(--grey-500);
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   CTA SECTION
   ══════════════════════════════════════════ */
.cta {
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.cta__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(0, 246, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.cta p {
  font-size: 1.1rem;
  color: var(--grey-300);
  max-width: 500px;
  margin: 0 auto 2.5rem;
}

/* Contact Form */
.form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form__field {
  position: relative;
  padding-bottom: 1.25rem;
}

.form__field--trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  padding-bottom: 0;
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--grey-500);
}

.form__input:focus,
.form__textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 246, 255, 0.08);
}

.form__textarea {
  min-height: 110px;
  resize: vertical;
}

.form__field--invalid .form__input,
.form__field--invalid .form__textarea,
.form__input[aria-invalid="true"],
.form__textarea[aria-invalid="true"] {
  border-color: #ff5c8a;
  box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.12);
}

.form__bubble,
.form__status {
  font-size: 0.78rem;
  line-height: 1.35;
}

.form__bubble {
  position: absolute;
  left: 0.7rem;
  top: calc(100% + 0.2rem);
  z-index: 2;
  max-width: min(calc(100% - 1.4rem), 260px);
  margin-top: 0;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: rgba(8, 16, 32, 0.92);
  border: 1px solid rgba(0, 246, 255, 0.14);
  box-shadow: 0 12px 28px rgba(3, 8, 20, 0.28);
  color: var(--grey-300);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.form__field--bubble-visible .form__bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.form__bubble[data-state="error"] {
  border-color: rgba(255, 92, 138, 0.38);
  background: rgba(43, 8, 22, 0.94);
  color: #ffd2df;
}

.form__bubble:empty {
  display: none;
}

.form__status:empty {
  display: none;
}

.form__status {
  margin-top: 0.35rem;
  text-align: center;
  color: var(--grey-300);
}

.form__status--error {
  color: #ff9ab7;
}

.form__status--warning {
  color: #ffc266;
}

.form__status--success {
  color: #83f7bf;
}

.form__note {
  font-size: 0.8rem;
  color: var(--grey-500);
  text-align: center;
}

.form__note a {
  color: var(--cyan);
  transition: opacity 0.2s;
}

.form__note a:hover {
  opacity: 0.8;
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.35s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--cyan);
  color: var(--midnight);
  box-shadow: 0 4px 20px rgba(0, 246, 255, 0.2);
}

.btn--primary:hover {
  box-shadow: 0 8px 40px rgba(0, 246, 255, 0.35);
  transform: translateY(-2px);
}

.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn--primary:hover::after {
  left: 100%;
}

.btn--ghost {
  background: transparent;
  color: var(--grey-300);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.btn--ghost:hover {
  color: var(--white);
  border-color: rgba(0, 246, 255, 0.3);
  transform: translateY(-2px);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.btn--full {
  width: 100%;
}

.btn__arrow {
  transition: transform 0.3s;
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
}

.footer__brand span {
  color: var(--cyan);
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--grey-500);
}

.footer__meta {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.footer__link {
  color: var(--grey-300);
  font-size: 0.8rem;
  transition: color 0.3s;
}

.footer__link:hover {
  color: var(--cyan);
}

.footer__socials {
  display: flex;
  gap: 0.75rem;
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--grey-500);
  transition: all 0.3s;
}

.footer__social:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

.footer__social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ══════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 {
  transition-delay: 100ms;
}

.reveal-d2 {
  transition-delay: 200ms;
}

.reveal-d3 {
  transition-delay: 300ms;
}

.reveal-d4 {
  transition-delay: 400ms;
}

.reveal-d5 {
  transition-delay: 500ms;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero__visual {
    max-width: 500px;
    margin: 0 auto;
  }

  .bento__item--data,
  .bento__item--web,
  .bento__item--ai,
  .bento__item--software {
    grid-column: span 6;
  }

  .about .container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: rgba(10, 25, 49, 0.98);
    backdrop-filter: blur(24px);
    transition: right 0.4s var(--ease-out-expo);
    border-left: 1px solid rgba(0, 246, 255, 0.06);
    z-index: 100;
  }

  .nav__menu.open {
    right: 0;
  }

  .nav__toggle {
    display: flex;
  }

  .bento__item--data,
  .bento__item--web,
  .bento__item--ai,
  .bento__item--software {
    grid-column: span 12;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline__marker {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
  }

  .timeline__step {
    gap: 1.25rem;
  }

  .about__pillars {
    grid-template-columns: 1fr;
  }

  .form__row {
    grid-template-columns: 1fr;
  }

  .float-card {
    display: none;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .cursor-glow {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .viz-metrics {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════
   PORTFOLIO SECTION
   ══════════════════════════════════════════ */
.portfolio {
  padding: 100px 0;
  position: relative;
  background: var(--bg);
}

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 50px;
}

.portfolio-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.portfolio-card:hover {
  transform: translateY(-10px);
  border-color: rgba(0, 246, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.portfolio-card__img {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
  background: #0d1f3c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.portfolio-visual {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(0, 246, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(9, 20, 40, 0.96) 0%, rgba(11, 27, 52, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.6s var(--ease-out-expo);
}

.portfolio-card:hover .portfolio-visual {
  transform: scale(1.03);
}

.portfolio-visual--pulse {
  background:
    radial-gradient(circle at 50% 12%, rgba(0, 246, 255, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(9, 20, 40, 0.98) 0%, rgba(10, 24, 45, 1) 100%);
}

.pulse-frame {
  position: absolute;
  inset: 0;
  padding: 18px 18px 0;
}

.pulse-plot {
  position: relative;
  height: 172px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(13, 33, 55, 0.92) 0%, rgba(17, 37, 63, 0.84) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 0;
  padding: 20px 18px 0;
  overflow: hidden;
}

.pulse-bars {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 26px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 124px;
}

.pulse-bar {
  flex: 1;
  align-self: end;
  position: relative;
  height: var(--bar-height);
  min-height: 28px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, rgba(28, 233, 248, 0.92) 0%, rgba(21, 133, 156, 0.6) 100%);
  box-shadow: inset 0 -14px 22px rgba(5, 18, 34, 0.16);
}

.pulse-bar--low {
  opacity: 0.34;
}

.pulse-bar--soft {
  opacity: 0.5;
}

.pulse-bar--mid {
  opacity: 0.72;
}

.pulse-bar--high {
  opacity: 0.9;
}

.pulse-bar--accent {
  background: linear-gradient(180deg, rgba(31, 239, 255, 1) 0%, rgba(31, 228, 243, 0.78) 100%);
  box-shadow: inset 0 -14px 22px rgba(5, 18, 34, 0.14), 0 0 12px rgba(0, 246, 255, 0.16);
  opacity: 1;
}

.pulse-line-svg {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  width: calc(100% - 36px);
  height: 134px;
  overflow: visible;
}

.pulse-line {
  fill: none;
  stroke: rgba(0, 246, 255, 0.96);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 236;
  stroke-dashoffset: 236;
  filter: drop-shadow(0 0 6px rgba(0, 246, 255, 0.28));
}

.pulse-line-dot {
  fill: var(--cyan);
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(0, 246, 255, 0.5));
}

.pulse-base {
  height: 20px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(16, 29, 52, 0.96) 0%, rgba(14, 25, 46, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 0;
}

.portfolio-visual--athena {
  display: flex;
  align-items: center;
  justify-content: center;
}

.athena-link {
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 246, 255, 0.3), transparent);
  opacity: 0.38;
}

.athena-link--left {
  left: 7%;
  transform: rotate(28deg);
}

.athena-link--right {
  right: 7%;
  transform: rotate(28deg);
}

.athena-stage {
  position: relative;
  width: 168px;
  height: 168px;
}

.athena-orbit--outer {
  width: 138px;
  height: 138px;
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 1px dashed rgba(0, 246, 255, 0.28);
}

.athena-orbit--inner {
  width: 82px;
  height: 82px;
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 2px solid rgba(0, 246, 255, 0.82);
  box-shadow: 0 0 16px rgba(0, 246, 255, 0.1);
}

.athena-node-orbit {
  position: absolute;
  inset: 0;
}

.athena-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 246, 255, 0.42);
}

.athena-node--1 {
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
}

.athena-node--2 {
  top: 48px;
  right: 31px;
  opacity: 0.66;
}

.athena-node--3 {
  right: 32px;
  bottom: 49px;
  opacity: 0.42;
}

.athena-node--4 {
  bottom: 19px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.28;
}

.athena-node--5 {
  bottom: 49px;
  left: 31px;
  opacity: 0.42;
}

.athena-node--6 {
  top: 48px;
  left: 31px;
  opacity: 0.66;
}

.athena-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.athena-arc path {
  fill: none;
  stroke: rgba(0, 246, 255, 0.28);
  stroke-width: 2;
}

.athena-pill {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 246, 255, 0.09);
  border: 1px solid rgba(0, 246, 255, 0.18);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cyan);
  box-shadow: inset 0 0 10px rgba(0, 246, 255, 0.08);
}

.portfolio-visual--rex {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rex-preview-window {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(6, 15, 30, 0.82) 0%, rgba(10, 23, 44, 0.92) 100%);
  border: 1px solid rgba(0, 246, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rex-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rex-preview-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rex-preview-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 246, 255, 0.12);
  border: 1px solid rgba(0, 246, 255, 0.16);
  font-size: 1rem;
  box-shadow: 0 0 14px rgba(0, 246, 255, 0.12);
}

.rex-preview-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #19ff94;
  box-shadow: 0 0 12px rgba(25, 255, 148, 0.55);
}

.rex-preview-pill {
  width: 48px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.rex-preview-message {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rex-preview-message--user {
  justify-content: flex-end;
}

.rex-preview-message--typing {
  align-self: flex-start;
  width: auto;
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rex-preview-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rex-preview-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(0, 246, 255, 0.15);
  border: 1px solid rgba(0, 246, 255, 0.18);
  flex-shrink: 0;
}

.rex-preview-line {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.rex-preview-line--lg {
  width: 100%;
}

.rex-preview-line--sm {
  width: 68%;
}

.rex-preview-message--user .rex-preview-line {
  width: 58%;
  background: linear-gradient(90deg, rgba(0, 246, 255, 0.24), rgba(0, 246, 255, 0.38));
}

.rex-preview-message--bot {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rex-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}

.portfolio-card__content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-card__tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  background: rgba(0, 246, 255, 0.1);
  color: var(--cyan);
}

.portfolio-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.portfolio-card__desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--grey-400);
  margin-bottom: 24px;
}

.portfolio-card__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-card__link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.3s ease;
}

.portfolio-card__link:hover {
  gap: 12px;
}

/* ══════════════════════════════════════════
   PORTFOLIO SVG ANIMATIONS (inlined)
   ══════════════════════════════════════════ */
.portfolio-card.visible .pulse-bar {
  transform-origin: bottom;
  transform: scaleY(0);
  animation: buildUpBar 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay);
}
@keyframes buildUpBar {
  to { transform: scaleY(1); }
}

.portfolio-card.visible .pulse-line {
  animation: drawPulseLine 1.35s steps(7, end) forwards 0.82s;
}

@keyframes drawPulseLine {
  to { stroke-dashoffset: 0; }
}

.portfolio-card.visible .pulse-line-dot {
  animation: pulseLineDotReveal 0.45s ease forwards 1.05s, pulseLineDotGlow 2.8s ease-in-out infinite 1.45s;
}

@keyframes pulseLineDotReveal {
  from { opacity: 0; transform: scale(0.45); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseLineDotGlow {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.portfolio-card.visible .athena-float {
  animation: athenaFloat 4s ease-in-out infinite;
}
@keyframes athenaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.portfolio-card.visible .athena-spin-right {
  animation: spinRight 12s linear infinite;
}
@keyframes spinRight {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.portfolio-card.visible .athena-spin-left {
  animation: spinLeft 10s linear infinite;
}
@keyframes spinLeft {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.portfolio-card.visible .rex-dot {
  animation: rexBounce 1.5s infinite;
  animation-delay: var(--delay);
}

.portfolio-card.visible .rex-preview-window {
  animation: rexWindowFloat 4.2s ease-in-out infinite;
}

.portfolio-card.visible .rex-preview-avatar {
  animation: rexAvatarLook 4.4s ease-in-out infinite;
}

@keyframes rexWindowFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes rexAvatarLook {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-1px) rotate(-6deg); }
  52% { transform: translateX(1px) rotate(4deg); }
  68% { transform: translateX(0) rotate(0deg); }
}

@keyframes rexBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-card.visible .pulse-bar,
  .portfolio-card.visible .pulse-line,
  .portfolio-card.visible .pulse-line-dot,
  .portfolio-card.visible .athena-float,
  .portfolio-card.visible .athena-spin-right,
  .portfolio-card.visible .athena-spin-left,
  .portfolio-card.visible .rex-dot,
  .portfolio-card.visible .rex-preview-window,
  .portfolio-card.visible .rex-preview-avatar {
    animation: none !important;
    transform: none !important;
  }

  .pulse-bar {
    transform: scaleY(1);
  }

  .pulse-line {
    stroke-dashoffset: 0;
  }

  .pulse-line-dot {
    opacity: 1;
  }
}

/* ══════════════════════════════════════════
   REX CHATBOT WIDGET
   ══════════════════════════════════════════ */
.rex {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body);
}

/* Toggle button */
.rex__toggle {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d2540, #0a1931);
  border: 2px solid rgba(0, 246, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-out-expo);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 246, 255, 0.1);
}

.rex__toggle:hover {
  transform: scale(1.1);
  border-color: rgba(0, 246, 255, 0.6);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 0 50px rgba(0, 246, 255, 0.2);
}

.rex__toggle-dino {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rex__dino-icon {
  width: 100%;
  height: 100%;
  color: var(--cyan);
  animation: rexIdle 3s ease-in-out infinite;
}

.rex__dino-icon--small {
  width: 34px;
  height: 34px;
  animation: none;
}

@keyframes rexIdle {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-2px) rotate(1deg);
  }

  75% {
    transform: translateY(1px) rotate(-1deg);
  }
}

/* Pulse ring */
.rex__toggle-pulse {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  animation: rexPulse 2.5s ease-out infinite;
  pointer-events: none;
}

@keyframes rexPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Tooltip (Speech Bubble) */
.rex__tooltip {
  position: absolute;
  bottom: 80px;
  right: 0;
  padding: 0.75rem 1.2rem;
  background: rgba(13, 33, 55, 0.98);
  border: 1px solid var(--cyan);
  border-radius: 16px 16px 4px 16px;
  backdrop-filter: blur(12px);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s var(--ease-out-expo);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 246, 255, 0.1);
  z-index: -1;
}

/* Speech bubble tail */
.rex__tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  width: 15px;
  height: 15px;
  background: rgba(13, 33, 55, 0.98);
  border-right: 1px solid var(--cyan);
  border-bottom: 1px solid var(--cyan);
  transform: rotate(45deg);
}

.rex__tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  z-index: 1000;
  animation: bubbleFloat 3s ease-in-out infinite;
}

@keyframes bubbleFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Chat window */
.rex__window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-height: 520px;
  background: linear-gradient(160deg, rgba(13, 31, 60, 0.97), rgba(10, 25, 49, 0.98));
  border: 1px solid rgba(0, 246, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 246, 255, 0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s var(--ease-out-expo);
  overflow: hidden;
}

.rex__window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.rex__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.rex__header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rex__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 246, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--cyan);
  flex-shrink: 0;
}

.rex__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
}

.rex__status {
  font-size: 0.7rem;
  color: var(--cyan);
  font-weight: 500;
}

.rex__close {
  background: none;
  border: none;
  color: var(--grey-500);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
  line-height: 1;
}

.rex__close:hover {
  color: var(--white);
}

/* Messages area */
.rex__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 340px;
  min-height: 200px;
  scroll-behavior: smooth;
}

.rex__messages::-webkit-scrollbar {
  width: 4px;
}

.rex__messages::-webkit-scrollbar-track {
  background: transparent;
}

.rex__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Message bubbles */
.rex-msg {
  max-width: 88%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  animation: msgIn 0.3s var(--ease-out-expo);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rex-msg--bot {
  align-self: flex-start;
  background: rgba(0, 246, 255, 0.06);
  border: 1px solid rgba(0, 246, 255, 0.1);
  border-bottom-left-radius: 4px;
  color: var(--grey-200);
}

.rex-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), rgba(0, 180, 255, 0.1));
  border: 1px solid rgba(0, 246, 255, 0.2);
  border-bottom-right-radius: 4px;
  color: var(--white);
}

.rex-msg strong {
  color: var(--white);
  font-weight: 600;
}

.rex-msg a {
  color: var(--cyan);
  text-decoration: underline;
}

/* Option buttons inside messages */
.rex-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.rex-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: rgba(0, 246, 255, 0.05);
  border: 1px solid rgba(0, 246, 255, 0.12);
  border-radius: 10px;
  color: var(--cyan);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.rex-opt:hover {
  background: rgba(0, 246, 255, 0.12);
  border-color: rgba(0, 246, 255, 0.25);
  transform: translateX(4px);
}

.rex-opt--back {
  color: var(--grey-500);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
}

.rex-opt--back:hover {
  color: var(--grey-300);
  background: rgba(255, 255, 255, 0.04);
}

/* Typing indicator */
.rex-typing {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  align-self: flex-start;
}

.rex-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.rex-typing__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.rex-typing__dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Input */
.rex__input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.1);
}

.rex__input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.rex__input:focus {
  border-color: rgba(0, 246, 255, 0.3);
}

.rex__input::placeholder {
  color: var(--grey-500);
}

.rex__send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--cyan);
  border: none;
  color: var(--midnight);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rex__send:hover {
  background: #33f8ff;
  transform: scale(1.05);
}

/* Rex dino animation states */
.rex__toggle.rex--thinking .rex__dino-icon {
  animation: rexThink 1s ease-in-out infinite;
}

@keyframes rexThink {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-4px) rotate(-10deg);
  }
}

.rex__toggle.rex--typing .rex__dino-icon {
  animation: rexType 0.3s ease-in-out infinite alternate;
}

@keyframes rexType {
  from {
    transform: rotate(-3deg) translateY(0);
  }

  to {
    transform: rotate(3deg) translateY(-2px);
  }
}

.rex__toggle.rex--greeting .rex__dino-icon {
  animation: rexGreet 0.6s var(--ease-out-expo);
}

@keyframes rexGreet {
  0% {
    transform: translateY(0) scale(1);
  }

  40% {
    transform: translateY(-10px) scale(1.15) rotate(5deg);
  }

  100% {
    transform: translateY(0) scale(1) rotate(0);
  }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .rex__window {
    width: calc(100vw - 32px);
    right: -8px;
    bottom: 72px;
    max-height: 70vh;
  }

  .rex {
    bottom: 16px;
    right: 16px;
  }

  .rex__toggle {
    width: 56px;
    height: 56px;
  }

  .rex__toggle-dino {
    width: 30px;
    height: 30px;
  }
}

/* In-chat avatar animation states */
.rex-avatar--thinking {
  animation: avatarThink 1s ease-in-out infinite;
}

.rex-avatar--typing {
  animation: avatarType 0.4s ease-in-out infinite alternate;
}

.rex-avatar--greeting {
  animation: avatarGreet 0.6s var(--ease-out-expo);
}

@keyframes avatarThink {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  30% {
    transform: translateY(-3px) rotate(-5deg);
  }

  60% {
    transform: translateY(-1px) rotate(5deg);
  }
}

@keyframes avatarType {
  from {
    transform: scale(1) rotate(-2deg);
  }

  to {
    transform: scale(1.05) rotate(2deg);
  }
}

@keyframes avatarGreet {
  0% {
    transform: scale(1) translateY(0);
  }

  40% {
    transform: scale(1.2) translateY(-5px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

/* ── Hero Custom Enhancements (V2) ── */
.metallic-dollar {
  font-weight: 800;
  /* Color Cian Revelador (#00F6FF) con efecto resplandor/brillo */
  background: linear-gradient(135deg, rgba(0, 246, 255, 1) 0%, rgba(180, 255, 255, 1) 50%, rgba(0, 200, 210, 1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-left: 4px;
  filter: drop-shadow(0px 0px 4px rgba(0, 246, 255, 0.6));
}

.viz-card__badge--glow {
  box-shadow: 0 0 12px rgba(0, 255, 100, 0.4), inset 0 0 8px rgba(0, 255, 100, 0.15);
  border: 1px solid rgba(0, 255, 100, 0.4) !important;
  color: #00ff64;
  animation: liveBlink 1.5s ease-in-out infinite alternate;
}

@keyframes liveBlink {
  0% {
    opacity: 0.6;
    box-shadow: 0 0 4px rgba(0, 255, 100, 0.2), inset 0 0 4px rgba(0, 255, 100, 0.1);
  }

  100% {
    opacity: 1;
    box-shadow: 0 0 12px rgba(0, 255, 100, 0.6), inset 0 0 8px rgba(0, 255, 100, 0.3);
    text-shadow: 0 0 4px rgba(0, 255, 100, 0.8);
  }
}

.viz-bar {
  transform-origin: bottom;
  animation: barPulse 4s ease-in-out infinite alternate;
  /* El delay de la animacion de pulso va a ser un offset aleatorio basado en el original */
  animation-delay: calc(var(--delay) * 2);
}

@keyframes barPulse {
  0% {
    transform: scaleY(0.92);
  }

  100% {
    transform: scaleY(1.08);
  }
}

.lightning-bolt {
  display: inline-block;
  transform-origin: center center;
  backface-visibility: hidden;
  /* Force hardware acceleration */
  animation: lightningFlash 3s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.4));
}

@keyframes lightningFlash {

  0%,
  85%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.4));
  }

  88% {
    opacity: 0.6;
    transform: scale(0.9) rotate(-10deg);
  }

  92% {
    opacity: 1;
    transform: scale(1.3) rotate(8deg);
    filter: drop-shadow(0 0 15px rgba(255, 204, 0, 1)) drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
  }

  96% {
    opacity: 0.3;
    transform: scale(0.85) rotate(-5deg);
  }
}

.btn--glow {
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.4);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn--glow:hover {
  box-shadow: 0 0 25px rgba(0, 246, 255, 0.7);
}
