/* ============================================================
   PORTAFOLIO PERSONAL — style.css
   Dark mode / Estilo técnico
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #0a0a0a;
  --bg-2:       #111111;
  --bg-3:       #181818;
  --border:     #252525;
  --border-2:   #333333;
  --text:       #e8e8e8;
  --text-muted: #777777;
  --text-dim:   #444444;
  --accent:     #c8f135;       /* verde lima eléctrico */
  --accent-2:   #8aff50;
  --accent-rgb: 200, 241, 53;
  --font-mono:  'Space Mono', monospace;
  --font-sans:  'Syne', sans-serif;
  --nav-h:      70px;
  --radius:     4px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Cursor personalizado ───────────────────────────────────── */
.cursor {
  width: 32px; height: 32px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, opacity 0.3s ease, width 0.2s ease, height 0.2s ease;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease;
}
body:has(a:hover) .cursor,
body:has(button:hover) .cursor {
  width: 48px; height: 48px;
  opacity: 0.6;
}

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

.accent { color: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  transition: border-color var(--transition), color var(--transition);
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag--sm { font-size: 0.65rem; padding: 3px 8px; }

/* ── Reveal al hacer scroll ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.btn--primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.2);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--full { width: 100%; justify-content: center; }

/* ── NAV ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  z-index: 100;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 2px;
}
.nav__logo-bracket { color: var(--accent); }
.nav__logo-name { color: var(--text); }

.nav__links {
  display: flex;
  gap: 2.5rem;
}
.nav__link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  position: relative;
  transition: color var(--transition);
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav__link:hover,
.nav__link.active { color: var(--accent); }
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }

.nav__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__menu-btn span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* ── Mobile menu ─────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 2rem;
  z-index: 99;
  transform: translateY(-110%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu ul { display: flex; flex-direction: column; gap: 1.5rem; }
.mobile-link {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.mobile-link:hover { color: var(--accent); }

/* ── HERO ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0.35;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 4rem 3rem;
}

.hero__title {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero__title-line {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.hero__title-name {
  display: block;
  font-size: clamp(3rem, 7vw, 6rem);
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.hero__bio {
  max-width: 520px;
  margin-bottom: 2.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-2);
}
.hero__bio p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
}
.hero__scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  writing-mode: vertical-rl;
}
.hero__scroll-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollLine 2s infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── SECCIONES GENERALES ─────────────────────────────────────── */
.section { padding: 7rem 0; }

.section__header {
  margin-bottom: 4rem;
}
.section__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}
.section__title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section__desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
}

/* ── SKILLS ─────────────────────────────────────────────────── */
.skills { background: var(--bg); }

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.skill-card:hover {
  border-color: var(--border-2);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.skill-card:hover::before { transform: scaleX(1); }

.skill-card__icon {
  width: 44px; height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--accent);
}
.skill-card__icon svg { width: 22px; height: 22px; }

.skill-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.skill-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.5rem;
}

/* ── PROYECTOS ─────────────────────────────────────────────── */
.projects { background: var(--bg-2); }

.projects__filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.filter-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), opacity 0.4s ease;
}
.project-card:hover {
  border-color: var(--border-2);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.project-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  display: none;
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-card__category {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.project-card__links { display: flex; gap: 10px; }
.project-link {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all var(--transition);
}
.project-link svg { width: 14px; height: 14px; }
.project-link:hover { border-color: var(--accent); color: var(--accent); }

.project-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.project-card__desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}
.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ── CONTACTO ────────────────────────────────────────────────── */
.contact { background: var(--bg); }

.contact__layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
  align-items: start;
}

/* Cuando no hay formulario, centrar en una columna */
.contact__layout--solo {
  grid-template-columns: 1fr;
  max-width: 560px;
}

.contact__text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact__link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
  word-break: break-all;
}
.contact__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.contact__link:hover { color: var(--accent); }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer__text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* Tablet grande */
@media (max-width: 1024px) {
  .hero__content { padding: 3.5rem 2.5rem; }
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet */
@media (max-width: 900px) {
  .contact__layout { grid-template-columns: 1fr; gap: 3rem; }
  .skills__grid { grid-template-columns: 1fr; }
}

/* Mobile grande */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .nav { padding: 0 1.25rem; }
  .nav__links { display: none; }
  .nav__menu-btn { display: flex; }

  .hero {
    min-height: 100svh;
    align-items: flex-start;
    padding-top: calc(var(--nav-h) + 1rem);
  }
  .hero__content {
    padding: 2rem 1.25rem 5rem;
    width: 100%;
    max-width: 100%;
  }
  /* El font-size escala con el ancho de pantalla para que el nombre
     siempre quepa en una línea. 9vw = ~34px en 375px de ancho. */
  .hero__title-name {
    font-size: 9vw;
    word-break: normal;
    hyphens: none;
    white-space: nowrap;
  }
  .hero__subtitle {
    font-size: 0.82rem;
    line-height: 1.7;
  }
  .hero__bio { margin-bottom: 2rem; }
  .hero__scroll-indicator { left: 1.25rem; }

  .section { padding: 4rem 0; }
  .section__title { font-size: clamp(1.8rem, 7vw, 2.5rem); }

  .skills__grid { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: 1fr; }

  .container { padding: 0 1.25rem; }

  body { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}

/* Mobile pequeño (< 480px) */
@media (max-width: 480px) {
  .hero__content { padding: 1.5rem 1rem 5rem; }
  /* 8.5vw = ~34px en 400px, ~30px en 360px — cabe en una línea */
  .hero__title-name {
    font-size: 8.5vw;
    white-space: nowrap;
  }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; }

  .nav { padding: 0 1rem; }
  .nav__logo { font-size: 0.9rem; }

  .skill-card { padding: 1.5rem; }
  .project-card { padding: 1.25rem; }

  .projects__filters { gap: 6px; }
  .filter-btn { padding: 6px 14px; font-size: 0.7rem; }

  .section__header { margin-bottom: 2.5rem; }
}

/* Mobile muy pequeño (< 360px) */
@media (max-width: 360px) {
  /* 8vw en 360px = ~29px — suficiente para nombres largos */
  .hero__title-name { font-size: 8vw; }
  .container { padding: 0 0.9rem; }
}