/* ============= Variables y reset ============= */
:root {
  --bg: #0a0e16;
  --bg-alt: #0f1421;
  --panel: #131a2a;
  --panel-2: #1a2238;
  --border: #1f2a44;
  --ink: #e6edf3;
  --muted: #8b96a8;
  --muted-light: #b2bccd;
  --accent: #4ade80;
  --accent-glow: rgba(74, 222, 128, 0.18);
  --accent-2: #60a5fa;
  --warn: #fbbf24;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============= Fondo decorativo ============= */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(74, 222, 128, 0.08), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.06), transparent 35%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  z-index: -1;
  pointer-events: none;
}

/* ============= Nav ============= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.brand-prompt { color: var(--accent); }
.brand-name { color: var(--ink); }
.brand-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  font-size: 0.92rem;
}
.nav-links a {
  color: var(--muted-light);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta {
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 6px 14px;
  border-radius: 6px;
}
.nav-links .nav-cta:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

@media (max-width: 640px) {
  .nav-links li:not(:last-child) { display: none; }
}

/* ============= Hero ============= */
.hero { padding: 80px 0 60px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 50px 0 40px; }
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.hero-header .eyebrow { margin-bottom: 0; }

.hero-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(74, 222, 128, 0.35);
  image-rendering: -webkit-optimize-contrast;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.hero-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2.5px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(74, 222, 128, 0.25);
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

h1 {
  font-size: clamp(2.4rem, 6vw, 3.7rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 22px;
}

.muted-light { color: var(--muted-light); font-weight: 500; }
.accent { color: var(--accent); }

.hero-sub {
  font-size: 1.08rem;
  color: var(--muted-light);
  max-width: 540px;
  margin-bottom: 30px;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: #6ee7a0;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--muted);
  background: var(--panel);
}

/* ============= Terminal card ============= */
.hero-card { width: 100%; }

.terminal {
  background: #050810;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(74, 222, 128, 0.05);
}
.terminal-bar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.terminal-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.terminal-bar .red { background: #ff5f56; }
.terminal-bar .yellow { background: #ffbd2e; }
.terminal-bar .green { background: #27c93f; }
.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.terminal-body {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86rem;
  padding: 18px 18px 22px;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt { color: var(--accent); margin-right: 4px; }
.output { color: var(--muted-light); }
.cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

/* ============= Sections ============= */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

@media (max-width: 640px) {
  .section { padding: 60px 0; }
}

.section-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 36px;
}

.prose p {
  font-size: 1.05rem;
  color: var(--muted-light);
  margin-bottom: 18px;
  max-width: 760px;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose .mono {
  background: var(--panel);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--accent);
}

/* ============= Stack grid ============= */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}
.stack-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.stack-card:hover {
  border-color: rgba(74, 222, 128, 0.3);
  transform: translateY(-2px);
}
.stack-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--ink);
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chips li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted-light);
  padding: 4px 10px;
  border-radius: 6px;
}
.chips li.chip-soft {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}
.chips li.chip-soft em { color: var(--accent); font-style: normal; }

/* ============= Credenciales ============= */
.creds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.cred-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
}
.cred-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.cred-heading svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.cred-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cred-list li { display: flex; flex-direction: column; gap: 4px; }
.cred-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}
.cred-meta {
  font-size: 0.78rem;
  color: var(--muted);
}
.lang-bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 100px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.lang-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 100px;
}

/* ============= Timeline ============= */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.timeline > li {
  position: relative;
  padding-bottom: 32px;
}
.tl-dot {
  position: absolute;
  left: -22px;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.tl-content header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.tl-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.tl-when {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}
.tl-content p {
  color: var(--muted-light);
  font-size: 0.98rem;
  max-width: 740px;
}
.tl-org { color: var(--accent-2); font-weight: 600; }
.tl-context {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
  margin-top: -2px;
}
.tl-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  max-width: 740px;
}
.tl-bullets li {
  color: var(--muted-light);
  font-size: 0.98rem;
  position: relative;
  padding-left: 18px;
}
.tl-bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 0.9em;
}
.tl-bullets li strong { color: var(--ink); font-weight: 600; }
.tl-dot-soft { background: var(--muted); box-shadow: 0 0 0 1px var(--muted); }

/* ============= Projects ============= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.project {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.2s;
}
.project:hover {
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateY(-2px);
}
.project header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.project h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted-light);
  border: 1px solid var(--border);
}
.badge-live {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.3);
}
.badge-prod {
  background: rgba(96, 165, 250, 0.12);
  color: var(--accent-2);
  border-color: rgba(96, 165, 250, 0.35);
}
.project p {
  color: var(--muted-light);
  font-size: 0.96rem;
}
.project-stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.project-stack li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
}
.project-stack li:not(:last-child)::after {
  content: " ·";
  color: var(--border);
  margin-left: 6px;
}
.project-links {
  display: flex;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.project-links a {
  color: var(--accent-2);
  transition: color 0.15s;
}
.project-links a:hover { color: var(--ink); }

/* ============= Contacto ============= */
.section-contact {
  padding: 100px 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.06), transparent 60%),
    var(--bg);
}
.contact-inner { text-align: center; }
.contact-inner .section-tag,
.contact-inner h2 { text-align: center; }
.contact-sub {
  color: var(--muted-light);
  max-width: 600px;
  margin: 0 auto 32px;
  font-size: 1.05rem;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}
.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-card-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.contact-card-value {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}

/* ============= Footer ============= */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}
.back-top {
  font-family: "JetBrains Mono", monospace;
  color: var(--muted-light);
  transition: color 0.15s;
}
.back-top:hover { color: var(--accent); }

/* ============= Selección ============= */
::selection {
  background: var(--accent-glow);
  color: var(--ink);
}
