:root{
  --bg-dark:#070707;
  --bg-light:#0d0d0d;
  --accent:#00ffae;
  --text-main:#e0e0e0;
  --text-muted:#9aa0a6;
  --card:#121212;
  --link-hover:#caffdf;
}

/* Reset and base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Courier New", monospace;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-light) 100%);
  background-attachment: fixed;
  background-size: cover;
  color:var(--text-main);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.container{max-width:980px;margin:32px auto;padding:28px}

/* Header */
header{
  text-align:center;
  padding:28px 0 20px;
  border-bottom:1px solid rgba(0,255,174,0.06);
}
.typing{
  font-size:2.8rem;
  color:var(--accent);
  white-space:nowrap;
  overflow:hidden;
  border-right:2px solid var(--accent);
  display:inline-block;
  animation:blink-caret .75s step-end infinite;
}
@keyframes blink-caret{from,to{border-color:transparent}50%{border-color:var(--accent)}}
.realname{margin:6px 0 0 0;font-size:1rem;color:var(--text-main);opacity:.95;letter-spacing:.6px;font-weight:700}
.subtitle{font-size:1.05rem;color:var(--text-muted);margin-top:6px}
.cta{display:inline-block;margin-top:14px;padding:8px 14px;background:var(--accent);color:#071217;text-decoration:none;border-radius:6px;font-weight:700;box-shadow:0 4px 18px rgba(0,255,174,0.08)}

/* Global anchor styling */
a, a:visited { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); text-decoration: underline; }

