/* ═══════════════════════════════════════════════════════════
   Juan Velardi — Portfolio
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens: light mode (default) ───────────────────────── */
:root {
  --bg:           #f7f8fc;
  --bg-alt:       #f0f2f8;
  --surface:      #ffffff;
  --surface-2:    #eef0f8;
  --border:       rgba(20,24,39,.12);

  --text:         #151827;
  --text-dim:     #596174;
  --text-muted:   #8b93a8;

  --primary:      #6d28d9;
  --primary-bright: #7c3aed;
  --primary-dim:  #5b21b6;
  --primary-glow: rgba(109,40,217,.18);
  --blue:         #1d4ed8;
  --success:      #16a34a;

  --header-bg:    rgba(247,248,252,.88);
  --shadow:       0 20px 60px rgba(25,28,45,.10);

  color-scheme: light;

  --radius:       10px;
  --radius-lg:    18px;
  --transition:   .25s ease;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Manrope', system-ui, sans-serif;
  --max-w:        1280px;

  /* Animation speed tokens */
  --anim-fast:   0.3s;
  --anim-normal: 0.6s;
  --anim-slow:   1.0s;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark mode (system preference) ──────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #090b14;
    --bg-alt:       #111420;
    --surface:      #121625;
    --surface-2:    #171c2e;
    --border:       rgba(255,255,255,.09);

    --text:         #f8fafc;
    --text-dim:     #a8b0c2;
    --text-muted:   #4e5a72;

    --primary:      #7c3aed;
    --primary-bright: #9b6cff;
    --primary-dim:  #6020c7;
    --primary-glow: rgba(124,58,237,.22);
    --blue:         #2563eb;
    --success:      #37d67a;

    --header-bg:    rgba(9,11,20,.82);
    --shadow:       0 20px 60px rgba(0,0,0,.28);

    color-scheme: dark;
  }
}

/* ── Dark mode (explicit toggle) ─────────────────────────── */
:root[data-theme="dark"] {
  --bg:           #090b14;
  --bg-alt:       #111420;
  --surface:      #121625;
  --surface-2:    #171c2e;
  --border:       rgba(255,255,255,.09);

  --text:         #f8fafc;
  --text-dim:     #a8b0c2;
  --text-muted:   #4e5a72;

  --primary:      #7c3aed;
  --primary-bright: #9b6cff;
  --primary-dim:  #6020c7;
  --primary-glow: rgba(124,58,237,.22);
  --blue:         #2563eb;
  --success:      #37d67a;

  --header-bg:    rgba(9,11,20,.82);
  --shadow:       0 20px 60px rgba(0,0,0,.28);

  color-scheme: dark;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  text-wrap: balance;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-bright); }
ul { list-style: none; }
:focus-visible {
  outline: 3px solid var(--primary-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -9999px; left: 1rem;
  background: var(--primary); color: #fff; padding: .5rem 1rem;
  border-radius: var(--radius); font-weight: 600; z-index: 9999;
}
.skip-link:focus { top: 1rem; }

/* ── Container ───────────────────────────────────────────── */
.container {
  width: min(var(--max-w), calc(100% - 40px));
  margin-inline: auto;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font); font-size: .9rem; font-weight: 700;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: #fff;
  box-shadow: 0 10px 28px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px var(--primary-glow);
  color: #fff;
}
.btn-ghost {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }

/* ── Eyebrow ─────────────────────────────────────────────── */
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
  color: var(--primary-bright);
  font-size: .72rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.badge-available {
  background: rgba(55,214,122,.1); color: var(--success);
  border: 1px solid rgba(55,214,122,.25);
}
.badge-tech {
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border);
  font-size: .7rem;
}
.badge-tag {
  background: rgba(124,58,237,.1); color: var(--primary-bright);
  border: 1px solid rgba(124,58,237,.22);
  font-size: .66rem;
}
.badge-muted {
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0;
  right: var(--scrollbar-w, 0px);
  z-index: 100;
  height: 72px;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text); font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-heading);
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 900; color: #fff;
  letter-spacing: -.05em;
  overflow: hidden; flex-shrink: 0;
}
.logo-mark--img {
  width: auto;
  background: none;
  border: 1px solid var(--border);
}
.logo-mark--img img {
  width: auto; height: 100%;
  max-width: 100%;
  object-fit: contain; display: block;
  border-radius: calc(var(--radius) - 2px);
}
.logo-name { font-size: .95rem; }

.nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-list { display: flex; gap: .1rem; }
.nav-link {
  padding: .4rem .65rem;
  border-radius: var(--radius);
  font-size: .78rem; font-weight: 650; color: var(--text-dim);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }

/* Theme toggle */
.theme-toggle {
  display: grid; width: 40px; height: 40px; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-dim);
  cursor: pointer; flex-shrink: 0;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* Light mode (default): show moon so the user can switch to dark */
.icon-sun  { display: none; }
.icon-moon { display: block; }

