/* ================================================================
   styles.css — VisionOS 3D + Glassmorphism + Circuito Animado
   “Edición Apple Editorial” (lectura limpia y equilibrada)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root{
  --text:#0F3D2E;
  --text-soft:#194e3d;
  --accent:#00A651; /* verde de circuito */
  --glass-bg: rgba(255,255,255,0.42);
  --max-text-width: 880px;
}

/* ---------------------------
   RESET
   --------------------------- */
* { margin:0; padding:0; box-sizing:border-box; }
html,body { height:100%; }
body{
  font-family:'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial;
  background:#ffffff;
  color:var(--text);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

/* -------------------------------------------------------------
   FONDO: circuito 3D animado (usa circuito-3d.svg)
   ------------------------------------------------------------- */
.background-circuits{
  position:fixed;
  inset:0;
  z-index:-3;
  background:url("circuito-3d.svg") repeat;
  background-size:460px;
  opacity:0.14;
  filter:drop-shadow(0 14px 20px rgba(0,0,0,0.12)) blur(2px) saturate(150%);
  animation:bgPulse 6.5s ease-in-out infinite;
}
@keyframes bgPulse{
  0% { opacity:0.09; }
  50%{ opacity:0.17; }
  100%{ opacity:0.09; }
}

/* -------------------------------------------------------------
   CAPAS FLOTANTES 3D (VisionOS)
   ------------------------------------------------------------- */
.floating-layer{
  position:fixed;
  border-radius:32px;
  background:rgba(255,255,255,0.33);
  backdrop-filter:blur(25px) saturate(170%);
  -webkit-backdrop-filter:blur(25px) saturate(170%);
  box-shadow:
    inset 0 0 50px rgba(255,255,255,0.45),
    inset 0 0 20px rgba(255,255,255,0.25),
    0 20px 55px rgba(0,0,0,0.08),
    0 5px 10px rgba(255,255,255,0.7);
  transition:transform 0.18s linear, filter 0.18s linear;
  z-index:-1;
  pointer-events:none;
}

.layer1{ width:430px; height:260px; top:14%; left:10%; animation:floatA 14s ease-in-out infinite; }
.layer2{ width:380px; height:230px; top:50%; left:65%; animation:floatB 11s ease-in-out infinite; }
.layer3{ width:300px; height:180px; top:75%; left:20%; animation:floatC 16s ease-in-out infinite; }

@keyframes floatA{ 0%{transform:translateY(0);}50%{transform:translateY(-28px);}100%{transform:translateY(0);} }
@keyframes floatB{ 0%{transform:translateY(0);}50%{transform:translateY(-18px);}100%{transform:translateY(0);} }
@keyframes floatC{ 0%{transform:translateY(0);}50%{transform:translateY(-12px);}100%{transform:translateY(0);} }

/* -------------------------------------------------------------
   GLASS BASE
   ------------------------------------------------------------- */
.glass{
  background:var(--glass-bg);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  border-radius:28px;
  border:1px solid rgba(255,255,255,0.7);
  box-shadow:
    0 5px 35px rgba(0,0,0,0.10),
    0 0 4px rgba(255,255,255,0.6),
    inset 0 0 17px rgba(255,255,255,0.35);
}

/* -------------------------------------------------------------
   NAVBAR
   ------------------------------------------------------------- */
.navbar{
  width:90%;
  margin:20px auto;
  padding:18px 30px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.logo{
  font-weight:700;
  font-size:1.65rem;
  color:var(--text);
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    max-height: 70px;
    width: auto;
    object-fit: contain;
}

.menu{
  list-style:none;
  display:flex;
  gap:26px;
  align-items:center;
}
.menu li{ display:inline-block; }
.menu a{
  text-decoration:none;
  color:var(--text);
  font-weight:500;
  padding:6px 8px;
  border-radius:8px;
  transition:0.18s ease;
}
.menu a:hover,
.menu a.active{
  opacity:0.7;
  transform:translateY(-2px);
}

/* -------------------------------------------------------------
   HERO — estilo Apple editorial
   ------------------------------------------------------------- */
.hero{
  width:90%;
  margin:50px auto;
  padding:110px 60px;
  text-align:center;
  max-width:1200px;
}
.hero h1{
  font-size:3.2rem;
  line-height:1.05;
  margin-bottom:20px;
  font-weight:700;
}
.hero p{
  font-size:1.12rem;
  max-width:var(--max-text-width);
  margin:0 auto 18px;
  color:var(--text-soft);
}
.hero .highlight{
  color:var(--accent);
  font-weight:600;
  margin-bottom:18px;
  display:block;
}

/* -------------------------------------------------------------
   BOTÓN GLASS — LUZ REACTIVA
   ------------------------------------------------------------- */
.btn-glass{
  position:relative;
  display:inline-block;
  padding:14px 38px;
  border-radius:20px;
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,0.45);
  border:1px solid rgba(255,255,255,0.72);
  backdrop-filter:blur(20px);
  transition:transform .18s ease;
  overflow:hidden;
}
.btn-glass:hover{ transform:scale(1.06); }

.btn-glass::before{
  content:"";
  position:absolute;
  left:var(--x,50%);
  top:var(--y,50%);
  transform:translate(-50%,-50%);
  width:0px;
  height:0px;
  background:radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.15) 35%, transparent 70%);
  border-radius:50%;
  opacity:0;
}
.btn-glass:hover::before{
  width:220px;
  height:220px;
  opacity:1;
  transition:width .22s ease-out, height .22s ease-out, opacity .18s ease;
}

