/* ============ Variables & Reset ============ */
:root {
  --bg: #0f1220;
  --bg-soft: #161a2b;
  --text: #e6e8ef;
  --muted: #a7adcf;
  --brand: #6ae3ff;
  --brand-2: #a78bfa;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 12px 30px rgba(0,0,0,.25);
  --radius: 16px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text); background: radial-gradient(1200px 800px at 10% -20%, #1d2240 10%, transparent 50%),
          radial-gradient(900px 600px at 110% 10%, #1b1535 20%, transparent 60%),
          var(--bg);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

/* ============ Header & Nav ============ */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .9rem 0; }
.brand { display: flex; gap:.6rem; align-items:center; font-weight: 800; letter-spacing:.2px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow); }
.nav a { font-weight: 600; color: var(--text); opacity:.9; }

/* Menú responsivo */
#menu-toggle { display: none; }
.links { display: flex; gap: 1rem; }
.links a { padding: .5rem .8rem; border-radius: 10px; }
.links a:hover { background: rgba(255,255,255,.06); }
@media (max-width: 760px) {
  .links { display: none; position: absolute; right: 1rem; top: 64px; flex-direction: column; background: var(--bg-soft); padding: .6rem; border-radius: 12px; width: calc(100% - 2rem); box-shadow: var(--shadow); }
  #menu-toggle:checked + label + .links { display: flex; }
  .menu-btn { cursor: pointer; padding: .4rem .6rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
}

/* ============ Hero ============ */
.hero { padding: 4.5rem 0 3rem; display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.5vw, 3.4rem); line-height: 1.15; margin: 0 0 .6rem; }
.hero p { color: var(--muted); margin: 0 0 1.2rem; }
.tag { display:inline-flex; align-items:center; gap:.5rem; font-size:.9rem; background: rgba(255,255,255,.06); padding:.35rem .6rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); }
.cta { display:flex; gap:.8rem; flex-wrap: wrap; margin-top: 1rem; }
.btn { display:inline-flex; align-items:center; gap:.5rem; padding:.75rem 1rem; border-radius: 12px; border:1px solid rgba(255,255,255,.1); font-weight: 700; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #0b1020; border: none; }
.btn.ghost { background: rgba(255,255,255,.04); }
.hero-card { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); border:1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }

@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* ============ Secciones ============ */
section { padding: 3rem 0; }
.section-title { font-size: 1.6rem; margin: 0 0 1.4rem; }

/* ============ Habilidades - Grid ============ */
.skills-grid { 
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Cambio aquí */
  gap: 1rem;
  justify-items: center;
}

.skill { 
  background: var(--bg-soft); 
  padding: 1.5rem; 
  border-radius: var(--radius); 
  box-shadow: var(--shadow); 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  text-align: center;
  height: 200px;
  justify-content: center;
  width: 100%;
}

.skill-icon { 
  width: 50px; 
  height: 50px; 
  margin-bottom: 0.8rem;
}

.skill span { 
  font-size: 1rem; 
  font-weight: 600; 
}

/* ============ Certificaciones - Grid ============ */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Cambio aquí */
  gap: 1rem;
  justify-items: center;
}

.certification {
  background: var(--bg-soft);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 200px;
  justify-content: center;
}

.cert-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 0.8rem;
}

.certification p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.certification a {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  border: none;
  display: inline-block;
  text-align: center;
}

.certification a:hover {
  background: var(--brand-2);
  cursor: pointer;
}

/* ============ Proyectos - Grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
}

/* ============ Tarjetas de Proyectos ============ */
.card {
  background: var(--bg-soft); 
  border:1px solid rgba(255,255,255,.08); 
  border-radius: var(--radius); 
  overflow: hidden; 
  box-shadow: var(--shadow); 
  display: flex; 
  flex-direction: column;
  height: 100%;  
}

.card .media { 
  background: linear-gradient(135deg, #2a2f53, #1a1f3b); 
  background-size: cover;  
  background-position: center;  
  aspect-ratio: 16/9; 
  display: grid; 
  place-items: center; 
  color: #c9d4ff; 
  font-weight: 800; 
  letter-spacing:.5px;
  height: 200px;  
}

.card .content { 
  padding: 1rem; 
  display: flex; 
  flex-direction: column; 
  gap:.6rem;
  flex-grow: 1;  
}

.card .actions { 
  display: flex; 
  gap: .6rem; 
  padding: 0 1rem 1rem; 
  margin-top: auto; 
  justify-content: center; 
}

/* Botones */
.card .actions .btn {
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 12px;
  color: white;
  background: var(--brand);
  border: none;
  display: inline-block;
  text-align: center;
}

.card .actions .btn:hover {
  background: var(--brand-2);
  cursor: pointer;
}

/* Animaciones */
section { opacity: 0; transition: opacity 1s ease-out; }
section.visible { opacity: 1; }
