/* =======================================================================
   PORTAFOLIO — Rodrigo Valdés Cuevas
   Diseño: navy + slate + acento eléctrico. Modo claro/oscuro. Responsivo.
   ======================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-grad: linear-gradient(120deg, #38bdf8 0%, #818cf8 60%, #c084fc 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dark (default) */
[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-alt: #0e152a;
  --surface: #131c34;
  --surface-2: #1a2542;
  --border: #24304f;
  --text: #e8edf7;
  --text-dim: #9aa8c4;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
}

/* Light */
[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --border: #dfe6f1;
  --text: #0e1a33;
  --text-dim: #59668a;
  --shadow: 0 20px 45px -22px rgba(20, 40, 90, .25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; max-width: 100%; }
/* Cuando js/scroll-fx.js toma el control del scroll, el suavizado nativo debe
   apagarse: si no, el navegador anima encima y el scroll se siente a tirones. */
html.smooth-scroll { scroll-behavior: auto; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--accent-grad); color: #05101f; box-shadow: 0 8px 24px -8px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--icon { padding: 12px; border-radius: 50%; border-color: var(--border); color: var(--text); }
.btn--icon:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--full { width: 100%; }

/* ---- Nav --------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__logo { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: -.5px; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  padding: 8px 14px; border-radius: 8px; font-size: .92rem; font-weight: 500;
  color: var(--text-dim); transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: all .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
/* Botón de idioma: muestra la bandera del idioma al que se cambia */
.icon-btn--lang { font-size: 1.15rem; line-height: 1; padding: 0; }
.icon-btn--lang:hover { transform: translateY(-1px) scale(1.12); }
/* justify-content: center es indispensable — sin él los tres trazos quedan
   pegados a la parte superior del botón circular. */
.nav__burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav__burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav__progress { height: 2px; background: var(--accent-grad); width: 0; transition: width .1s linear; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 24px 80px; overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 50% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(50% 50% at 85% 20%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    radial-gradient(60% 60% at 60% 100%, color-mix(in srgb, #c084fc 16%, transparent), transparent 70%);
  animation: bgFloat 16s ease-in-out infinite alternate;
}
@keyframes bgFloat { to { transform: translate3d(0, -3%, 0) scale(1.05); } }
.hero__canvas { position: absolute; inset: 0; z-index: 1; opacity: .55; }
.hero__content { position: relative; z-index: 2; max-width: 860px; }
.hero__eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .5px; margin-bottom: 12px; }
.hero__name {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -1.5px;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 55%, var(--accent)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__role {
  font-family: var(--font-head); font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 600; color: var(--accent); margin-bottom: 18px; min-height: 1.5em;
}
.hero__role .cursor { color: var(--text-dim); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__avail {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 18px;
  padding: 7px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #34d399;
  background: color-mix(in srgb, #34d399 12%, transparent); border: 1px solid color-mix(in srgb, #34d399 40%, transparent);
}
.hero__avail .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: pulse 1.6s ease-in-out infinite; }
.hero__tagline { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-dim); max-width: 640px; margin: 0 auto 34px; }

/* Idiomas (Sobre mí) */
.about__langs { margin-top: 22px; display: grid; gap: 12px; max-width: 340px; }
.langs__title { font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.lang__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-size: .9rem; }
.lang__row small { color: var(--text-dim); font-size: .78rem; }
.lang__bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lang__bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent-grad); }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.service {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.service:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.service__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid var(--border);
}
.service__title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.service__desc { color: var(--text-dim); font-size: .92rem; }
.services__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 54px; }
.hero__metrics {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 620px; margin: 0 auto;
}
.hero__metrics li {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 10px;
  backdrop-filter: blur(6px);
}
.hero__metrics b { display: block; font-family: var(--font-head); font-size: clamp(1.4rem, 3.5vw, 2rem); color: var(--text); }
.hero__metrics small { color: var(--text-dim); font-size: .78rem; }
/* Indicador de scroll — "Deep Space": cometa con estela, estrellas y órbita */
.scrollcue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity .4s var(--ease);
}
.scrollcue__label {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 700;
  letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; color: var(--text-dim);
  transition: color .25s var(--ease);
}
.scrollcue:hover .scrollcue__label { color: var(--accent); }
.scrollcue__field { position: relative; width: 120px; height: 82px; display: block; }
.scrollcue__star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--text);
  opacity: .5; animation: cueTwinkle 3s ease-in-out infinite;
}
.scrollcue__star:nth-child(1) { left: 12%; top: 18%; animation-delay: 0s; }
.scrollcue__star:nth-child(2) { left: 82%; top: 12%; animation-delay: .6s; }
.scrollcue__star:nth-child(3) { left: 24%; top: 68%; animation-delay: 1.2s; }
.scrollcue__star:nth-child(4) { left: 70%; top: 74%; animation-delay: 1.8s; }
.scrollcue__star:nth-child(5) { left: 50%; top: 6%; animation-delay: 2.4s; width: 3px; height: 3px; }
@keyframes cueTwinkle { 0%,100% { opacity: .18; transform: scale(.8) } 50% { opacity: .9; transform: scale(1.2) } }
.scrollcue__comet {
  position: absolute; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 12px 3px color-mix(in srgb, var(--accent) 80%, transparent);
  animation: cueFall 2.6s cubic-bezier(.5, 0, .5, 1) infinite;
}
.scrollcue__comet::after {
  content: ""; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  width: 2px; height: 34px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 85%, transparent));
}
@keyframes cueFall { 0% { top: -8px; opacity: 0 } 18% { opacity: 1 } 82% { opacity: 1 } 100% { top: 82px; opacity: 0 } }
.scrollcue__orbit {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); width: 76px; height: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 50%;
  border-bottom-color: transparent;
}

