:root {
  --bg: #0b0f1a;
  --panel: #0f172a;
  --card: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #22d3ee;
  --brand-2: #a78bfa;
  --ring: rgba(34, 211, 238, 0.45);
  --radius: 1.25rem;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", Arial, "Noto Sans";
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

/* Nav */
header.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.85),
    rgba(2, 6, 23, 0.65)
  );
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrap {
  display: inline-grid;
  place-items: center;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.25);
}

.logo-plate {
  display: grid;
  place-items: center;
  background: #e8eef7;
  border-radius: 999px;
  padding: 6px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.brand .title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.cta {
  display: flex;
  gap: 10px;
}

.btn {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.15),
    rgba(167, 139, 250, 0.15)
  );
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-1px);
}

.ghost {
  background: transparent;
  box-shadow: none;
}

/* HERO */
section.hero {
  padding: 72px 0 36px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: radial-gradient(
      90rem 40rem at 50% -10%,
      rgba(34, 211, 238, 0.12),
      transparent
    ),
    radial-gradient(
      60rem 30rem at 100% 10%,
      rgba(167, 139, 250, 0.1),
      transparent
    );
}

.hero-grid {
  width: min(1200px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(36vw, 380px);
  align-items: center;
  gap: clamp(24px, 6vw, 64px);
  padding-block: clamp(32px, 8vw, 96px);
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-right {
    justify-self: center;
  }
}

.hero-left {
  max-width: 720px;
}

.hero-title {
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.1;
  margin: 0 0 12px;
}

.hero-lead {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 18px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Typewriter: gradiente solo con contenido */
#typer {
  display: inline-block;
  white-space: nowrap;
  min-width: 8ch;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-image: linear-gradient(90deg, var(--brand), var(--brand-2));
}

#typer:empty {
  background-image: none;
}

#bitron-helper-bubble {
  position: fixed;
  bottom: 105px;
  right: 100px;
  background: #00cfff;
  color: #000;
  padding: 10px 14px;
  border-radius: 20px;
  box-shadow: 0 0 10px #00cfff80;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 9998;
  animation: floaty 3s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

#bitron-helper-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 10px;
  border-width: 6px;
  border-style: solid;
  border-color: #00cfff transparent transparent transparent;
}

/* animación tipo flotante */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* Ocultar cuando el panel está abierto */
#bitron-panel:not(.hidden) ~ #bitron-helper-bubble {
  display: none;
}

/* Logo derecho */
.hero-right .logo-wrap {
  width: clamp(220px, 28vw, 360px);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

#bitron-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
  animation: pulse 2s infinite;
}

#bitron-button img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 20px #00f0ff;
}

/* Panel */
#bitron-panel {
  position: fixed;
  bottom: 110px;
  right: 20px;
  /* <- también a la derecha */
  width: 300px;
  background: #111;
  border: 2px solid #00f0ff;
  border-radius: 12px;
  padding: 10px;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

/* Efecto de resplandor azul titilante */
@keyframes cyberpulse {
  0% {
    filter: drop-shadow(0 0 4px #00cfff) drop-shadow(0 0 8px #00cfff);
  }

  50% {
    filter: drop-shadow(0 0 12px #00eaff) drop-shadow(0 0 24px #00eaff);
  }

  100% {
    filter: drop-shadow(0 0 4px #00cfff) drop-shadow(0 0 8px #00cfff);
  }
}

#bitron-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 300px;
  background: #121212;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 255, 159, 0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#bitron-panel.hidden {
  display: none;
}

.bitron-header {
  background-color: #00ffff;
  color: #000;
  padding: 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bitron-log {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  color: white;
}

.bitron-msg {
  background-color: #333;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  max-width: 90%;
}

.bitron-msg.bot {
  background-color: #444;
  color: #ccc;
}

#bitron-panel form {
  display: flex;
  border-top: 1px solid #00ff9f30;
}

#bitron-input {
  flex: 1;
  padding: 10px;
  border: none;
  background: #1e1e1e;
  color: #fff;
}

#bitron-input:focus {
  outline: none;
}

#bitron-panel button {
  background: #00ff9f;
  color: #000;
  border: none;
  padding: 0 16px;
  cursor: pointer;
}

.hero-right .logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Secciones */
section {
  padding: 56px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.section-title h2 {
  font-size: clamp(22px, 2.4vw, 32px);
  margin: 0;
  font-weight: 900;
}

.section-title .pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--panel);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 800;
}

.badge {
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 18px;
}