/* Dark (explicit): show sun so the user can switch to light */
:root[data-theme="dark"] .icon-sun  { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* Dark (system preference): same */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text-dim);
  border-radius: 2px; transition: all var(--transition);
  margin-inline: auto; width: 16px;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ═══════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════ */
.section { padding-block: 112px; }
.section-alt { background: var(--bg-alt); }

.section-header { max-width: 680px; margin-bottom: 56px; }
.section-title {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 800; letter-spacing: -.04em;
  margin-bottom: .5rem;
}
.section-lead { color: var(--text-dim); font-size: 1.05rem; line-height: 1.75; }

/* Rich text output from editor */
.rich-text p, .section-lead p, .hero-text p { margin-bottom: .75rem; }
.rich-text p:last-child, .section-lead p:last-child, .hero-text p:last-child { margin-bottom: 0; }
.rich-text strong, .section-lead strong, .hero-text strong { color: var(--text); font-weight: 700; }
.rich-text u, .section-lead u, .hero-text u { text-decoration: underline; text-underline-offset: 3px; }
.rich-text em, .section-lead em, .hero-text em { font-style: italic; }
.rich-text ul, .rich-text ol, .section-lead ul, .hero-text ul { padding-left: 1.25rem; margin-bottom: .75rem; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin-bottom: .3rem; }

.subsection-title {
  font-size: .72rem; font-weight: 800; color: var(--text-muted);
  margin-bottom: 1.5rem; letter-spacing: .12em; text-transform: uppercase;
}

/* ── Scroll reveal — base (GSAP toma el control si está disponible) ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--anim-normal) var(--ease-out-expo),
              transform var(--anim-normal) var(--ease-out-expo);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Variantes de estilo para las secciones */
[data-anim-style="slide"]  .reveal { transform: translateX(-36px); }
[data-anim-style="zoom"]   .reveal { transform: scale(.88); opacity: 0; }
[data-anim-style="flip"]   .reveal { transform: rotateX(18deg) translateY(20px); opacity: 0; transform-origin: top center; }
[data-anim-style="none"]   .reveal { opacity: 1; transform: none; transition: none; }

/* Velocidades */
[data-anim-speed="fast"]   .reveal { transition-duration: var(--anim-fast); }
[data-anim-speed="slow"]   .reveal { transition-duration: var(--anim-slow); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Scroll progress bar ─────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  transition: width .1s linear;
  pointer-events: none;
}

/* ── Cursor glow (dark mode) ─────────────────────────────── */
.cursor-glow {
  position: fixed; pointer-events: none; z-index: 9999;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.08) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  opacity: 0;
}
:root[data-theme="dark"] .cursor-glow { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cursor-glow { opacity: 1; }
}

/* ── Magnetic button effect ──────────────────────────────── */
.btn-primary { will-change: transform; }

/* ── Animated status dot ─────────────────────────────────── */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(55,214,122,.4); }
  70%  { box-shadow: 0 0 0 8px rgba(55,214,122,0); }
  100% { box-shadow: 0 0 0 0   rgba(55,214,122,0); }
}
.status-dot { animation: pulse-ring 2.4s ease-out infinite; }

/* ── Hero glow animation ─────────────────────────────────── */
@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(3%, 2%) scale(1.06); }
  66%       { transform: translate(-2%, 3%) scale(.97); }
}
.hero-glow--one { animation: float-glow 12s ease-in-out infinite; }
.hero-glow--two { animation: float-glow 16s ease-in-out infinite reverse; }

/* ── Hero title word-by-word reveal ─────────────────────── */
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .5s var(--ease-out-expo), transform .5s var(--ease-out-expo);
}
.hero-title.words-visible .word { opacity: 1; transform: none; }

/* ── Badge stagger (tecnologías) ─────────────────────────── */
.badge-tech {
  opacity: 0;
  transform: scale(.85);
  transition: opacity .3s ease, transform .3s var(--ease-spring),
              border-color var(--transition), background var(--transition);
}
.badge-tech.badge-in { opacity: 1; transform: scale(1); }
.badge-tech:hover {
  border-color: var(--primary);
  background: rgba(124,58,237,.12);
  color: var(--primary-bright);
  transform: scale(1.05);
}

/* ── Project cards — left slide ──────────────────────────── */
.project-card {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity .5s var(--ease-out-expo), transform .5s var(--ease-out-expo),
              border-color .3s, box-shadow .3s;
}
.project-card.card-in { opacity: 1; transform: none; }
.project-card:hover {
  border-color: rgba(124,58,237,.5);
  transform: translateY(-6px) !important;
  box-shadow: 0 20px 50px rgba(124,58,237,.12);
}

/* ── Service cards — grid appear ────────────────────────── */
.service-card {
  opacity: 0;
  transform: translateY(16px) scale(.97);
  transition: opacity .4s ease, transform .4s var(--ease-spring),
              background var(--transition);
}
.service-card.card-in { opacity: 1; transform: none; }
.service-card:hover {
  background: var(--surface-2);
  transform: translateY(-2px) !important;
}