/* ---- Sections ---------------------------------------------------------- */
.section { padding: 100px 0; }
.section--alt { background: var(--bg-alt); }
.section__kicker { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.section__title { font-family: var(--font-head); font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700; letter-spacing: -1px; margin-bottom: 14px; }
.section__lead { color: var(--text-dim); max-width: 620px; margin-bottom: 36px; }

/* ---- About ------------------------------------------------------------- */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.about__text p { margin-bottom: 16px; color: var(--text-dim); }
.about__text strong { color: var(--text); font-weight: 600; }
.about__loc { color: var(--text-dim); font-weight: 500; }
.about__chips { display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.chip {
  padding: 9px 16px; border-radius: 999px; font-size: .88rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---- Education --------------------------------------------------------- */
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.edu__item {
  display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.edu__item::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent-grad);
}
.edu__item:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.edu__icon {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.7rem; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid var(--border);
}
.edu__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.edu__title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.edu__badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.edu__badge--live {
  color: #34d399; background: color-mix(in srgb, #34d399 14%, transparent);
  border-color: color-mix(in srgb, #34d399 40%, transparent);
}
.edu__badge--live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; margin-right: 6px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.edu__inst { color: var(--accent); font-weight: 500; font-size: .9rem; margin-bottom: 8px; }
.edu__detalle { color: var(--text-dim); font-size: .92rem; }

/* ---- Filters ----------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); font-weight: 500; font-size: .9rem;
  cursor: pointer; transition: all .2s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.is-active { background: var(--accent-grad); color: #05101f; border-color: transparent; }

/* ---- Projects ---------------------------------------------------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--accent-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card__icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid var(--border);
}
.card__conf {
  font-size: .68rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #fbbf24; background: color-mix(in srgb, #fbbf24 14%, transparent);
  border: 1px solid color-mix(in srgb, #fbbf24 40%, transparent); padding: 4px 10px; border-radius: 999px;
}
.card__org { font-size: .8rem; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.card__title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.card__desc { color: var(--text-dim); font-size: .93rem; margin-bottom: 16px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.card__tag { font-size: .74rem; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim); }
.card__actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.card__link { font-size: .88rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.card__link:hover { gap: 10px; }
.card__play {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 999px;
  font-weight: 700; font-size: .88rem; cursor: pointer; color: #05101f; background: var(--accent-grad);
  border: 0; box-shadow: 0 8px 20px -8px var(--accent); transition: transform .2s var(--ease), box-shadow .2s;
}
.card__play:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -8px var(--accent); }
.is-hidden { display: none !important; }

/* Galería en tarjeta */
.card__gallery-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 600;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); transition: all .2s var(--ease);
}
.card__gallery-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); transform: translateY(-1px); }
.card__thumbs { display: flex; gap: 8px; margin-bottom: 14px; }
.card__thumb {
  position: relative; width: 60px; height: 44px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--border);
  transition: transform .2s var(--ease), border-color .2s; overflow: hidden;
}
.card__thumb:hover { transform: translateY(-2px) scale(1.05); border-color: var(--accent); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__thumb--novid { display: grid; place-items: center; }
.thumb__play {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; color: #fff;
  background: rgba(0,0,0,.35); text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 7, 18, .92); backdrop-filter: blur(6px); padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__stage { display: grid; place-items: center; max-width: min(1120px, 92vw); max-height: 82vh; }
/* Imágenes (certificados, fotos): tamaño natural, siempre completas */
.lightbox__stage img {
  max-width: min(1120px, 92vw); max-height: 82vh; width: auto; height: auto; object-fit: contain;
  border-radius: var(--radius); background: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
/* Video / juego: marco 16/9 */
.lb-video {
  width: min(1000px, 92vw); aspect-ratio: 16/9; max-height: 82vh; background: #000;
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.lb-video iframe, .lb-video video { width: 100%; height: 100%; border: 0; display: block; }
.lightbox__close {
  position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); font-size: 1.1rem;
  cursor: pointer; transition: background .2s;
}
.lightbox__close:hover { background: rgba(255,255,255,.22); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); font-size: 1.8rem;
  line-height: 1; cursor: pointer; transition: background .2s;
}
.lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }
.lightbox__bar {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px 16px; flex-wrap: wrap; justify-content: center;
  align-items: center; color: #e8edf7; font-size: .9rem; background: rgba(0, 0, 0, .55);
  padding: 9px 18px; border-radius: 999px; max-width: min(92vw, 720px);
  backdrop-filter: blur(6px);
}
/* Cada pieza conserva su ancho: nada se aplasta en pantallas chicas */
.lightbox__caption { opacity: .95; flex: 1 1 auto; min-width: 0; text-align: center; }
.lightbox__verify { flex: 0 0 auto; white-space: nowrap; }
.lightbox__counter { opacity: .7; font-variant-numeric: tabular-nums; flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 620px) {
  .lightbox__bar {
    flex-direction: column; gap: 8px; border-radius: 18px;
    width: min(92vw, 420px); padding: 12px 16px; bottom: 14px; font-size: .84rem;
  }
  .lightbox__caption { text-align: center; }
}
.lightbox__verify {
  color: #34d399; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, #34d399 16%, transparent); border: 1px solid color-mix(in srgb, #34d399 45%, transparent);
}
.lightbox__verify:hover { background: color-mix(in srgb, #34d399 28%, transparent); }

/* Modal del juego */
.game-modal { position: fixed; inset: 0; z-index: 210; display: flex; flex-direction: column; background: #05070f; }
.game-modal[hidden] { display: none; }
.game-modal__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.game-modal__title { font-family: var(--font-head); font-weight: 600; font-size: .98rem; color: var(--text); }
.game-modal__ctrl { display: flex; gap: 8px; }
.game-modal__btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; transition: all .2s var(--ease);
}
.game-modal__btn:hover { border-color: var(--accent); color: var(--accent); }
.game-modal__btn--close:hover { border-color: #f87171; color: #f87171; }
.game-modal__frame { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: stretch; background: #000; overflow: hidden; }
.game-modal__frame iframe { width: 100%; height: 100%; border: 0; }

/* ---- Juego de trivia con tortugas (canvas + panel) --------------------- */
.tg {
  width: min(920px, 100%); height: 100%; min-height: 0; display: flex; flex-direction: column;
  background: var(--bg); position: relative;
}
/* min-height:0 permite que el canvas se encoja en pantallas bajas en vez de
   empujar el panel de preguntas fuera de la vista. */
.tg__cv { width: 100%; flex: 1 1 auto; min-height: 110px; display: block; }
.tg__hud {
  position: absolute; top: 12px; left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none;
}
.tg__turn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .78rem; color: #fff;
  background: rgba(3,7,18,.62); border: 1px solid rgba(255,255,255,.18);
  padding: 7px 13px; border-radius: 999px; backdrop-filter: blur(6px);
}
.tg__turn i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tg__dice {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: #05101f;
  background: var(--accent-grad); padding: 7px 15px; border-radius: 12px;
  animation: tgDice .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tgDice { from { transform: scale(.4) rotate(-25deg); opacity: 0; } }

.tg__panel {
  flex: 0 1 auto; min-height: 0; padding: 16px 18px 18px; background: var(--surface);
  border-top: 1px solid var(--border); max-height: 56%; overflow-y: auto;
}
.tg__q {
  font-size: .96rem; font-weight: 600; line-height: 1.5; color: var(--text); margin-bottom: 13px;
}
.tg__opts { display: flex; flex-direction: column; gap: 8px; }
.tg__opt {
  text-align: left; padding: 11px 15px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; font-size: .88rem; line-height: 1.45; transition: all .2s var(--ease);
}
.tg__opt:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); transform: translateX(3px);
}
.tg__opt:disabled { opacity: .55; cursor: default; }
.tg__opt--go {
  text-align: center; background: var(--accent-grad); color: #05101f;
  border-color: transparent; font-weight: 700; flex: 0 0 auto;
}
.tg__form { display: flex; gap: 8px; }
.tg__form input {
  flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 16px;
}
.tg__form input:focus { outline: none; border-color: var(--accent); }
/* Pantallas de inicio, instrucciones, estudio y resultado */
.tg--full .tg__panel { max-height: 100%; flex: 1 1 auto; }
.tg__screen { display: flex; flex-direction: column; gap: 12px; }
.tg__screen--center { text-align: center; align-items: center; justify-content: center; min-height: 100%; }
.tg__title { font-family: var(--font-head); font-size: 1.12rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.tg__sub { font-size: .87rem; color: var(--text-dim); line-height: 1.55; }
.tg__note {
  font-size: .8rem; color: var(--text-dim); line-height: 1.5; padding: 10px 12px;
  border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.tg__names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tg__names label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--text-dim); }
.tg__names input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 16px;
}
.tg__names input:focus { outline: none; border-color: var(--accent); }
.tg__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tg__row .tg__opt { flex: 1 1 auto; text-align: center; }
.tg__rules { display: grid; gap: 7px; padding-left: 18px; font-size: .85rem; line-height: 1.55; color: var(--text-dim); }
.tg__rules li::marker { color: var(--accent); }
.tg__rules b { color: var(--text); }
.tg__study { list-style: none; display: grid; gap: 8px; }
.tg__card {
  display: flex; gap: 11px; padding: 11px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
}
.tg__num { font-family: var(--font-mono); font-size: .74rem; font-weight: 700; color: var(--accent); flex: 0 0 auto; }
.tg__cq { font-size: .84rem; line-height: 1.45; color: var(--text); margin-bottom: 5px; }
.tg__ca { font-size: .82rem; font-weight: 600; color: #34d399; line-height: 1.4; }
.tg__coin { font-size: 2.6rem; animation: tgSpin 1s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes tgSpin { from { transform: rotate(-360deg) scale(.3); opacity: 0; } }
.tg__winner { font-family: var(--font-head); font-size: 1.05rem; color: var(--accent); }
.tg__score { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tg__score div {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 20px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border); min-width: 116px;
}
.tg__score b { font-size: .88rem; color: var(--text); }
.tg__score span { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: var(--accent); }

.tg__msg { margin-top: 11px; font-size: .85rem; font-weight: 600; min-height: 1.2em; }
.tg__msg.is-ok { color: #34d399; }
.tg__msg.is-bad { color: #f87171; }

@media (max-width: 620px) {
  .game-modal__bar { padding: 9px 12px; gap: 8px; }
  .game-modal__title { font-size: .82rem; }
  .game-modal__btn { padding: 7px 12px; font-size: .78rem; }
  .tg__hud { top: 8px; left: 10px; right: 10px; }
  .tg__turn { font-size: .7rem; padding: 5px 10px; }
  .tg__panel { max-height: 62%; padding: 13px 14px 16px; }
  .tg__q { font-size: .9rem; }
  .tg__opt { font-size: .84rem; padding: 10px 13px; }
}
@media (max-width: 560px) {
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.4rem; }
  .lightbox__nav--prev { left: 8px; } .lightbox__nav--next { right: 8px; }
}

/* ---- Wall of achievements --------------------------------------------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.badge {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px; text-align: center; cursor: default;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  animation: floaty 6s ease-in-out infinite;
}
.badge:nth-child(3n) { animation-delay: -2s; }
.badge:nth-child(3n+1) { animation-delay: -4s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.badge:hover { transform: translateY(-8px) scale(1.03); border-color: var(--accent); box-shadow: var(--shadow); z-index: 5; }
.badge__logo {
  height: 40px; display: grid; place-items: center; margin-bottom: 12px; font-family: var(--font-head);
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.5px;
}
.badge__title { font-size: .9rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.badge__detail { font-size: .76rem; color: var(--text-dim); }
.badge--click { cursor: pointer; }
.badge__see { display: block; margin-top: 10px; font-size: .74rem; font-weight: 600; color: var(--accent); }
.badge__verify {
  display: inline-block; margin-top: 8px; font-size: .74rem; font-weight: 700; color: #34d399;
  padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, #34d399 12%, transparent);
  border: 1px solid color-mix(in srgb, #34d399 38%, transparent); transition: background .2s;
}
.badge__verify:hover { background: color-mix(in srgb, #34d399 22%, transparent); }
/* Tooltip */
.badge__tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(6px);
  width: 230px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .82rem; line-height: 1.45;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: all .25s var(--ease); z-index: 20;
  pointer-events: none;
}
.badge__tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--surface-2);
}
.badge:hover .badge__tip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Brand colors for logos */
.logo-google { background: linear-gradient(90deg,#4285F4,#EA4335,#FBBC05,#34A853); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo-cisco { color: #1BA0D7; }
.logo-udemy { color: #A435F0; }
.logo-asu { color: #8C1D40; }
.logo-uag { color: #C8102E; }
.logo-coursera { color: #0056D2; }
[data-theme="light"] .logo-asu { color: #8C1D40; }

/* ---- Skills ------------------------------------------------------------ */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.skill {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: border-color .3s, transform .3s;
}
.skill:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.skill__ico { font-size: 1.4rem; }
.skill__title { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.skill__items { display: flex; flex-wrap: wrap; gap: 8px; }
.skill__item {
  font-size: .82rem; padding: 6px 12px; border-radius: 8px; background: var(--surface-2);
  color: var(--text-dim); border: 1px solid var(--border);
}

/* ---- Contact ----------------------------------------------------------- */
.contact { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.contact__form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 16px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.contact__note { margin-top: 14px; font-size: .88rem; text-align: center; }
.contact__note.ok { color: #34d399; }
.contact__note.err { color: #f87171; }
.contact__side { display: flex; flex-direction: column; gap: 12px; }
.contact__link {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all .25s var(--ease);
}
.contact__link:hover { border-color: var(--accent); transform: translateX(4px); }
.contact__ico { font-size: 1.4rem; }
.contact__link small { display: block; color: var(--text-dim); font-size: .76rem; }
.contact__link b { font-weight: 600; font-size: .95rem; }

/* ---- Trampa anti-spam del formulario (invisible para personas) --------- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Botón flotante de WhatsApp (agujero negro) ------------------------ */
#waFab {
  position: fixed; right: 24px; bottom: 24px; width: 92px; height: 92px; z-index: 150;
  border: 0; background: transparent; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#waFab canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wafab__glyph {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
#waFab:hover .wafab__glyph, #waFab:focus-visible .wafab__glyph { transform: scale(1.14); }
.wafab__glyph svg { width: 29px; height: 29px; fill: #fff; filter: drop-shadow(0 0 8px rgba(0, 0, 0, .65)); }
.wafab__lbl {
  position: absolute; right: 100px; top: 50%; white-space: nowrap;
  transform: translateY(-50%) translateX(8px);
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; color: var(--text);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
#waFab:hover .wafab__lbl, #waFab:focus-visible .wafab__lbl { opacity: 1; transform: translateY(-50%) translateX(0); }
#waFab:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 50%; }
@media (max-width: 560px) {
  #waFab { width: 74px; height: 74px; right: 14px; bottom: 14px; }
  .wafab__glyph svg { width: 24px; height: 24px; }
  .wafab__lbl { display: none; }
}

/* ---- Asistontín: terminal inmersiva previa a WhatsApp -----------------
   Estética de consola, a juego con el resto del sitio (mono, acento,
   desencriptado). Nada de verde WhatsApp salvo la acción final.        */
.wabot {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center;
  background: radial-gradient(60% 60% at 50% 50%, rgba(3,7,18,.82), rgba(3,7,18,.95));
  backdrop-filter: blur(8px); padding: 20px;
}
.wabot[hidden] { display: none; }

.wabot__panel {
  position: relative; width: min(480px, 94vw); max-height: min(80vh, 680px);
  display: flex; flex-direction: column; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 30px 90px -20px rgba(0,0,0,.9),
              0 0 60px -20px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: waPop .34s cubic-bezier(.34,1.4,.64,1);
}
@keyframes waPop { from { opacity: 0; transform: translateY(26px) scale(.96); } }
/* Líneas de barrido: sensación de pantalla CRT */
.wabot__panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* Barra de título tipo terminal */
.wabot__head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
  border-bottom: 1px solid var(--border);
}
.wabot__avatar {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 18px -6px var(--accent);
}
.wabot__avatar svg { width: 28px; height: 28px; color: var(--accent); }
.mouse-ear, .mouse-eye { transform-origin: center; }
.wabot__avatar .mouse-ear { animation: earTwitch 3.4s ease-in-out infinite; }
.wabot__avatar .mouse-ear--r { animation-delay: .4s; }
@keyframes earTwitch { 0%,88%,100% { transform: rotate(0); } 92% { transform: rotate(-9deg); } 96% { transform: rotate(6deg); } }
.wabot__avatar .mouse-eye { animation: eyeBlink 4.2s steps(1) infinite; }
@keyframes eyeBlink { 0%,94%,100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }

.wabot__id { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.wabot__id b {
  font-family: var(--font-mono); font-size: .84rem; font-weight: 700; color: var(--text);
  letter-spacing: .02em;
}
.wabot__id small {
  font-family: var(--font-mono); font-size: .68rem; color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
}
.wabot__dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399; display: inline-block;
  box-shadow: 0 0 8px #34d399; animation: pulse 1.8s ease-in-out infinite;
}
.wabot__close {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: .8rem; flex: 0 0 auto;
  transition: all .2s var(--ease);
}
.wabot__close:hover { border-color: #f87171; color: #f87171; }

/* Conversación */
.wabot__chat {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(90% 60% at 20% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--bg);
  min-height: 190px;
}
.wabot__msg { max-width: 88%; font-size: .88rem; line-height: 1.6; animation: waIn .3s var(--ease); }
@keyframes waIn { from { opacity: 0; transform: translateY(8px); } }

/* Mensaje del asistente: prefijo de consola */
.wabot__msg--bot {
  align-self: flex-start; color: var(--text);
  padding: 11px 14px 11px 34px; position: relative;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  border-radius: 10px;
}
.wabot__msg--bot::before {
  content: "›"; position: absolute; left: 13px; top: 10px;
  font-family: var(--font-mono); font-weight: 700; color: var(--accent);
}
/* Respuesta del visitante */
.wabot__msg--user {
  align-self: flex-end; font-family: var(--font-mono); font-size: .82rem;
  padding: 9px 14px; border-radius: 10px; color: #05101f;
  background: var(--accent-grad); font-weight: 600;
}
.wabot__caret {
  display: inline-block; width: 7px; height: 1em; vertical-align: -2px; margin-left: 2px;
  background: var(--accent); animation: waBlink2 1s steps(1) infinite;
}
@keyframes waBlink2 { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

.wabot__preview {
  display: block; margin-top: 10px; padding: 11px 13px; border-radius: 9px;
  background: var(--bg); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim); line-height: 1.55;
}
/* Ficha de proyecto — estética retro de consola de 8 bits */
.ficha {
  margin: 2px 0; padding: 12px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(5,10,25,.9), rgba(5,10,25,.65));
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), 0 0 22px -8px var(--accent);
  font-family: var(--font-mono);
}
.ficha__top {
  display: flex; align-items: center; gap: 10px; padding-bottom: 9px; margin-bottom: 9px;
  border-bottom: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent);
}
.ficha__icon {
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 6px;
}
.ficha__name {
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); line-height: 1.25;
}
.ficha__rows { display: grid; gap: 5px; margin-bottom: 10px; }
.ficha__row { display: flex; align-items: baseline; gap: 7px; font-size: .7rem; }
.ficha__row dt { color: var(--text-dim); letter-spacing: .1em; flex: 0 0 auto; }
.ficha__row::after {
  content: ""; flex: 1; height: 0; order: 1;
  border-bottom: 1px dotted color-mix(in srgb, var(--text-dim) 45%, transparent);
}
.ficha__row dd { order: 2; color: var(--text); font-weight: 600; text-align: right; flex: 0 1 auto; }
.ficha__row dd.is-conf { color: #fbbf24; }
.ficha__row dd.is-ok { color: #34d399; }
.ficha__desc {
  font-size: .72rem; line-height: 1.6; color: var(--text-dim);
  padding-top: 9px; border-top: 2px dashed color-mix(in srgb, var(--accent) 25%, transparent);
}

.wabot__typing { display: flex; gap: 5px; align-items: center; padding: 13px 14px 13px 34px; }
.wabot__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: waBlink 1.3s infinite; }
.wabot__typing i:nth-child(2) { animation-delay: .18s; }
.wabot__typing i:nth-child(3) { animation-delay: .36s; }
@keyframes waBlink { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Opciones como comandos */
.wabot__actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.wabot__opt {
  padding: 9px 14px; border-radius: 8px; cursor: pointer; transition: all .2s var(--ease);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-dim);
}
.wabot__opt:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transform: translateY(-2px); box-shadow: 0 0 18px -8px var(--accent);
}
.wabot__opt--go {
  flex: 1; font-weight: 700; color: #05231a; border-color: transparent;
  background: linear-gradient(120deg, #25D366, #34d399);
  box-shadow: 0 8px 22px -10px #25D366;
}
.wabot__opt--go:hover { color: #05231a; background: linear-gradient(120deg, #2ee06f, #4ce4ad); transform: translateY(-2px); }
.wabot__opt--ghost { color: var(--text-dim); }
.wabot__form { display: flex; gap: 8px; width: 100%; }
.wabot__form input {
  flex: 1; padding: 10px 13px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 16px;
}
.wabot__form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

@media (max-width: 560px) {
  .wabot { padding: 12px; place-items: end center; }
  .wabot__panel { margin-bottom: 92px; max-height: 76vh; }
}

/* ---- Footer ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--text-dim); font-size: .86rem; }
.footer__legal {
  flex-basis: 100%; font-size: .76rem; line-height: 1.6; color: var(--text-dim);
  opacity: .85; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px;
}
.footer__legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Reveal animation --------------------------------------------------
   IMPORTANTE: por defecto TODO está visible. Solo cuando js/scroll-fx.js
   confirma que puede animar, añade `anim-ready` al <html> y entonces se
   ocultan para animarlos. Así, si el JS falla, no se pierde información. */
.reveal { transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .75s cubic-bezier(.22, 1, .36, 1); }

html.anim-ready .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition-delay: var(--reveal-delay, 0ms); /* escalonado entre hermanos */
  will-change: opacity, transform;
}
html.anim-ready .reveal.is-visible { opacity: 1; transform: none; will-change: auto; }

/* ---- Campo estelar de fondo (js/scroll-fx.js) -------------------------- */
#starfield {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
/* El contenido va por encima del campo estelar.
   OJO: no incluir aquí .nav — debe conservar su `position: fixed` para
   quedarse siempre visible al hacer scroll. */
.hero, main, .footer { position: relative; z-index: 1; }
.lightbox { z-index: 200; }
.game-modal { z-index: 210; }
/* Las secciones alternas se vuelven translúcidas para dejar ver las estrellas
   sin perder contraste de lectura. */
.section--alt { background: color-mix(in srgb, var(--bg-alt) 86%, transparent); }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 860px) {
  .nav__links {
    position: fixed; top: 66px; right: 0; left: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
    transform: translateY(-120%); transition: transform .35s var(--ease); box-shadow: var(--shadow);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 14px; border-radius: 10px; }
  .nav__burger { display: flex; justify-content: center; align-items: center; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .contact { grid-template-columns: 1fr; }
  .hero__metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .section { padding: 72px 0; }
  .hero__cta { gap: 10px; }
  .btn { padding: 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