/* Skills */
.grid.skills {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.skill h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.mini {
  font-size: 12px;
}

/* Projects */
.grid.projects {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

@media (max-width: 1200px) {
  .grid.projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid.projects {
    grid-template-columns: 1fr;
  }
}

.project {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project .thumb {
  aspect-ratio: 16/10;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.2),
    rgba(167, 139, 250, 0.2)
  );
}

.project .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project h3 {
  margin: 0;
}

.project p {
  margin: 0;
  color: var(--muted);
}

.project .links {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.chip {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* Contacto */
form.contact {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 700;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: var(--panel);
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 3px solid var(--ring);
  border-color: transparent;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

/* Footer */
footer {
  padding: 22px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

/* Modal proyecto */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.modal {
  width: min(1000px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: var(--text);
  font-size: 22px;
  border-radius: 10px;
  width: 36px;
  height: 36px;
}

.modal-body {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.2fr 0.8fr;
}

@media (max-width: 900px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-gallery {
  display: grid;
  gap: 10px;
}

.gallery-main {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.g-prev,
.g-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(2, 6, 23, 0.55);
  color: #fff;
  font-size: 28px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.g-prev {
  left: 10px;
}

.g-next {
  right: 10px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow: auto;
}

.gallery-thumbs img {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}

.gallery-thumbs img.active {
  border-color: rgba(34, 211, 238, 0.6);
}

/* Mobile */
.menu-btn {
  display: none;
}

/* Burbuja flotante tipo ayuda */
#bitron-helper-bubble {
  position: fixed;
  bottom: 100px;
  right: 100px; /* <-- Cambiado de left a right */
  background: #0ff;
  color: #000;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: 20px;
  box-shadow: 0 0 10px #0ff;
  z-index: 9998;
  animation: burbuja-bitron 2s infinite alternate;
}

/* Animación de pulso */
@keyframes pulso-bitron {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px #0ff);
  }

  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px #0ff);
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px #0ff);
  }
}

/* Animación de la burbuja */
@keyframes burbuja-bitron {
  0% {
    transform: translateY(0px);
  }

  100% {
    transform: translateY(-5px);
  }
}

/* Panel de Bitron */
#bitron-panel {
  position: fixed;
  bottom: 90px;
  right: 20px; /* <-- Cambiado de left a right */
  width: 320px;
  background: #111;
  color: #fff;
  border: 2px solid #0ff;
  border-radius: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 400px;
  transition: all 0.3s ease;
}

#bitron-panel.hidden {
  display: none;
}

.bitron-header {
  background: #0ff;
  color: #000;
  font-weight: bold;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bitron-log {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #222;
  font-size: 14px;
}

.bitron-msg {
  margin: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 90%;
  font-size: 0.9rem;
}

.bitron-msg.user {
  background: #00f0ff1a;
  color: #00f0ff;
  align-self: flex-end;
  text-align: right;
}

.bitron-msg.bot {
  background: #222;
  color: #ccc;
  align-self: flex-start;
}

#bitron-panel form {
  display: flex;
  border-top: 1px solid #0ff;
}

#bitron-input {
  flex: 1;
  padding: 10px;
  border: none;
  background: #000;
  color: #0ff;
}

#bitron-input:focus {
  outline: none;
}

#bitron-panel button {
  padding: 10px;
  background: #0ff;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.mobile {
  display: none;
}

@media (max-width: 900px) {
  nav ul {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .mobile {
    position: absolute;
    inset: 60px 0 auto 0;
    background: var(--panel);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    padding: 12px 18px;
  }

  .mobile a {
    display: block;
    padding: 14px;
    border-radius: 12px;
  }
}

.popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1f1f1f;
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  z-index: 9999;
}

.popup.show {
  opacity: 1;
  transform: translateY(0);
}

.popup.hidden {
  display: none;
}

.popup .checkmark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #00ff9f;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: checkmark-anim 0.6s ease-out forwards;
}

@keyframes checkmark-anim {
  0% {
    stroke-dasharray: 0 50;
    stroke-dashoffset: 50;
    opacity: 0;
  }

  100% {
    stroke-dasharray: 50 0;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .g-prev,
  .g-next {
    transition: none;
  }
}

/* POPUP de éxito */
.popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1f1f1f;
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  z-index: 9999;
}

.popup.show {
  opacity: 1;
  transform: translateY(0);
}

.popup.hidden {
  display: none;
}

.popup .checkmark {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #00ff9f;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: pop-check 0.6s ease-out forwards;
}

@keyframes pop-check {
  0% {
    stroke-dasharray: 0 50;
    stroke-dashoffset: 50;
    opacity: 0;
  }

  100% {
    stroke-dasharray: 50 0;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}
