@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05060d;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --ice: #e8f7ff;
  --muted: #6b7196;
  --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ice);
  overflow: hidden;
}

body {
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

#network {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- terminal ---------- */
#terminal {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  right: 24px;
  max-width: 720px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
#terminal.visible { opacity: 1; }
#terminal .prompt { color: var(--magenta); }
#terminal .code { color: var(--ice); }
#terminal .ok { color: var(--cyan); }

/* ---------- centro ---------- */
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vh, 16px);
  pointer-events: none;
  padding: 24px;
}

#mark {
  width: min(360px, 86vw);
  height: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow: visible;
}
#mark.visible { opacity: 1; }

#mark .hex { fill: var(--bg); stroke: var(--cyan); stroke-width: 3; }
#mark .hex-inner { fill: none; stroke: var(--magenta); stroke-width: 1; stroke-dasharray: 3 3; }
#mark .chevron { fill: none; stroke: var(--ice); stroke-width: 4; stroke-linecap: square; }
#mark .cursor { fill: var(--cyan); }
#mark .shimmer { fill: #ffffff; opacity: 0; }
#mark .loader-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1.5px;
  fill: var(--ice);
}

#brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 12vw, 132px);
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.04em 0.18em;
  background: rgba(5, 6, 13, 0.72);
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
#brand.visible { opacity: 1; }
#brand .l { color: var(--cyan); }
#brand .rest { color: var(--ice); }

/* ---------- links ---------- */
#links {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: auto;
}
#links.visible { opacity: 1; transform: none; }

#links a {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.7vw, 16px);
  color: var(--cyan);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(5, 6, 13, 0.72);
  transition: color 0.2s ease, border-color 0.2s ease;
}
#links a .caret { opacity: 0; }
#links a:hover,
#links a:focus-visible { color: var(--magenta); border-color: var(--magenta); }
#links a:hover .caret,
#links a:focus-visible .caret { animation: blink 1s steps(1) infinite; }
#links a:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; }

@keyframes blink { 50% { opacity: 1; } 0%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #terminal, #mark, #brand, #links { transition: none; }
  #links a:hover .caret, #links a:focus-visible .caret { animation: none; opacity: 1; }
}
