/* ==========================================================================
   tu espazio networks — hoja de estilos única
   Paleta tomada del logotipo original (#005479, #007fb4, #00aee5).
   Sin fuentes ni recursos externos: cero peticiones a terceros y cero cookies.
   ========================================================================== */

:root {
  --brand: #005479;
  --brand-mid: #0074a3;   /* 5.2:1 sobre blanco: sirve también para texto pequeño */
  --accent: #00aee5;      /* solo decorativo (nunca texto) */

  --ink: #0b2b39;
  --ink-soft: #476471;
  --bg: #f6fbfd;
  --surface: #ffffff;
  --line: #d9e9f1;

  --radius: 16px;
  --wrap: 68rem;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand-mid); text-underline-offset: 3px; }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* --- Utilidades ---------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; color: #fff; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 251, 253, 0.85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  color: var(--brand);
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; display: block; }
.brand:hover { color: var(--brand); }

.brand-lockup { display: flex; flex-direction: column; line-height: 1.02; }
.brand-name {
  white-space: nowrap;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand);
}
.brand-suffix {
  margin-top: 0.2rem;
  font-size: 0.56rem;
  font-weight: 650;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--brand); }

/* --- Héroe --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 7.5rem);
  background:
    radial-gradient(60rem 24rem at 82% -10%, rgba(0, 174, 229, 0.16), transparent 70%),
    radial-gradient(40rem 20rem at 5% 110%, rgba(0, 84, 121, 0.08), transparent 70%);
}

.hero-inner { max-width: 44rem; }

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}

.lead {
  margin: 1.25rem 0 0;
  max-width: 36rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(0, 84, 121, 0.8);
}
.btn-primary:hover {
  background: #003f5c;
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(0, 84, 121, 0.9);
}

.btn-ghost {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--line);
}
.btn-ghost:hover { background: #eef7fb; color: var(--brand); }

.hint {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* --- Secciones ----------------------------------------------------------- */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

.section-lead {
  margin: 0.85rem 0 0;
  max-width: 40rem;
  color: var(--ink-soft);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.6rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #bcd9e7;
  box-shadow: 0 18px 32px -24px rgba(11, 43, 57, 0.55);
}

.card-icon {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand-mid);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* --- Contacto ------------------------------------------------------------ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.contact-list li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.contact-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.contact-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact-list a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
}
.contact-list a:hover { text-decoration: underline; }

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


.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer-inner p { margin: 0; }

.legal-nav { display: flex; gap: 1.25rem; }
.legal-nav a { color: var(--ink-soft); text-decoration: none; }
.legal-nav a:hover { color: var(--brand); }

/* --- 404 ----------------------------------------------------------------- */
/* Estética de terminal: 404 en arte ASCII, líneas de barrido y marco de
   esquinas. Todo en CSS, sin JavaScript. */

.page-404 { display: flex; flex-direction: column; min-height: 100vh; }
.page-404 main { flex: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nf {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(2.5rem, 7vh, 4.5rem);
  overflow: hidden;
  background:
    radial-gradient(46rem 22rem at 50% -8%, rgba(0, 174, 229, 0.16), transparent 70%),
    radial-gradient(34rem 18rem at 50% 108%, rgba(0, 84, 121, 0.09), transparent 70%);
}

/* Rejilla técnica de fondo, desvanecida hacia los bordes */
.nf::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 84, 121, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 84, 121, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(58% 62% at 50% 45%, #000 22%, transparent 76%);
  mask-image: radial-gradient(58% 62% at 50% 45%, #000 22%, transparent 76%);
  pointer-events: none;
}

/* Marco de esquinas */
.nf-frame {
  position: absolute;
  inset: clamp(0.9rem, 3vw, 2rem);
  pointer-events: none;
}
.nf-frame .nf-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 116, 163, 0.4);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.nf-frame .nf-corner:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.nf-frame .nf-corner:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.nf-frame .nf-corner:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.nf-frame .nf-corner:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.nf-frame .nf-corner.is-hit {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 174, 229, 0.55);
}

/* Pelotita del easter egg (la mueve el script del 404) */
.nf-pellet {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 174, 229, 0.14), 0 0 14px rgba(0, 174, 229, 0.6);
  will-change: transform;
  pointer-events: none;
  z-index: 3;
}

