/* =========================================================
   CyberShield · layout.css
   Cabecera, estructura de secciones y pie.
   ========================================================= */

.wrap { max-width: 1260px; margin: 0 auto; }

section { position: relative; padding: 120px max(5vw, 18px) 70px; }

.sec-head { margin-bottom: 44px; }
.sec-head.center { text-align: center; }
.sec-head.center .lead { margin-inline: auto; }

/* Línea de circuito decorativa entre secciones */
section + section::before,
.marquee + section::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: min(1260px, 90vw); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line-2) 20%, color-mix(in srgb, var(--a) 50%, transparent) 50%, var(--line-2) 80%, transparent);
}

/* ---------- Cabecera flotante ---------- */

.topbar {
  position: fixed; top: 12px; left: 50%; z-index: 120;
  width: min(1300px, calc(100% - 24px));
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 10px 9px 18px;
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 20px 50px -30px #000;
  transition: top .4s var(--ease), box-shadow .4s;
}
.topbar.scrolled { top: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 0 1px var(--line), 0 18px 40px -20px #000; }
.topbar::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--a), transparent);
  opacity: .5;
}

.logo { display: flex; align-items: center; gap: 10px; font: 700 1.2rem var(--display); letter-spacing: .04em; white-space: nowrap; }
.logo svg { width: 32px; height: 32px; overflow: visible; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--a) 60%, transparent)); }
.logo b { color: var(--a); text-shadow: 0 0 18px color-mix(in srgb, var(--a) 50%, transparent); }
.logo-check { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw-in .8s .4s var(--ease) forwards; }

#menu { position: relative; display: flex; list-style: none; }
#menu a {
  position: relative; z-index: 1; display: block;
  padding: 8px 13px; font-size: .88rem; color: var(--muted);
  transition: color .25s;
}
#menu a:hover, #menu a.active { color: var(--text); }
#pill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0;
  border-radius: 10px; opacity: 0;
  background: linear-gradient(180deg, var(--a-soft), transparent);
  box-shadow: inset 0 0 0 1px var(--a-mid), 0 0 20px -8px var(--a);
  transition: transform .5s var(--spring), width .5s var(--spring), opacity .3s;
}
#pill::after {
  content: ""; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--a); box-shadow: 0 0 10px var(--a);
}
.menu-mobile-only { display: none; }

.tools { display: flex; gap: 8px; align-items: center; }
.logout-form { display: contents; }
.user-chip { padding-left: 4px; color: var(--text); }
.avatar {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--a), var(--b));
  color: #02131a; font: 700 .85rem var(--display);
}
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#burger { display: none; font-size: 1rem; }

@media (max-width: 1200px) {
  .map-link { display: none; } /* en pantallas estrechas va dentro del menú */
  #burger { display: inline-flex; }
  #pal-btn, .user-name { display: none; }
  .menu-mobile-only { display: block; }
  nav { position: static; }
  #menu {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; padding: 10px;
    background: color-mix(in srgb, var(--bg-2) 94%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--line-2); border-radius: 16px;
    opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.98);
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility .3s;
  }
  #menu.open { opacity: 1; visibility: visible; transform: none; }
  #menu a { padding: 12px 14px; font-size: 1rem; border-radius: 10px; }
  #menu a.active { color: var(--a); background: var(--a-soft); }
  #pill { display: none; }
}
@media (max-width: 560px) {
  .topbar { padding-left: 12px; padding-right: 8px; gap: 8px; }
  .tools { gap: 5px; }
  .logo { font-size: 1.05rem; }
  .login-link { padding: 0 12px; }
  #theme-btn { padding: 0 10px; font-size: 0; gap: 0; }
}

/* ---------- Pie ---------- */

.site-foot {
  position: relative; overflow: hidden;
  margin-top: 60px; padding: 60px max(5vw, 18px) 30px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(2, 3, 8, .9));
  color: var(--muted);
}
.foot-glow {
  position: absolute; left: 50%; top: -1px; width: 60%; height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--a), transparent);
  box-shadow: 0 0 40px 6px color-mix(in srgb, var(--a) 40%, transparent);
}
.foot-grid { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.foot-brand p { max-width: 360px; margin-top: 12px; font-size: .92rem; }
.status-line { display: flex; align-items: center; gap: 10px; font: .78rem var(--mono); }
.social { display: flex; gap: 12px; }
.social a {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  transition: border-color .25s, color .25s, box-shadow .25s, transform .25s var(--ease);
}
.social a:hover { color: var(--a); border-color: var(--a-mid); box-shadow: 0 0 24px -6px var(--a); }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; }
.legal { display: flex; gap: 20px; flex-wrap: wrap; }
.legal a:hover { color: var(--a); }

.data-credits { margin-top: 30px; font: .72rem/1.8 var(--mono); color: var(--dim); }
.data-credits a { color: var(--muted); border-bottom: 1px dashed var(--line-2); }
.data-credits a:hover { color: var(--a); }