/* -------------------------------------------------------------
   SECCIONES Y JUSTIFICACIÓN DE TEXTOS (Apple editorial)
   ------------------------------------------------------------- */
.section{
  width:90%;
  margin:80px auto;
  max-width:1200px;
  text-align:center;
}
.section h2{
  font-size:2.4rem;
  margin-bottom:18px;
  font-weight:700;
}

/* Justificación limpia */
.section p,
.card p,
.project-card p,
.footer p {
  max-width:var(--max-text-width);
  margin-left:auto;
  margin-right:auto;
  text-align:justify;
  text-justify:inter-word;
  font-size:1.07rem;
  color:var(--text-soft);
}

/* -------------------------------------------------------------
   GRIDS
   ------------------------------------------------------------- */
.grid-3{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(270px,1fr));
  gap:32px;
  margin-top:26px;
}

.card{
  padding:34px 26px;
  text-align:left;
  transition:transform .22s ease;
}
.card:hover{ transform:translateY(-8px) scale(1.02); }

.card h3{
  margin-bottom:10px;
  font-size:1.25rem;
  font-weight:600;
  color:var(--text);
}

/* -------------------------------------------------------------
   PROYECTOS
   ------------------------------------------------------------- */
.projects{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px,1fr));
  gap:26px;
}
.project-card{
  padding:28px;
  min-height:220px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:left;
}

/* -------------------------------------------------------------
   CERTIFICACIONES
   ------------------------------------------------------------- */
.cert-icons{
  display:flex;
  justify-content:center;
  gap:28px;
  margin:26px 0;
}
.cert-icons img{
  width:120px;
  opacity:0.9;
  transition:0.18s ease;
}
.cert-icons img:hover{
  transform:scale(1.06);
  opacity:1;
}

/* -------------------------------------------------------------
   FORMULARIO
   ------------------------------------------------------------- */
.contact-form{
  max-width:760px;
  margin:0 auto;
  text-align:left;
}

.form-group{
  margin-bottom:18px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-group label{
  font-weight:600;
  color:var(--text);
}

.form-group input,
.form-group textarea{
  padding:12px 14px;
  border-radius:12px;
  border:none;
  background:rgba(255,255,255,0.55);
  font-size:1rem;
  resize:vertical;
  line-height:1.55;
}

.form-group input:focus,
.form-group textarea:focus{
  box-shadow:0 0 0 3px rgba(0,166,81,0.18);
  outline:none;
}

.error-message{
  color:#d93025;
  font-size:0.92rem;
  visibility:hidden;
}

.form-status{
  margin-top:16px;
  font-weight:600;
  text-align:center;
}

/* -------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------- */
.footer{
  width:90%;
  margin:50px auto;
  padding:40px 20px 80px;
  text-align:center;
}
.footer p{
  margin-top:8px;
}

/* -------------------------------------------------------------
   VISIBILIDAD (controlado por JS)
   ------------------------------------------------------------- */
header, section, footer{ display:none; }
header.active, section.active, footer.active{ display:block; }

/* -------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------- */
@media(max-width:1024px){
  .hero{ padding:90px 30px; }
  .floating-layer{ display:none; }
}
@media(max-width:768px){
  .navbar{ flex-direction:column; gap:14px; padding:14px; }
  .menu{ flex-wrap:wrap; gap:14px; }
  .hero h1{ font-size:2.3rem; }
  .section p{ font-size:1rem; }
}

/* -------------------------------------------------------------
   ACCESIBILIDAD FOCUS
   ------------------------------------------------------------- */
a:focus, button:focus, input:focus, textarea:focus{
  outline:3px solid rgba(0,166,81,0.25);
  outline-offset:2px;
}