.nf-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.nf-kicker {
  margin: 0 0 clamp(1.25rem, 4vw, 2rem);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brand-mid);
}

.nf-art {
  position: relative;
  overflow: hidden;
  padding: clamp(0.4rem, 2vw, 1.25rem) clamp(0.6rem, 3vw, 2rem);
}

.nf-glyph {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(22px, 7.5vw, 46px);
  line-height: 1.02;
  letter-spacing: 0;
  white-space: pre;
  background: linear-gradient(158deg, #2ac7ef 0%, #0074a3 46%, #005479 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 22px rgba(0, 84, 121, 0.2));
  user-select: none;
}

/* Líneas de barrido sobre el glifo */
.nf-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    rgba(5, 35, 50, 0.18) 0 1px,
    transparent 1px 4px
  );
  opacity: 0.55;
  pointer-events: none;
}

/* Barrido luminoso que recorre el arte */
.nf-sweep {
  position: absolute;
  left: -15%;
  right: -15%;
  top: -50%;
  height: 55%;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 174, 229, 0.22) 45%,
    rgba(0, 174, 229, 0.04) 70%,
    transparent
  );
  animation: nf-sweep 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  pointer-events: none;
}

@keyframes nf-sweep {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 1; }
  62%  { opacity: 1; }
  78%  { transform: translateY(300%); opacity: 0; }
  100% { transform: translateY(300%); opacity: 0; }
}

.nf-quip {
  margin: clamp(1.5rem, 4vw, 2.25rem) 0 0;
  font-family: var(--mono);
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  color: var(--ink-soft);
}
.nf-quip .prompt { color: var(--brand-mid); }

.nf-cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 0.12rem;
  background: var(--brand-mid);
  vertical-align: -0.16em;
  animation: nf-blink 1.1s steps(2, end) infinite;
}

@keyframes nf-blink {
  50% { opacity: 0; }
}

.nf .actions { justify-content: center; margin-top: clamp(1.6rem, 4vw, 2.25rem); }

/* Tira de datos: guiones que se desplazan, como actividad de servidor */
.nf-stream {
  width: min(100%, 24rem);
  height: 3px;
  margin-top: clamp(2rem, 5vw, 3rem);
  border-radius: 999px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0 10px,
    transparent 10px 24px
  );
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  opacity: 0.5;
  animation: nf-stream 4.6s linear infinite;
}

@keyframes nf-stream {
  to { background-position: 24px 0; }
}

.nf .hint { margin-top: 1.5rem; font-size: 0.88rem; }

/* --- Páginas legales ----------------------------------------------------- */

.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.legal-wrap { max-width: 44rem; }

.legal-eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-mid);
}

.legal h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
}

.legal-meta {
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.legal-body { margin-top: 2.5rem; }

.legal-body h2 {
  margin: 2.4rem 0 0.6rem;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.legal-body p,
.legal-body li {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.legal-body p { margin: 0.6rem 0; }
.legal-body ul { margin: 0.6rem 0; padding-left: 1.2rem; }
.legal-body li { margin: 0.3rem 0; }
.legal-body strong { color: var(--ink); font-weight: 650; }
.legal-body a { color: var(--brand-mid); }

.legal-back {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.legal-back:hover { text-decoration: underline; }

/* --- Adaptación a móvil -------------------------------------------------- */

@media (max-width: 46rem) {
  .contact-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 1.1rem; }
}

@media (max-width: 30rem) {
  .wrap { width: calc(100% - 1.75rem); }
  .header-inner { gap: 0.5rem; }
  .brand { gap: 0.5rem; }
  .brand img { width: 30px; height: 30px; }
  .brand-name { font-size: 0.98rem; letter-spacing: 0.01em; }
  .brand-suffix { font-size: 0.48rem; letter-spacing: 0.18em; }
  .site-nav { gap: 0.7rem; font-size: 0.82rem; }
  .actions .btn { width: 100%; }
}

/* --- Accesibilidad: movimiento reducido ---------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
  .nf-sweep, .nf-stream, .nf-cursor { animation: none; }
  .nf-sweep { display: none; }
  .nf-pellet { display: none; }
}

/* --- Impresión ----------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .actions, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