/* Nav */
nav{
  margin-top:22px;
  padding:8px 12px;
  border-radius:14px;
  background:linear-gradient(180deg,#0f0f10,#0b0b0b);
  box-shadow:0 6px 22px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
}
nav ul{
  display:flex;
  justify-content:center;
  gap:12px;
  list-style:none;
  margin:0;
  padding:8px;
  flex-wrap:wrap;
}
nav a{
  display:inline-block;
  padding:10px 14px;
  color:var(--accent);
  text-decoration:none;
  background:transparent;
  border-radius:10px;
  border:1px solid rgba(0,255,174,0.12);
  transition:all 200ms ease;
  font-weight:700;
  letter-spacing:.4px;
  box-shadow:0 2px 6px rgba(0,0,0,0.5);
}
nav a:focus,nav a:hover{
  transform:translateY(-3px);
  background:var(--accent);
  color:#081018;
  box-shadow:0 8px 30px rgba(0,255,174,0.08);
}

/* Sections */
main{padding:18px 6px}
section{margin-top:28px}
section h2{
  color:var(--accent);
  margin:0 0 10px 0;
  font-size:1.25rem;
  border-bottom:1px solid rgba(0,255,174,0.06);
  padding-bottom:8px;
}

/* Sobre-mi collapsible styles */
.toggle-open{
  display:inline-block;
  margin:8px 0 12px 0;
  padding:8px 12px;
  background:transparent;
  color:var(--accent);
  border:1px solid rgba(0,255,174,0.08);
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
}
.collapsible-panel{
  max-height:0;
  overflow:hidden;
  transition:max-height .36s ease,opacity .28s ease, padding .28s ease;
  opacity:0;
  padding:0;
  border-left:4px solid rgba(0,255,174,0.04);
  margin-bottom:6px;
}
.collapsible-panel.open{
  opacity:1;
  padding:12px 14px;
  max-height:1200px;
}
h3{margin:12px 0 6px 0;color:var(--accent)}
.small{font-size:.95rem;color:var(--text-muted)}

/* Certification collapsible UI */
.cert-filters{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.cert-toggle{
  width:100%;
  text-align:left;
  padding:12px 16px;
  background:linear-gradient(90deg,#0f0f10,#0b0b0b);
  color:var(--accent);
  border:1px solid rgba(0,255,174,0.06);
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.cert-toggle::after{
  content:"▸";
  transform:rotate(0deg);
  transition:transform .25s ease;
  color:var(--text-muted);
  font-weight:700;
}
.cert-toggle.open::after{transform:rotate(90deg);color:var(--accent)}
.cert-panel{
  max-height:0;
  overflow:hidden;
  transition:max-height .35s ease,opacity .25s ease;
  opacity:0;
  padding:0 6px;
}
.cert-panel.open{
  opacity:1;
  padding:12px 6px 0 6px;
  max-height:1400px;
}

/* Grid and cards: enforce identical card heights */
.cert-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
  align-items:start;
}

/* Card sizing and layout */
.cert-card{
  background:linear-gradient(180deg,var(--card),#0e0e0e);
  border:1px solid rgba(0,255,174,0.08);
  border-radius:10px;
  padding:16px;
  text-align:center;
  transition:transform .25s ease,box-shadow .25s ease;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:260px;
  height:260px;
  box-sizing:border-box;
  overflow:hidden;
}
.cert-card:hover{transform:translateY(-6px);box-shadow:0 14px 40px rgba(0,255,174,0.06)}

/* Image wrapper that always occupies same area */
.img-wrap{
  width:100%;
  height:140px;
  border-radius:8px;
  overflow:hidden;
  background:rgba(255,255,255,0.02);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  flex: 0 0 auto;
}

/* image fills wrapper completely */
.cert-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:0;
  filter:grayscale(0%) brightness(1.02);
}

/* Content container to keep spacing consistent */
.cert-content{
  display:flex;
  flex-direction:column;
  gap:8px;
  flex: 1 1 auto;
  justify-content:space-between;
  min-height:calc(260px - 140px - 32px);
}

/* Text inside card */
.cert-card h4{margin:0;font-size:1rem;color:var(--text-main)}
.cert-card p{margin:0;font-size:.86rem;color:var(--text-muted)}
.cert-card a{display:inline-block;padding:8px 10px;background:var(--accent);color:#071217;text-decoration:none;border-radius:8px;font-weight:700;font-size:.86rem}

/* CV box */
.cv-box{
  background:linear-gradient(180deg,#0f0f10,#0b0b0b);
  border-radius:10px;
  padding:18px;
  margin-top:8px;
  border:1px solid rgba(0,255,174,0.06);
  text-align:center;
}
.cv-intro{color:var(--text-muted);margin-bottom:16px}
.cv-actions{display:flex;flex-direction:column;align-items:center;gap:12px}
.btn-download{padding:12px 18px;background:transparent;color:var(--accent);border:1px solid rgba(0,255,174,0.12);border-radius:10px;font-weight:800;cursor:pointer;transition:all .18s ease}
.btn-download:hover{background:var(--accent);color:#071217;transform:translateY(-3px)}
.external-links{display:flex;gap:18px;justify-content:center;margin-top:18px}
.external-link{color:var(--accent);text-decoration:none;border-bottom:1px dashed rgba(0,255,174,0.12);padding-bottom:2px;font-weight:700}
.external-link:hover{color:var(--link-hover)}

/* Modal base */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.6);
  z-index:1400;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.modal.open{opacity:1;pointer-events:all}
.modal-content{
  width:100%;
  max-width:640px;
  background:linear-gradient(180deg,#0f0f10,#0b0b0b);
  border:1px solid rgba(0,255,174,0.06);
  padding:18px;
  border-radius:10px;
  color:var(--text-main);
  box-shadow:0 12px 40px rgba(0,0,0,0.6);
  position:relative;
}
.modal-close{
  position:absolute;
  right:18px;
  top:18px;
  background:transparent;
  border:none;
  color:var(--text-main);
  font-size:18px;
  cursor:pointer;
}

/* Form inside modal */
.modal-content h3{margin:0 0 6px 0;color:var(--accent)}
.modal-desc{color:var(--text-muted);margin:0 0 12px 0}
#cv-request-form{display:flex;flex-direction:column;gap:10px}
#cv-request-form label{font-size:0.9rem;color:var(--text-muted)}
#cv-request-form input,#cv-request-form textarea{
  background:#0c0c0c;color:var(--text-main);border:1px solid rgba(0,255,174,0.06);padding:10px;border-radius:8px;font-family:inherit;
}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:6px}
.btn-primary{background:var(--accent);color:#071217;padding:10px 14px;border-radius:8px;border:none;cursor:pointer;font-weight:800}
.btn-secondary{background:transparent;color:var(--accent);padding:10px 12px;border-radius:8px;border:1px solid rgba(0,255,174,0.08);cursor:pointer}

/* Result messages */
.form-result{margin-top:10px;color:var(--text-muted);font-size:0.95rem}

/* Lightbox minimal styles */
.img-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.75);z-index:1200;opacity:0;pointer-events:none;transition:opacity .18s ease}
.img-modal.open{opacity:1;pointer-events:all}
.img-modal-content{position:relative;max-width:90%;max-height:90%;display:flex;flex-direction:column;align-items:center;gap:12px;padding:14px}
.img-modal img{max-width:780px;max-height:70vh;border-radius:8px;box-shadow:0 12px 40px rgba(0,0,0,0.6)}
.img-modal-close{position:absolute;top:6px;right:6px;background:transparent;border:none;color:var(--text-main);font-size:20px;cursor:pointer}
.img-modal-caption{color:var(--text-muted);font-size:0.95rem;text-align:center;max-width:90%}

/* Forms and footer */
ul{padding-left:18px}
label{display:block;font-size:.9rem;color:var(--text-muted);margin-bottom:6px}
input,textarea{width:100%;background:#0c0c0c;color:var(--text-main);border:1px solid rgba(0,255,174,0.06);padding:10px;border-radius:8px;font-family:inherit}
button{cursor:pointer;padding:10px 12px;border-radius:8px;border:none;background:var(--accent);color:#071217;font-weight:700}
footer{margin-top:34px;text-align:center;color:var(--text-muted);font-size:.9rem}

/* Responsive adjustments */
@media (max-width:920px){
  .cert-card{min-height:240px;height:240px}
  .img-wrap{height:130px}
  .cert-content{min-height:calc(240px - 130px - 32px)}
}
@media (max-width:640px){
  .cert-card{min-height:220px;height:220px}
  .img-wrap{height:110px}
  .cert-content{min-height:calc(220px - 110px - 32px)}
  .typing{font-size:2rem}
  .container{padding:18px}
}