/* ── Card aptitud hover mejorado ─────────────────────────── */
.card {
  position: relative; overflow: hidden;
}
.card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              rgba(124,58,237,.08), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }

/* ── Contact cards entrada ───────────────────────────────── */
.contact-card {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity .4s ease, transform .4s var(--ease-out-expo),
              padding var(--transition), background var(--transition), color var(--transition);
}
.contact-card.card-in { opacity: 1; transform: none; }

/* ── Metodo items ────────────────────────────────────────── */
.metodo-item {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .35s ease, transform .35s ease,
              background var(--transition), padding var(--transition);
}
.metodo-item.item-in { opacity: 1; transform: none; }

/* ── Eyebrow animated line ───────────────────────────────── */
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 2px;
  background: var(--primary-bright);
  border-radius: 999px;
  transition: width .6s var(--ease-out-expo);
  vertical-align: middle;
}
.eyebrow.ew-in::before { width: 24px; }

/* ── Commitment block slide in ───────────────────────────── */
.commitment-block {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .5s ease, transform .5s var(--ease-out-expo);
}
.commitment-block.in { opacity: 1; transform: none; }


/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding-top: 142px;
  padding-bottom: 86px;
  overflow: hidden;
}

/* Grid background */
.hero::before {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .5;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

/* Glow blobs */
.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: .15; pointer-events: none;
}
.hero-glow--one {
  top: 15%; left: -8%;
  width: 520px; height: 520px;
  background: var(--primary);
}
.hero-glow--two {
  right: -8%; bottom: 0;
  width: 420px; height: 420px;
  background: var(--blue);
}

.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 80px; align-items: center;
  margin-bottom: 3rem;
}
.hero-content { display: flex; flex-direction: column; gap: 1.4rem; align-items: flex-start; }

.hero-title {
  font-size: clamp(2.65rem, 5.2vw, 4.8rem);
  font-weight: 800; letter-spacing: -.06em;
  line-height: .97;
}
.hero-title em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(110deg, var(--primary-bright), #5d9bff 75%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 500; color: var(--text-dim);
}
.hero-text { color: var(--text-dim); font-size: 1rem; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.hero-social { display: flex; gap: .75rem; margin-top: .25rem; }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.social-link:hover { color: var(--primary-bright); border-color: var(--primary); }

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
}
.avatar-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.avatar-inner {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: 26px;
}
.avatar-inner::before {
  position: absolute; z-index: 2; inset: 0;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: inherit; content: ""; pointer-events: none;
}
.avatar-placeholder {
  display: flex; position: absolute; inset: 0;
  align-items: center; justify-content: center; flex-direction: column; gap: .75rem;
  background: radial-gradient(circle at 50% 30%, rgba(124,58,237,.2), transparent 44%),
              linear-gradient(135deg, var(--surface-2), var(--bg));
  color: var(--text-muted);
  border-radius: 26px;
}
.avatar-placeholder svg { color: var(--primary-bright); }
.avatar-placeholder span {
  font-family: var(--font-heading); font-weight: 700;
  font-size: .85rem; letter-spacing: .06em; text-transform: uppercase;
}

.hero-card {
  position: absolute; z-index: 3;
  right: -32px; bottom: 28px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--header-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  max-width: 220px;
}
.hero-card-label {
  font-size: .64rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .14em; color: var(--primary-bright); margin-bottom: .3rem;
}
.hero-card-text { font-size: .84rem; font-weight: 600; line-height: 1.35; }

.scroll-cta {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--text-muted); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase;
  transition: color var(--transition);
}
.scroll-cta:hover { color: var(--text); }

/* Status dot */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 5px rgba(55,214,122,.12);
  margin: 2px 10px;
}


/* ═══════════════════════════════════════════════════════════
   SOBRE MÍ
   ═══════════════════════════════════════════════════════════ */
.commitment-block {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(124,58,237,.06);
  border: 1px solid rgba(124,58,237,.28);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  margin-bottom: 3rem;
}
.commitment-block svg { flex: 0 0 auto; color: var(--primary-bright); margin-top: 2px; }
.commitment-label {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--primary-bright); margin-bottom: .3rem;
}
.commitment-text { font-weight: 500; font-size: .94rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: rgba(124,58,237,.4); transform: translateY(-4px); }
.card-title { font-family: var(--font-heading); font-weight: 700; margin-bottom: .4rem; font-size: .98rem; }
.card-text { font-size: .82rem; color: var(--text-dim); line-height: 1.55; }


/* ═══════════════════════════════════════════════════════════
   TECNOLOGÍAS
   ═══════════════════════════════════════════════════════════ */

/* Sección compacta: ajusta al contenido del slider */
#tecnologias { padding-block: 48px 20px; }
#tecnologias .section-header { margin-bottom: 1.5rem; }

.tech-groups { display: flex; flex-direction: column; gap: 2.5rem; }
.tech-group-label {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-muted); margin-bottom: .75rem;
}
.badge-list { display: flex; flex-wrap: wrap; gap: .5rem; }


