/* ── Variables ── */
:root {
  --navy: #1B2A4A;
  --navy-light: #2A3F6F;
  --navy-muted: #E8EDF5;
  --accent: #2563EB;
  --text: #111827;
  --muted: #6B7280;
  --bg: #F5F6F8;
  --white: #FFFFFF;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Scroll solo en main: html/body bloqueados ── */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Layout principal: dos columnas, altura fija al viewport ── */
.layout {
  display: flex;
  height: 100vh;
  padding: 32px 16px;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Sidebar: sin scroll, altura automática (ajusta al contenido) ── */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  align-self: flex-start;
}

.sidebar-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Card base ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

/* ── Avatar ── */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--navy-light);
  flex-shrink: 0;
}

/* ── Hero info ── */
.hero-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-role {
  font-size: 13px;
  color: var(--muted);
}

.hero-bio {
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}

/* ── Botón CV ── */
.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: 1.5px solid #D1D5DB;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  width: fit-content;
}

.cv-button:hover {
  background: var(--navy-muted);
  border-color: transparent;
}

.cv-button svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Location: pega debajo del contenido (no margin-top: auto) ── */
.loc-section {
  padding-top: 16px;
  border-top: 1px solid var(--navy-muted);
}

.loc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.loc-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.loc-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Columna principal: solo contenedor de scroll ── */
/* No puede ser también display:grid — el grid calcula altura antes del overflow */
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 99px; }

/* ── Grid del contenido principal (hijo del scroll container) ── */
.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-content: start;
  padding: 2px 16px 32px 2px; /* padding lateral da aire al scrollbar */
}

/* ── Spans de grilla ── */
.span-12 { grid-column: span 12; }
.span-8  { grid-column: span 8; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
.span-4  { grid-column: span 4; }
.span-3  { grid-column: span 3; }

/* ── Título de sección ── */
.section-title {
  grid-column: span 12;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-top: 8px;
}

/* ── Experiencia ── */
.card-exp h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
}

.exp-item {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.exp-item:last-child { margin-bottom: 0; }

.exp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}

.exp-role { font-size: 14px; font-weight: 600; color: var(--navy); }
.exp-company { font-size: 13px; color: var(--muted); }
.exp-period { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* ── Skills ── */
.skills-group { margin-bottom: 16px; }
.skills-group:last-child { margin-bottom: 0; }

.skills-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

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

.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid #E5E7EB;
}

.tag.accent {
  background: var(--navy-muted);
  color: var(--navy);
  border-color: transparent;
}

/* ── Proyectos ── */
.card-project {
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-project:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.project-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.project-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-desc {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-img {
  width: 100%;
  height: 110px;
  border-radius: 10px;
  background: var(--navy-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-img svg { opacity: .12; width: 36px; height: 36px; }

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid #E5E7EB;
  border-radius: 99px;
  padding: 3px 10px;
}
.metric-value { font-size: 11px; font-weight: 700; color: var(--accent); }
.metric-label { font-size: 11px; color: var(--muted); }

.project-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 16px;
  opacity: 0;
  color: var(--accent);
  transition: opacity .2s, transform .2s;
}

.card-project:hover .project-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ── Hobbies ── */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.hobby-item {
  /* wrapper sin estilos propios */
}

.hobby-img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: var(--navy-muted);
  position: relative;
  overflow: hidden;
}

.hobby-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.hobby-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 42, 74, 0.45);
  transition: opacity .4s ease;
  z-index: 0;
}

.hobby-img:hover::after {
  opacity: 0;
}

.hobby-img:hover img {
  transform: scale(1.03);
}

.hobby-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 1;
}

/* ── Contacto ── */
.card-contact {
  background: var(--navy);
  color: white;
}

.contact-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  transition: background .15s;
}

.contact-link:hover { background: rgba(255,255,255,.15); }
.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 860px) {
  html, body { height: auto; overflow: auto; }

  .layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    align-self: auto;
  }

  .main {
    overflow-y: visible;
    height: auto;
  }

  .hobbies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .span-7, .span-5, .span-6, .span-4, .span-8 { grid-column: span 12; }
  .main { gap: 12px; }
  .layout { padding: 16px 12px; }
}
