/* ============
   Theme & Reset
   ============ */
:root {
  --bg: #0c0f16;
  --text: #e8ebf1;
  --muted: #aab1bf;
  --surface: #141a24;
  --border: #2a3242;
  --accent: #6ea8fe;
  --accent-2: #9bdbff;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
}

html[data-theme='light'] {
  --bg: #f7f9fc;
  --text: #1b2430;
  --muted: #536079;
  --surface: #ffffff;
  --border: #e5e9f2;
  --accent: #1f6feb;
  --accent-2: #9bd1ff;
  --shadow: 0 8px 24px rgba(31,111,235,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header / Hero */
.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)) ;
}
.hero {
  max-width: 1100px; margin: 0 auto; padding: 40px 20px;
  display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: center;
}
.avatar-wrap {
  width: 140px; height: 140px; border-radius: 50%; overflow: hidden;
  box-shadow: var(--shadow); border: 4px solid var(--surface);
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro h1 { margin: 0 0 6px 0; font-size: 2rem; }
.intro p { margin: 0 0 12px 0; color: var(--muted); }
.contacts { display: flex; flex-wrap: wrap; gap: 8px; align-items:center; color: var(--muted); }
.contacts .dot { color: var(--border); }
.cta-row { display: flex; gap: 10px; margin-top: 14px; }

/* Buttons */
.btn {
  background: var(--accent); color: #fff;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 14px; cursor: pointer; font-weight: 600;
  box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(1.05); }
.btn.outline { background: transparent; color: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn.small { padding: 6px 10px; font-size: .9rem; }
.toggle { white-space: nowrap; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.section { margin-top: 28px; }
.section h2 { font-size: 1.4rem; margin: 0 0 16px; border-left: 4px solid var(--accent); padding-left: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card {
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.card:hover { transform: translateY(-2px); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; gap: 12px; }
.card-title { margin: 0; font-size: 1.1rem; }
.card-sub, .card-meta { margin: 2px 0; color: var(--muted); font-size: .95rem; }

.card-body {
  display: grid; grid-template-columns: 260px 1fr; gap: 16px;
  padding: 0 16px 16px;
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease;
}
.card.open .card-body { padding: 16px; max-height: 560px; }

.card-media {
  width: 100%; height: 200px; border-radius: 14px; overflow: hidden;
  border: 1px dashed var(--border);
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.03), rgba(0,0,0,.03) 6px, rgba(255,255,255,.03) 6px, rgba(255,255,255,.03) 12px);
}
.card-img { width: 100%; height: 100%; object-fit: cover; display:block; }
.img-caption { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.card-desc { font-size: .98rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px; text-align: center; color: var(--muted);
}

/* EDUCACIÓN: imagen arriba y texto debajo también en escritorio */
#educationGrid .card-body{
  display: grid !important;
  grid-template-columns: 1fr !important;  /* antes: 260px 1fr */
  gap: 16px !important;
}
#educationGrid .card-media{ margin-bottom: 10px !important; }
#educationGrid .card-desc { margin-top: 6px !important; text-align: justify; }



/* Responsive */
@media (min-width: 640px) {
  .card { grid-column: span 6; }
}
@media (min-width: 980px) {
  .card { grid-column: span 4; }
}

@media (max-width: 640px){
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .contacts { justify-content: center; }
  .card-body { grid-template-columns: 1fr; }
}

