:root {
  --bg: #07090e;
  --surface: rgba(16, 21, 32, 0.78);
  --surface-solid: #101520;
  --surface-hover: rgba(23, 30, 46, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(56, 189, 248, 0.38);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cyan: #38bdf8;
  --indigo: #818cf8;
  --emerald: #34d399;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Fondo arquitectónico sutil + iluminación ambiental */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.glow-1 {
  width: 460px;
  height: 460px;
  top: -140px;
  left: 12%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 70%);
}

.glow-2 {
  width: 420px;
  height: 420px;
  top: 220px;
  right: 8%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.22), transparent 70%);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar flotante */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 9, 14, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand-dot {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links .nav-cta {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-links .nav-cta:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan);
}

/* Hero Section */
.hero {
  padding: 84px 0 64px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.35rem, 5.5vw, 3.85rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 15%, var(--cyan) 60%, var(--indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-role .sep {
  color: var(--cyan);
  margin: 0 8px;
}

.hero-bio {
  max-width: 640px;
  font-size: 1.03rem;
  color: var(--text-secondary);
  margin-bottom: 34px;
}

.hero-bio strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0ea5e9);
  color: #05080f;
  box-shadow: 0 8px 24px -6px rgba(56, 189, 248, 0.45);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px -4px rgba(56, 189, 248, 0.6);
}

.btn-secondary {
  background: var(--surface-solid);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-bright);
  background: var(--surface-hover);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost.copied {
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.08);
}

/* Secciones */
.section {
  padding: 56px 0 0;
}

.section-head {
  margin-bottom: 26px;
}

.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 6px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.bento-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.bento-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  background: var(--surface-hover);
}

.bento-featured {
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.07) 0%, var(--surface) 55%);
}

.bento-studio {
  background: linear-gradient(160deg, rgba(129, 140, 248, 0.08) 0%, var(--surface) 55%);
}

.bento-wide {
  grid-column: span 2;
}

.wide-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-cyan {
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.pill-violet {
  background: rgba(129, 140, 248, 0.14);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.pill-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bento-card h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.bento-card p {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tech-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

.code-badge {
  flex-shrink: 0;
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.code-ok {
  color: var(--emerald);
}

/* Stack Grid */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.stack-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
}

.stack-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 12px;
}

.stack-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.stack-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stack-list {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.stack-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack-list li::before {
  content: "›";
  font-family: var(--font-mono);
  color: var(--cyan);
  font-weight: 700;
}

/* Timeline Formación */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -30px;
  top: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 2px solid var(--text-muted);
}

.timeline-marker.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.institution {
  font-size: 0.9rem;
  color: var(--cyan);
  font-weight: 500;
}

.timeline-detail {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(129, 140, 248, 0.08) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
}

.cta-box h2 {
  margin-bottom: 12px;
}

.cta-box p {
  max-width: 560px;
  margin: 0 auto 26px;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Footer */
footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive móvil */
@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 56px 0 40px;
  }

  .bento-grid,
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .bento-wide {
    grid-column: span 1;
  }

  .wide-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .code-badge {
    width: 100%;
    overflow-x: auto;
  }

  .timeline-header {
    flex-direction: column;
  }

  .cta-box {
    padding: 30px 20px;
  }
}

/* Versión optimizada si imprimen tu web como CV */
@media print {
  body {
    background: #ffffff;
    color: #111827;
  }
  .bg-grid, .bg-glow, .navbar, .hero-actions, .cta-box {
    display: none;
  }
  .bento-card, .stack-card, .timeline-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    break-inside: avoid;
  }
  .gradient-text {
    -webkit-text-fill-color: #111827;
  }
}