/* ============================================================
   Javier Cerón · Hoja de vida / portafolio en línea
   Diseño: híbrido claro/oscuro · Inter + Montserrat
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Montserrat:wght@700;800&display=swap");

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--brand-2);
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: "Montserrat", "Inter", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--brand);
  color: #fff;
}

/* ---------- Barra de navegación ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-line);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  margin-right: auto;
}

.nav-brand .monogram {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .85rem;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  color: var(--ink-2);
  font-size: .9rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 10px;
  transition: color .2s ease, background-color .2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--brand-soft);
}

.nav-links a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 12px;
  cursor: pointer;
  font-size: .95rem;
  transition: color .2s ease, background-color .2s ease, transform .12s ease;
}

.icon-btn:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.icon-btn:active {
  transform: scale(.94);
}

.btn-letter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  border: none;
  background: var(--brand-grad);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-letter:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow-md);
}

.btn-letter:active {
  transform: scale(.97);
}

.nav-toggle-btn {
  display: none;
}

/* ---------- Macro layout ---------- */

.site {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 3vw, 32px) 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 28px);
  align-items: start;
}

/* ---------- Columna lateral (perfil) ---------- */

.side {
  position: sticky;
  top: 84px;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 26px 22px;
  text-align: center;
}

.avatar-ring {
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
  padding: 4px;
  border-radius: 50%;
  background: var(--brand-grad);
  box-shadow: var(--shadow-sm);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
}

.profile-card .name {
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  font-weight: 800;
  color: var(--ink);
}

.profile-card .job {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.profile-about {
  margin: 16px 0 0;
  font-size: .86rem;
  color: var(--ink-2);
  text-align: left;
}

.profile-contacts {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 2px;
  text-align: left;
  font-size: .86rem;
}

.profile-contacts li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  padding: 6px 0;
}

.profile-contacts li i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .82rem;
  flex-shrink: 0;
}

.profile-contacts a {
  color: var(--ink-2);
}

.profile-contacts a:hover {
  color: var(--brand);
}

.social-row {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social-row a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 1.05rem;
  transition: transform .15s ease, color .2s ease, border-color .2s ease, background-color .2s ease;
}

.social-row a:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}

.profile-cta {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  font-family: "Inter", sans-serif;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--brand-grad);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ---------- Contenido principal ---------- */

.content {
  display: grid;
  gap: clamp(22px, 3vh, 32px);
  min-width: 0;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: clamp(18px, 2.4vw, 26px);
  scroll-margin-top: 88px;
}

html.js .section-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s cubic-bezier(.23, 1, .32, 1), transform .45s cubic-bezier(.23, 1, .32, 1);
}