/* ═══════════════════════════════════════════════════════════
   PROYECTOS
   ═══════════════════════════════════════════════════════════ */
.projects-list { display: flex; flex-direction: column; gap: 1.5rem; }
.project-card {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 2rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  transition: border-color .3s, transform .3s;
  overflow: hidden;
}
.project-card:hover { border-color: rgba(124,58,237,.4); transform: translateY(-4px); }
.project-meta { display: flex; flex-direction: column; gap: .5rem; padding-top: .25rem; }
.project-num { font-size: 2rem; font-weight: 800; color: var(--border); letter-spacing: -.04em; font-family: var(--font-heading); }
.project-status {
  display: inline-block; padding: .2rem .6rem;
  background: rgba(124,58,237,.1); color: var(--primary-bright);
  border: 1px solid rgba(124,58,237,.22);
  border-radius: 999px; font-size: .66rem; font-weight: 700;
  letter-spacing: .04em; white-space: nowrap;
}
.project-title { font-size: 1.3rem; font-weight: 800; margin-bottom: .6rem; font-family: var(--font-heading); letter-spacing: -.025em; }
.project-desc { color: var(--text-dim); margin-bottom: 1rem; font-size: .9rem; }
.project-participation { font-size: .82rem; color: var(--text-dim); margin-top: .75rem; margin-bottom: .75rem; }
.project-participation strong { color: var(--text); }


/* ═══════════════════════════════════════════════════════════
   SERVICIOS
   ═══════════════════════════════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  margin-bottom: 3.5rem;
}
.service-card {
  position: relative;
  min-height: 210px;
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.service-card:hover { background: var(--surface-2); }
.service-num {
  font-size: .7rem; font-weight: 800; color: var(--text-muted);
  font-family: monospace; display: block; margin-bottom: 32px;
}
.service-title { font-size: .96rem; font-weight: 700; margin-bottom: .4rem; font-family: var(--font-heading); }
.service-text { font-size: .8rem; color: var(--text-dim); line-height: 1.55; }

/* CTA Block */
.cta-block {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  background: radial-gradient(circle at 20% 50%, rgba(124,58,237,.14), transparent 40%), var(--surface);
  border: 1px solid rgba(124,58,237,.28);
  border-radius: var(--radius-lg); padding: 2.5rem 2.75rem;
  margin-bottom: 4rem;
}
.cta-title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem); font-weight: 800;
  font-family: var(--font-heading); letter-spacing: -.03em;
  max-width: 520px;
}
.cta-block small { display: block; color: var(--primary-bright); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.cta-actions { display: flex; flex-direction: column; gap: .6rem; flex-shrink: 0; }

/* Método JV */
.metodo-title {
  font-size: 1.25rem; font-weight: 800; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-family: var(--font-heading); letter-spacing: -.03em;
}
.metodo-list { display: flex; flex-direction: column; }
.metodo-item {
  display: grid; grid-template-columns: 60px 1fr;
  align-items: center; min-height: 72px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), padding var(--transition);
}
.metodo-item:hover { background: var(--surface-2); padding-inline: .75rem; }
.metodo-num { font-size: .72rem; font-weight: 800; color: var(--primary-bright); font-family: monospace; }
.metodo-step { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; font-family: var(--font-heading); }
.metodo-step-desc { font-size: .82rem; color: var(--text-dim); }


/* ═══════════════════════════════════════════════════════════
   CONTACTO
   ═══════════════════════════════════════════════════════════ */
.contact-availability { color: var(--text-muted); font-size: .88rem; margin-top: .5rem; display: flex; align-items: center; gap: .5rem; }
.contact-options { border-top: 1px solid var(--border); }
.contact-card {
  display: grid; grid-template-columns: 52px 1fr auto;
  align-items: center; gap: 1.1rem;
  padding: 1.2rem .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  transition: padding var(--transition), background var(--transition), color var(--transition);
}
.contact-card:hover { padding-inline: 1rem; background: var(--surface); color: var(--text); }
.contact-icon {
  display: grid; width: 46px; height: 46px; place-items: center;
  border-radius: 11px; background: rgba(124,58,237,.12); color: var(--primary-bright);
}
.contact-icon--green { background: rgba(55,214,122,.12); color: var(--success); }
.contact-icon--dark  { background: var(--surface-2); color: var(--text); }
.contact-card-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.contact-label { font-size: .9rem; font-weight: 600; }
.contact-sublabel { font-size: .72rem; color: var(--text-muted); }
.contact-arrow { color: var(--text-muted); transition: transform var(--transition); }
.contact-card:hover .contact-arrow { transform: translateX(4px); color: var(--text-dim); }

/* orb decorativo */
.contact-orb {
  position: absolute; right: -80px; bottom: -160px;
  width: 500px; height: 500px; border-radius: 50%;
  background: var(--primary); filter: blur(150px); opacity: .07;
  pointer-events: none; overflow: hidden;
}
#contacto { overflow: hidden; }


