:root{
  --primary:#092c3a;
  --secondary:#2fb2c0;
  --text:#f0f4ff;
  --card:#121826;
  --aqua:#4edbac;
}

/* RESET */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
}

body{
  color:var(--text);
  min-height:100vh;
  overflow-x:hidden;
}

/* ======================
   FONDO (CANVAS)
   ====================== */
#bg{
  position:fixed;
  inset:0;
  z-index:-1;
  display:block;
  background:
    radial-gradient(60vw 60vh at 20% -10%, rgba(127,255,212,.15), transparent 60%),
    linear-gradient(120deg,var(--primary),var(--secondary));
  background-size:400% 400%;
  animation:gradient 18s ease infinite;
}
@keyframes gradient{
  0%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
  100%{background-position:0% 50%;}
}

/* ======================
   HERO
   ====================== */
.hero{
  text-align:center;
  padding:3rem 1rem;
  position:relative;
  z-index:1;
}

.profile-pic{
  width:120px;
  height:120px;
  border-radius:50%;
  border:3px solid var(--aqua);
  box-shadow:0 0 20px rgba(127,255,212,.4);
}

.hero h1{
  font-size:2rem;
  margin-top:1rem;
  color:#fff;
}

.tagline{
  color:#bfe9ff;
  margin-top:0.5rem;
}

.location{
  font-size:0.9rem;
  color:#e3f2fd;
}

/* ======================
   BOTONES (FIX iPhone REAL)
   ====================== */
.buttons{
  margin-top:1rem;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px;
}

/* Base (botones + links tipo botón) */
.buttons button,
.buttons a.button-link{
  -webkit-appearance: none;
  appearance: none;

  background:rgba(255,255,255,0.12);
  border:1px solid rgba(255,255,255,0.25);

  padding:10px 18px;
  border-radius:30px;

  cursor:pointer;
  text-decoration:none;
  font-weight:600;

  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;

  backdrop-filter:blur(6px);
  transition:all .25s ease;

  /* Ayuda a que en iOS se note el texto sobre fondos claros */
  text-shadow: 0 1px 10px rgba(0,0,0,.25);
}

/* Hover */
.buttons button:hover,
.buttons a.button-link:hover{
  background:#ffffff;
  border-color:rgba(255,255,255,.45);

  color:#0b1b2a !important;
  -webkit-text-fill-color:#0b1b2a !important;

  transform:translateY(-1px);
  text-shadow:none;
}

/* Activo: (a prueba de overrides) */
.buttons button[data-active="true"],
.buttons button.active,
.buttons button[aria-current="page"]{
  background:#ffffff !important;
  border-color:rgba(255,255,255,.45) !important;

  color:#0b1b2a !important;
  -webkit-text-fill-color:#0b1b2a !important;

  font-weight:800;
  text-shadow:none;
}

/* Si el texto está dentro de <span> o nodos hijos */
.buttons button[data-active="true"] *,
.buttons button.active *,
.buttons button[aria-current="page"] *{
  color:#0b1b2a !important;
  -webkit-text-fill-color:#0b1b2a !important;
}

/* Focus */
.buttons button:focus-visible,
.buttons a.button-link:focus-visible{
  outline:3px solid var(--aqua);
  outline-offset:2px;
}

/* ======================
   MAIN / SECCIONES
   ====================== */
main{
  max-width:1000px;
  margin:auto;
  padding:2rem;
}

.section{
  background:rgba(18,24,38,.88);
  padding:1.5rem;
  border-radius:16px;
  box-shadow:0 10px 40px rgba(0,0,0,.25);
  margin-bottom:1.5rem;
  display:none;
  border:1px solid rgba(255,255,255,.08);
}

.section.active{
  display:block;
  animation:fadeIn .6s ease-in;
}

@keyframes fadeIn{
  from{opacity:0;transform:translateY(10px);}
  to{opacity:1;transform:translateY(0);}
}

h2{
  margin-bottom:.5rem;
  color:var(--aqua);
}

.meta{
  font-size:.85rem;
  color:#a3b5ff;
}

.skills-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:1rem;
}

.project-list li{
  margin-bottom:.5rem;
}

/* ======================
   FOOTER
   ====================== */
footer{
  text-align:center;
  padding:1rem 0;
  color:#ffffff;
}

/* ======================
   FIRMA + QR
   ====================== */
.sign-qr{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1rem;
  margin-top:2rem;
  padding-top:1.5rem;
  border-top:1px solid rgba(255,255,255,.2);
}

.sign-qr .sign img{
  height:90px;
  filter:drop-shadow(0 0 8px rgba(0,0,0,.4));
}

.sign-qr .qr img{
  width:120px;
  height:120px;
  background:#fff;
  border-radius:10px;
  padding:6px;
}

/* ======================
   MODAL
   ====================== */
.modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:50;
}

.modal.open{display:block;}

.modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(2px);
}

.modal__dialog{
  margin:8vh auto 0;
  width:min(560px,90vw);
  background:rgba(18,24,38,.96);
  border-radius:16px;
  padding:1.5rem;
  border:1px solid rgba(255,255,255,.1);
  position:relative;
}

.modal__close{
  position:absolute;
  top:.6rem;
  right:.6rem;
  width:36px;
  height:36px;
  border-radius:50%;
  background:transparent;
  border:1px solid rgba(255,255,255,.25);
  color:#fff;
  cursor:pointer;
}

/* ======================
   PRINT / PDF
   ====================== */
@media print{
  #bg,.buttons,.modal{display:none!important;}
  body{background:#fff;color:#000;}
  .section{display:block;background:#fff;color:#000;box-shadow:none;}
  h2{color:#000;}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  #bg{animation:none;}
}