html.js .section-card.in-view {
  opacity: 1;
  transform: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

.section-title .badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.section-title small {
  font-family: "Inter", sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-left: auto;
  text-transform: none;
}

.justify_text {
  text-align: justify;
  color: var(--ink-2);
  font-size: .95rem;
}

/* ---------- Experiencia: timeline ---------- */

.timeline {
  position: relative;
  padding-left: 26px;
  /* Sin numeración: el punto LED es la viñeta (los numerales del <ol>
     se montaban sobre el marcador) */
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 22px 14px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 3px var(--brand-soft), 0 0 10px var(--led-glow);
  border: 2px solid var(--surface);
  transition: box-shadow .3s ease;
}

.timeline li:hover::before {
  box-shadow: 0 0 0 4px var(--brand-soft), 0 0 16px var(--led-glow);
}

.timeline .t-role {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.timeline .t-company {
  display: block;
  color: var(--brand);
  font-size: .88rem;
  font-weight: 600;
  margin-top: 1px;
}

.timeline .t-date {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------- Grids de educación / certificaciones ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edu-item {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 16px 18px;
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}

.edu-item:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.edu-item .e-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  text-wrap: balance;
}

.edu-item .e-school {
  display: block;
  font-size: .84rem;
  color: var(--ink-2);
  margin-top: 2px;
}

.edu-item .e-date {
  display: inline-block;
  margin-top: 10px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.edu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: .82rem;
  font-weight: 600;
}

.edu-link i {
  font-size: .7rem;
}

/* ---------- Habilidades: chips ---------- */

.chip-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 18px 0 10px;
}

.chip-heading:first-child {
  margin-top: 0;
}

.chip-heading i {
  color: var(--brand);
  font-size: .95rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: default;
  transition: transform .15s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.chip i {
  color: var(--brand);
  font-size: 1.05rem;
  min-width: 18px;
  text-align: center;
}

.chip:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ---------- Otros conocimientos: tags estáticos ---------- */

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

html.js .tags-container:not(.in) .tag {
  opacity: 0;
  transform: translateY(8px);
}

html.js .tags-container.in .tag {
  opacity: 1;
  transform: none;
  transition: opacity .45s cubic-bezier(.23, 1, .32, 1), transform .45s cubic-bezier(.23, 1, .32, 1);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease;
  position: relative;
  cursor: help;
}

.tag::after {
  content: attr(data-description);

  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);

  width: 280px;
  padding: 10px 12px;

  background: #222;
  color: #fff;

  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: normal;
  text-align: left;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.2s ease;
  z-index: 1000;
}

.tag:hover::after {
  opacity: 1;
  visibility: visible;
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Mojones de color (6 pastos suaves) para agrupar visualmente */
.tag.c0 { background: var(--brand-soft); color: var(--brand); }
.tag.c1 { background: var(--amber-soft); color: var(--amber); }
.tag.c2 { background: var(--sky-soft); color: var(--sky); }
.tag.c3 { background: var(--brand-soft); color: var(--brand-2); }
.tag.c4 { background: var(--amber-soft); color: var(--amber); }
.tag.c5 { background: var(--sky-soft); color: var(--sky); }

/* ---------- Página de contacto ---------- */

.form-card p.lead {
  color: var(--ink-2);
  font-size: .92rem;
}

.note-link {
  font-size: .86rem;
}

/* ---------- Modal (carta de presentación) ---------- */

.popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 12, 22, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.popup.open {
  display: flex;
}

.popup-content {
  position: relative;
  width: min(680px, 100%);
  max-height: min(78vh, 640px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  padding: clamp(22px, 4vw, 34px);
  animation: modal-in .22s cubic-bezier(.23, 1, .32, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.popup-content .close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 1rem;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .15s ease;
}

.popup-content .close:hover {
  color: #dc2626;
  border-color: #dc2626;
}

.popup-content .close:active {
  transform: scale(.92);
}

.letter {
  clear: both;
  text-align: justify;
  font-size: .93rem;
  color: var(--ink-2);
}

.letter h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.letter h3 i {
  color: var(--brand);
}

.letter p + p {
  margin-top: 12px;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 32px) 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--nav-line);
  margin-top: clamp(18px, 3vh, 30px);
  color: var(--ink-3);
  font-size: .8rem;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  cursor: help;
}

.footer-version i {
  color: var(--brand);
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .site {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
  }

  .avatar-ring {
    width: 112px;
    height: 112px;
  }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--nav-line);
    box-shadow: var(--shadow-md);
    padding: 12px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 12px 14px;
    font-size: .95rem;
  }

  .nav-toggle-btn {
    display: grid;
  }

  .nav-actions .btn-letter span {
    display: none;
  }

  .btn-letter {
    padding: 0;
    width: 40px;
    height: 40px;
    justify-content: center;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site {
    padding-inline: 12px;
  }

  .profile-card {
    padding: 20px 16px;
  }

  .timeline {
    padding-left: 22px;
  }
}

/* ---------- Accesibilidad: movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .section-card,
  html.js .section-card {
    opacity: 1;
    transform: none;
  }
}