/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:     #0d0d0d;
  --white:     #ffffff;
  --off-white: #f7f5f2;
  --gray-100:  #f0eeeb;
  --gray-200:  #e0ddd8;
  --gray-400:  #9a9690;
  --gray-600:  #5c5955;
  --gray-800:  #2a2826;
  --accent:    #2D5BE3;

  --font-sans:  'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;

  --radius:    12px;
  --radius-sm:  8px;
  --max-w:     1160px;
  --nav-h:     68px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 40px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.nav-scrolled {
  border-color: var(--gray-200);
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-links { display: flex; gap: 36px; margin-left: auto; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  position: relative;
  transition: color .2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--black); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--black);
  border-radius: 100px;
  padding: 8px 20px;
  margin-left: 36px;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--black); color: var(--white); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 40px 80px;
  background: var(--off-white);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,91,227,.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,127,165,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { max-width: 820px; position: relative; z-index: 1; }

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  color: var(--black);
  margin-bottom: 28px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 100px;
  padding: 14px 32px;
  transition: all .2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gray-800); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--black); transform: translateY(-1px); }

.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: var(--gray-400);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

.section { padding: 100px 0; }
.section-dark { background: var(--black); color: var(--white); }
.section-soft { background: var(--gray-100); }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--black);
  margin-bottom: 48px;
}
.section-title.light { color: var(--white); }

.section-intro {
  font-size: 16px;
  color: var(--gray-600);
  max-width: 640px;
  margin-bottom: 60px;
  line-height: 1.7;
}

/* ============================================================
   SOBRE MÍ
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 80px;
  align-items: start;
}

.about-text h2 {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.about-role {
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 32px;
}
.about-body {
  font-size: 16px;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 20px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}
.skill-tag {
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  padding: 6px 16px;
  background: var(--white);
  transition: border-color .2s, background .2s;
}
.skill-tag:hover { border-color: var(--accent); background: var(--off-white); }

.edu-card {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 32px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.edu-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 28px;
}
.edu-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--gray-200);
}
.edu-item:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.edu-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  padding: 4px;
  flex-shrink: 0;
}
.edu-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}
.edu-school { font-size: 13px; color: var(--gray-600); }
.edu-date   { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ============================================================
   EXPERIENCIA TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 200px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 180px;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,.15);
}

.timeline-item {
  padding: 48px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 58px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(45,91,227,.25);
  z-index: 1;
}
@keyframes timeline-ping {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(4);   opacity: 0;  }
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: -29px;
  top: 58px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: timeline-ping 1.6s ease-out infinite;
  pointer-events: none;
}

.timeline-date {
  position: absolute;
  left: -200px;
  width: 160px;
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  top: 52px;
  line-height: 1.4;
}

.timeline-company {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.timeline-role {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: .3px;
}
.timeline-desc {
  font-size: 15px;
  color: rgba(255,255,255,.6);
  line-height: 1.75;
  max-width: 560px;
}

/* ============================================================
   PORTAFOLIO — GRID DE TARJETAS
   ============================================================ */
.tag-product  { color: #c8764a; font-weight: 600; }
.tag-ux       { color: #4a7fa5; font-weight: 600; }
.tag-presales { color: #8b6b4a; font-weight: 600; }

.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.pf-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.pf-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 56px rgba(0,0,0,.11);
  border-color: var(--accent);
}

.pf-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gray-200);
}
.pf-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.pf-card:hover .pf-img img { transform: scale(1.06); }

/* Hover overlay with role + year */
.pf-hover {
  position: absolute;
  inset: 0;
  background: rgba(13,13,13,.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity .3s ease;
}
.pf-card:hover .pf-hover { opacity: 1; }

.pf-role {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
}
.pf-year {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* Card footer */
.pf-info {
  padding: 20px 24px 24px;
}
.pf-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--black);
}
.pf-company {
  font-size: 13px;
  color: var(--gray-600);
}

/* ============================================================
   CERTIFICACIONES
   ============================================================ */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.cert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 16px 20px;
  cursor: pointer;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  /* reset button styles */
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.cert-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  border-color: var(--accent);
}

/* Logo wrapper — square icon */
.cert-logo-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cert-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

/* Preview variant: show cert as thumbnail (landscape, no padding) */
.cert-logo-wrap--preview {
  width: 80px;
  height: 56px;
  border-radius: 8px;
}
.cert-logo-wrap--preview img {
  object-fit: cover;
  padding: 0;
}

.cert-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 1.4;
}

/* ============================================================
   MODAL CERTIFICADO
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 32px 32px;
  transform: translateY(16px);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-overlay.is-open .modal-box { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  transition: color .15s;
}
.modal-close:hover { color: var(--black); }

.modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  padding-right: 40px;
}

#modalImg {
  width: 100%;
  border-radius: 8px;
  display: block;
}

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-section { padding: 120px 0; }
.contact-inner { text-align: center; }
.contact-inner .section-title { margin-bottom: 60px; }

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 14px 28px;
  transition: background .2s, border-color .2s, transform .2s;
}
.contact-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.6);
  transform: translateY(-2px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 24px 40px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.35);
}

/* ============================================================
   HAMBURGER / MOBILE MENU
   ============================================================ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
  margin-left: auto;
  z-index: 101;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
  transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 99;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  padding: 8px 24px 28px;
  flex-direction: column;
  gap: 0;
}
.nav-mobile-menu.is-open { display: flex; }

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.nav-mobile-links li {
  border-bottom: 1px solid var(--gray-100);
}
.nav-mobile-links a {
  display: block;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-600);
  transition: color .2s;
}
.nav-mobile-links a:hover { color: var(--black); }

.nav-mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--black);
  color: var(--white);
  border-radius: 100px;
  padding: 12px 24px;
  transition: background .2s;
  text-align: center;
}
.nav-mobile-cta:hover { background: var(--gray-800); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .edu-card { position: static; }
  .timeline { padding-left: 0; }
  .timeline::before { display: none; }
  .timeline-item::before { display: none; }
  .timeline-date {
    position: static;
    text-align: left;
    color: var(--accent);
    margin-bottom: 8px;
  }
  .case-studies { grid-template-columns: 1fr; }
  .case-card--wide { grid-column: auto; grid-template-columns: 1fr; }
  .case-card--wide .case-cover { height: 240px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-cta   { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 640px) {
  .nav { padding: 0 20px; }
  .container { padding: 0 20px; }
  .section { padding: 72px 0; }
  .hero { padding: calc(var(--nav-h) + 40px) 20px 60px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .certs-grid { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; align-items: center; }
}
