/* ============================================================
   Jesús Vargas — Portafolio
   Tema: terminal dark, acentos cian/verde
   ============================================================ */

:root {
  --bg: #0a0e14;
  --bg-card: #11161f;
  --bg-card-hover: #161d29;
  --border: #1f2733;
  --text: #e6e9ef;
  --text-dim: #9aa4b2;
  --accent: #4cc9f0;
  --accent-2: #57e6a8;
  --amber: #f5b759;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* Fondo cuadriculado sutil */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}

/* ============ Topbar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.logo-dot { color: var(--accent-2); }

.nav { display: flex; gap: 1.6rem; }

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover { color: var(--accent); }

.lang-toggle {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.lang-toggle:hover { border-color: var(--accent); }

.lang-caret { color: var(--text-dim); font-size: 0.7rem; }

/* ============ Hero ============ */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

.prompt {
  font-family: var(--mono);
  color: var(--amber);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

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

.cursor {
  color: var(--accent-2);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-size: clamp(3rem, 8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.name-line1 { color: var(--text); }

.name-line2 {
  background: linear-gradient(95deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.hero-bio {
  color: var(--text-dim);
  max-width: 54ch;
  margin-bottom: 1.6rem;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: 1.8rem;
}

.chips li {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber);
  background: rgba(245, 183, 89, 0.06);
  border: 1px solid rgba(245, 183, 89, 0.35);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  transition: transform 0.15s, border-color 0.15s;
}

.chips li:hover { transform: translateY(-2px); border-color: var(--amber); }

.chips-sm { margin-bottom: 0; }

.chips-sm li { font-size: 0.74rem; padding: 0.24rem 0.55rem; }

/* Socials */
.socials { display: flex; gap: 0.7rem; }

.socials a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Foto */
.hero-photo { display: flex; justify-content: center; }

.photo-card {
  position: relative;
  border-radius: 24px;
  transform: rotate(2.5deg);
  transition: transform 0.35s ease;
}

.photo-card::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--amber));
  opacity: 0.35;
  filter: blur(26px);
  z-index: -1;
}

.photo-card:hover { transform: rotate(0deg) scale(1.02); }

.photo-card picture { display: block; }

.photo-card img {
  display: block;
  width: min(380px, 78vw);
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--border);
}

/* Segunda foto: crossfade al pasar el mouse.
   Solo se carga en dispositivos con hover real (escritorio):
   en móvil el background-image nunca se solicita. */
.photo-card .photo-alt {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .photo-card .photo-alt {
    background-image: url("/assets/hero-alt-760.webp");
    background-size: cover;
    background-position: center;
  }
  .photo-card:hover .photo-alt { opacity: 1; }
}

/* ============ Secciones ============ */
section { max-width: 1100px; margin: 0 auto; padding: 3.5rem 1.5rem; }

.section-title {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

/* Reveal al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============ Proyecto destacado ============ */
.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
}

.hero-text,
.featured-info,
.featured-terminal {
  min-width: 0;
}

.featured-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
}

.featured-info h3 {
  font-size: 2rem;
  margin: 0.8rem 0 0.6rem;
  background: linear-gradient(95deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.featured-info p { color: var(--text-dim); margin-bottom: 1.2rem; }

.featured-info .chips { margin-bottom: 1.6rem; }

/* Badges */
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
}

.badge-featured { color: var(--amber); border-color: rgba(245, 183, 89, 0.5); background: rgba(245, 183, 89, 0.08); }
.badge-ai { color: #c792ea; border-color: rgba(199, 146, 234, 0.5); background: rgba(199, 146, 234, 0.08); }
.badge-mobile { color: var(--accent-2); border-color: rgba(87, 230, 168, 0.5); background: rgba(87, 230, 168, 0.08); }
.badge-web { color: var(--accent); border-color: rgba(76, 201, 240, 0.5); background: rgba(76, 201, 240, 0.08); }
.badge-auto { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.5); background: rgba(255, 138, 138, 0.08); }

/* Botones */
.card-links { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: 0.88rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  color: #07101a;
  background: linear-gradient(95deg, var(--accent), var(--accent-2));
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(76, 201, 240, 0.25);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Mini terminal */
.featured-terminal {
  background: #0b1018;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  align-self: center;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2c3440;
}

.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal-body {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.8;
  padding: 1rem 1.2rem;
  overflow-x: auto;
}

.t-green { color: var(--accent-2); }
.t-cyan { color: var(--accent); }
.t-dim { color: var(--text-dim); }

/* ============ Grid de proyectos ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(76, 201, 240, 0.45);
  background: var(--bg-card-hover);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.card-lang {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

.card p { color: var(--text-dim); font-size: 0.92rem; flex: 1; margin-bottom: 1rem; }

.card-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.card-link:hover { color: var(--accent-2); }

.more-repos { text-align: center; margin-top: 2rem; }

.more-repos a {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.more-repos a:hover { color: var(--accent); }

/* ============ Stack ============ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.stack-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.stack-col h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent-2);
  margin-bottom: 1rem;
}

/* ============ Certificaciones ============ */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.9rem;
}

.cert {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}

.cert:hover {
  transform: translateY(-3px);
  border-color: rgba(87, 230, 168, 0.45);
}

.cert-check {
  color: var(--accent-2);
  font-family: var(--mono);
}

.cert-name {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.cert-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ============ Contacto ============ */
.contact { text-align: center; }

.contact-text {
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0 auto 1.8rem;
}

.contact-links { justify-content: center; }

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 3rem 1.5rem 2.2rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer-loc {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.footer-note {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
    text-align: left;
  }

  .hero-photo { order: -1; }

  .photo-card img { width: min(280px, 70vw); }

  .featured-card { grid-template-columns: 1fr; }

  .nav { display: none; }
}