/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(var(--footer-cols, 3), 1fr);
  gap: 2.5rem; align-items: start;
  padding-top: 3.5rem; padding-bottom: 2.5rem;
}
.footer-col { display: flex; flex-direction: column; gap: .75rem; }
.footer-col-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .25rem; }
.footer-col-text { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
.footer-col-image { max-width: 160px; border-radius: var(--radius); }
.footer-links-list { display: flex; flex-direction: column; gap: .35rem; }
.footer-tagline { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }
.footer-nav { display: flex; flex-direction: column; gap: .35rem; }
.footer-link { font-size: .8rem; color: var(--text-dim); }
.footer-link:hover { color: var(--text); }
.footer-social { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.footer-copy { font-size: .72rem; color: var(--text-muted); }
.back-top {
  display: grid; width: 40px; height: 40px; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim);
  transition: all var(--transition);
}
.back-top:hover { border-color: var(--primary); color: var(--primary); }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1440px) {
  .container { width: min(var(--max-w), 82%); }
}

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { gap: 50px; }
  .footer-inner { grid-template-columns: repeat(min(var(--footer-cols,3), 2), 1fr); }
}

@media (max-width: 768px) {
  .container { width: min(100% - 32px, 640px); }
  .section { padding-block: 82px; }

  /* Header: quitar backdrop-filter para que el nav fixed se posicione respecto al viewport */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }

  /* Animación slide horizontal → vertical en mobile para evitar overflow-x clipping */
  [data-anim-style="slide"] .reveal { transform: translateY(28px); }

  /* Header nav */
  .nav-toggle { display: flex; margin-left: auto; }
  .nav {
    display: none; flex-direction: column; align-items: flex-start;
    position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
    background: var(--bg); border-top: 1px solid var(--border);
    padding: 1.5rem 1.25rem; gap: .5rem;
    overflow-y: auto; z-index: 99;
  }
  .nav.is-open { display: flex; }
  .nav-list { flex-direction: column; width: 100%; }
  .nav-link { display: block; padding: .75rem .75rem; font-size: .9rem; min-height: 48px; border-bottom: 1px solid var(--border); }
  .nav-link.active { background: none; }
  .nav .btn { width: 100%; justify-content: center; margin-top: .5rem; }

  /* Hero */
  .hero { padding-top: 108px; padding-bottom: 72px; overflow: hidden; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { order: -1; display: flex; justify-content: center; }
  .avatar-wrap { width: min(45%, 180px); aspect-ratio: 4/5; }
  .hero-card { right: 0; left: auto; max-width: 170px; padding: 10px 12px; }
  .hero-card-text { font-size: .74rem; }

  /* Sections */
  .section-title { font-size: clamp(1.75rem, 6vw, 2.5rem); }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }
  .service-card { min-height: auto; border-right: none; }
  .services-grid { border-left: none; }
  .service-card { border-left: 4px solid var(--primary); border-right: none; padding-left: 20px; }

  /* Projects */
  .project-card { grid-template-columns: 1fr; gap: 1rem; }
  .project-meta { flex-direction: row; align-items: center; }
  .project-num { font-size: 1.2rem; }

  /* CTA */
  .cta-block { flex-direction: column; align-items: flex-start; padding: 1.75rem; }
  .cta-actions { flex-direction: row; flex-wrap: wrap; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-social { flex-direction: row; flex-wrap: wrap; }

  /* Contact */
  .contact-card { grid-template-columns: 46px 1fr auto; }
}

@media (max-width: 480px) {
  .container { width: calc(100% - 32px); }
  .section { padding-block: 64px; }
  .hero { padding-top: 94px; padding-bottom: 56px; overflow: hidden; }
  .hero-grid { gap: 1.5rem; }
  .avatar-wrap { width: min(42%, 165px); }
  .hero-card { right: 0; max-width: 150px; padding: 9px 11px; bottom: 16px; }
  .hero-card-text { font-size: .7rem; }
  .hero-title { letter-spacing: -.04em; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .hero-social { flex-direction: row; flex-wrap: wrap; }
  .cards-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2.5rem; padding-bottom: 2rem; }
  .section-header { margin-bottom: 36px; }
}


/* ═══════════════════════════════════════════════════════════
   STACKED SECTIONS — efecto cartas apiladas
   ═══════════════════════════════════════════════════════════ */
.stack-wrap {
  position: relative;
}

.stack-card {
  position: sticky;
  top: 72px; /* altura del header */
  border-radius: 20px 20px 0 0;
  transform-origin: top center;
  transition: transform .4s var(--ease-out-expo),
              box-shadow .4s ease,
              border-radius .4s ease;
  will-change: transform;
  /* Sombra que da profundidad cuando quedan atrás */
  box-shadow: 0 -4px 60px rgba(0,0,0,.0);
  /* z-index progresivo asignado por JS */
}

.stack-card.stack-pushed {
  box-shadow: 0 -8px 60px rgba(0,0,0,.18);
}

/* Esquinas del hero (que no es stack-card) se redondean antes de la primera carta */
.hero { border-radius: 0; }

/* En móvil, desactivar el sticky para no romper la lectura */
@media (max-width: 768px) {
  .stack-card {
    position: relative;
    top: auto;
    border-radius: 0;
    transform: none !important;
  }
  .stack-wrap { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-card {
    position: relative;
    top: auto;
    transform: none !important;
    transition: none;
  }
}


/* ═══════════════════════════════════════════════════════════
   HERO FLOATING ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.hero-floats {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  overflow: hidden;
}

/* Base del elemento flotante */
.hf {
  position: absolute;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-weight: 700;
  color: var(--primary-bright);
  opacity: 0;
  animation: hf-float-in .8s var(--ease-out-expo) forwards,
             hf-float var(--hf-dur, 7s) ease-in-out infinite var(--hf-delay, 0s);
  will-change: transform, opacity;
  user-select: none;
}

/* Keyframes de entrada */
@keyframes hf-float-in {
  from { opacity: 0; transform: translateY(12px) scale(.85); }
  to   { opacity: var(--hf-opacity, .18); transform: none; }
}

/* Keyframes de flotación continua */
@keyframes hf-float {
  0%, 100% { transform: translate(0, 0) rotate(var(--hf-rot0, 0deg)); }
  33%       { transform: translate(var(--hf-tx, 6px), var(--hf-ty, -10px)) rotate(var(--hf-rot1, 2deg)); }
  66%       { transform: translate(calc(var(--hf-tx, 6px) * -0.5), var(--hf-ty2, 6px)) rotate(var(--hf-rot2, -1deg)); }
}

/* Símbolos de código grandes */
.hf--1  { top: 12%; left: 6%;   font-size: 1.5rem; --hf-dur:8s;  --hf-delay:.3s;  --hf-tx:8px;  --hf-ty:-12px; --hf-rot0:-4deg; --hf-rot1:2deg;  --hf-rot2:-2deg; --hf-opacity:.22; animation-delay:.6s; }
.hf--2  { top: 22%; right: 7%;  font-size: 1.8rem; --hf-dur:10s; --hf-delay:1s;   --hf-tx:-6px; --hf-ty:-8px;  --hf-rot0: 2deg; --hf-rot1:-3deg; --hf-rot2: 1deg; --hf-opacity:.16; animation-delay:.9s; }
.hf--3  { top: 60%; left: 4%;   font-size: 1.3rem; --hf-dur:9s;  --hf-delay:.5s;  --hf-tx:5px;  --hf-ty:10px;  --hf-rot0: 0deg; --hf-rot1: 4deg; --hf-rot2:-2deg; --hf-opacity:.14; animation-delay:1.1s; }
.hf--4  { top: 72%; right: 5%;  font-size: 1.4rem; --hf-dur:11s; --hf-delay:2s;   --hf-tx:-8px; --hf-ty:-6px;  --hf-rot0:-2deg; --hf-rot1: 2deg; --hf-rot2: 3deg; --hf-opacity:.15; animation-delay:.4s; }
.hf--5  { top:  8%; right: 22%; font-size: 1.1rem; --hf-dur:7s;  --hf-delay:.8s;  --hf-tx:4px;  --hf-ty:-14px; --hf-rot0: 1deg; --hf-rot1:-2deg; --hf-rot2: 1deg; --hf-opacity:.12; animation-delay:1.3s; }
.hf--6  { top: 44%; right: 3%;  font-size: 1.5rem; --hf-dur:8.5s;--hf-delay:1.5s; --hf-tx:-5px; --hf-ty: 8px;  --hf-rot0: 3deg; --hf-rot1:-1deg; --hf-rot2: 2deg; --hf-opacity:.18; animation-delay:.7s; }
.hf--7  { top: 82%; left: 14%;  font-size: 1.1rem; --hf-dur:9.5s;--hf-delay:.4s;  --hf-tx:7px;  --hf-ty:-7px;  --hf-rot0:-1deg; --hf-rot1: 3deg; --hf-rot2:-1deg; --hf-opacity:.12; animation-delay:1.5s; }
.hf--8  { top: 32%; left: 3%;   font-size: .85rem; --hf-dur:12s; --hf-delay:0s;   --hf-tx:4px;  --hf-ty:-9px;  --hf-rot0: 0deg; --hf-rot1: 1deg; --hf-rot2:-1deg; --hf-opacity:.10; animation-delay:1.0s; }
.hf--9  { top: 52%; right: 10%; font-size: .8rem;  --hf-dur:9s;  --hf-delay:1.8s; --hf-tx:-7px; --hf-ty: 5px;  --hf-rot0: 2deg; --hf-rot1:-2deg; --hf-rot2: 1deg; --hf-opacity:.10; animation-delay:.5s; }
.hf--10 { top: 18%; left: 18%;  font-size: .78rem; --hf-dur:11s; --hf-delay:2.5s; --hf-tx:6px;  --hf-ty:-11px; --hf-rot0:-1deg; --hf-rot1: 2deg; --hf-rot2:-2deg; --hf-opacity:.09; animation-delay:.2s; }
.hf--11 { top: 68%; right: 18%; font-size: .82rem; --hf-dur:8s;  --hf-delay:1.2s; --hf-tx:-4px; --hf-ty: 9px;  --hf-rot0: 1deg; --hf-rot1:-3deg; --hf-rot2: 1deg; --hf-opacity:.10; animation-delay:1.7s; }
.hf--12 { top: 86%; right: 12%; font-size: .75rem; --hf-dur:10s; --hf-delay:.7s;  --hf-tx:5px;  --hf-ty:-8px;  --hf-rot0:-2deg; --hf-rot1: 1deg; --hf-rot2: 2deg; --hf-opacity:.09; animation-delay:2.0s; }

/* Badges de lenguajes */
.hf--lang {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-heading);
}
.hf--l1 { top: 38%; left: 2%;   color: #7c5ccb; --hf-dur:9s;  --hf-delay:0s;   --hf-tx:4px;  --hf-ty:-8px;  --hf-opacity:.28; animation-delay:.8s; }
.hf--l2 { top:  5%; left: 36%;  color: #e9c46a; --hf-dur:8s;  --hf-delay:1.4s; --hf-tx:-4px; --hf-ty: 7px;  --hf-opacity:.30; animation-delay:1.2s; }
.hf--l3 { top: 76%; left: 2%;   color: #4ecdc4; --hf-dur:11s; --hf-delay:.6s;  --hf-tx:6px;  --hf-ty:-10px; --hf-opacity:.26; animation-delay:.3s; }
.hf--l4 { top: 92%; right: 25%; color: #2a9d8f; --hf-dur:9.5s;--hf-delay:2s;   --hf-tx:-5px; --hf-ty: 5px;  --hf-opacity:.22; animation-delay:1.6s; }
.hf--l5 { top: 48%; left: 1%;   color: #f4a261; --hf-dur:10s; --hf-delay:1s;   --hf-tx:3px;  --hf-ty:-6px;  --hf-opacity:.25; animation-delay:.6s; }

/* Elipses decorativas */
.hf--ellipse {
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--primary);
  animation: hf-float-in .8s var(--ease-out-expo) forwards,
             hf-ellipse-spin var(--hf-dur, 20s) linear infinite;
}
@keyframes hf-ellipse-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.hf--e1 { top: 15%; right: 14%; width: 80px;  height: 48px;  opacity: 0; --hf-dur:22s; --hf-opacity:.08; animation-delay:1.0s; }
.hf--e2 { top: 55%; left:  8%;  width: 56px;  height: 56px;  opacity: 0; --hf-dur:28s; --hf-opacity:.06; animation-delay:1.4s; border-width: 1px; }
.hf--e3 { top: 80%; right: 8%;  width: 100px; height: 60px;  opacity: 0; --hf-dur:18s; --hf-opacity:.05; animation-delay:.8s; animation-direction: reverse; }

/* En móvil reducir opacidad de los elementos más pequeños */
@media (max-width: 768px) {
  .hf--10, .hf--11, .hf--12,
  .hf--l4, .hf--l5, .hf--e2, .hf--e3 { display: none; }
  .hf { --hf-opacity: .10; }
}

/* Respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .hf { animation: none; opacity: var(--hf-opacity, .14); }
  .hf--ellipse { animation: none; }
}


/* ═══════════════════════════════════════════════════════════
   TECH MARQUEE — slider infinito horizontal
   ═══════════════════════════════════════════════════════════ */
.tech-marquee-wrap {
  overflow: hidden;
  width: 100%;
  padding-block: .5rem;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.tech-marquee {
  display: flex;
  width: max-content;
  animation: marquee-scroll var(--marquee-speed, 28s) linear infinite;
}
.tech-marquee--reverse {
  animation-direction: reverse;
  animation-duration: var(--marquee-speed-rev, 32s);
}
.tech-marquee-track {
  display: flex;
  gap: 1rem;
  padding-inline: .5rem;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tech-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .82rem; font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: border-color .2s, color .2s;
  cursor: default;
  flex-shrink: 0;
}
.tech-pill:hover {
  border-color: var(--primary);
  color: var(--text);
}
.tech-pill-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
/* Pausa al hover del wrapper */
.tech-marquee-wrap:hover .tech-marquee { animation-play-state: paused; }

@media (max-width: 768px) {
  .tech-marquee { animation-duration: 20s; }
  .tech-marquee--reverse { animation-duration: 24s; }
}
@media (prefers-reduced-motion: reduce) {
  .tech-marquee { animation: none; }
  .tech-marquee-track:last-child { display: none; }
  .tech-marquee-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    mask-image: none; -webkit-mask-image: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   BLINDS REVEAL — efecto persianas en Sobre mí
   ═══════════════════════════════════════════════════════════ */
.blinds-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.blind-strip {
  flex: 1;
  background: var(--bg);
  transform-origin: top center;
  transform: scaleY(1);
  will-change: transform;
}

/* ═══════════════════════════════════════════════════════════
   SECTION FLOATING ELEMENTS (tecnologías, proyectos, servicios, contacto)
   ═══════════════════════════════════════════════════════════ */
.section-floats {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  overflow: hidden;
}

.sf {
  position: absolute;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-weight: 500;
  color: var(--primary-bright);
  opacity: 0;
  font-size: .72rem;
  animation: sf-float-in .7s var(--ease-out-expo) forwards var(--sf-delay, 0s),
             hf-float var(--sf-dur, 9s) ease-in-out infinite var(--sf-delay, 0s);
  will-change: transform, opacity;
  user-select: none;
  transition: transform .6s var(--ease-out-expo);
}

@keyframes sf-float-in {
  from { opacity: 0; transform: translateY(8px) scale(.9); }
  to   { opacity: var(--sf-opacity, .10); transform: none; }
}

@media (max-width: 768px) {
  .section-floats { opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
  .sf { animation: none; opacity: var(--sf-opacity, .10); }
}


/* ═══════════════════════════════════════════════════════════
   FOOTER FLOATING ELEMENTS (con interacción al cursor)
   ═══════════════════════════════════════════════════════════ */
.site-footer { position: relative; overflow: hidden; }

.footer-inner,
.footer-bottom { position: relative; z-index: 1; }

.footer-floats {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}

.ff {
  position: absolute;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-weight: 700;
  color: var(--primary-bright);
  opacity: 0;
  font-size: 1rem;
  animation: sf-float-in .8s var(--ease-out-expo) forwards var(--ff-delay, 0s),
             hf-float var(--ff-dur, 10s) ease-in-out infinite var(--ff-delay, 0s);
  will-change: transform, opacity;
  user-select: none;
  transition: transform .5s var(--ease-out-expo);
}

@media (max-width: 768px) {
  .footer-floats { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  .ff { animation: none; opacity: var(--ff-opacity, .12); }
}


/* ═══════════════════════════════════════════════════════════
   TRANSICIONES DE SECCIÓN (CURTAIN REVEAL)
   ═══════════════════════════════════════════════════════════ */

/* El container dentro de las secciones con cortina queda encima del telón */
.section > .container { position: relative; z-index: 2; }

/* Cada sección tiene un "telón" que cae sobre el contenido y se alza al entrar en viewport.
   El telón parte cubriendo el contenido (transform: scaleY(1)) y, al dispararse,
   se contrae hacia abajo (transform-origin: bottom → scaleY(0) = desaparece hacia abajo). */
.section { position: relative; }
.section-curtain {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  background: var(--bg-alt);
  transform-origin: bottom center;
  transform: scaleY(1);
  transition: transform .9s var(--ease-out-expo);
}
.section-curtain--light { background: var(--bg); }
.section.curtain-lifted .section-curtain { transform: scaleY(0); }

/* Variante diagonal — el telón desaparece recortado en diagonal */
.section-curtain--diagonal {
  transform-origin: top right;
  clip-path: polygon(0 0, 100% 0, 100% 110%, -10% 110%);
  transition: clip-path .95s var(--ease-out-expo);
}
.section.curtain-lifted .section-curtain--diagonal {
  clip-path: polygon(110% 0, 110% 0, 110% 110%, 110% 110%);
}

/* Línea divisora animada al pie de cada sección */
.section-divider {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 6;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--primary) 20%,
    var(--blue) 50%, var(--primary) 80%, transparent 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s .4s var(--ease-out-expo);
  opacity: 0;
}
.section.curtain-lifted .section-divider {
  transform: scaleX(1);
  opacity: .35;
}

/* Sin animación para preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .section-curtain { transition: none; transform: scaleY(0); }
  .section-divider  { transition: none; transform: scaleX(1); opacity: .35; }
}

/* ── Fullpage scroll: dots de navegación lateral ─────────── */
.fp-dots {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  opacity: 0;
  animation: fp-dots-in .6s 1.2s ease forwards;
}
@keyframes fp-dots-in {
  from { opacity: 0; transform: translateY(-50%) translateX(8px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.fp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--text-muted);
  padding: 0;
  cursor: pointer;
  transition: width .3s var(--ease-out-expo),
              height .3s var(--ease-out-expo),
              background .25s ease,
              border-color .25s ease,
              border-radius .3s ease;
  position: relative;
}
.fp-dot:hover {
  border-color: var(--primary);
  transform: scale(1.25);
}
.fp-dot.active {
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

@media (max-width: 768px) {
  .fp-dots { display: none; }
}

/* Cuando fullpage está activo las secciones NO necesitan min-height forzado;
   el JS salta a offsetTop de cada sección con scrollTo instant */
body.fp-active section {
  /* min-height: 100vh; — eliminado: causaba sección tecnologías gigante */
}
body.fp-active .stack-card {
  position: relative !important;
  top: auto !important;
  transform: none !important;
}

/* ── Overlay de transición entre secciones ───────────────── */
.fp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  will-change: transform;
  background: linear-gradient(
    150deg,
    var(--primary-dim)  0%,
    var(--primary)      45%,
    #1e3a8a             100%
  );
}
