/* ==========================================================================
   Página padrão da CDN — neutra, servida em todos os domínios cdn.*
   ========================================================================== */

:root {
  --bg: oklch(14.1% .005 285.823);
  --line: oklch(100% 0 0 / .08);
  --line-strong: oklch(100% 0 0 / .14);
  --text: oklch(98.5% 0 0);
  --muted: oklch(70.5% .015 286.067);
  --faint: oklch(55.2% .016 285.938);
  --primary: oklch(62.3% .214 259.815);
  --primary-strong: oklch(54.6% .245 262.881);
  --primary-soft: oklch(80.9% .105 251.813);
  --ok: oklch(72.3% .219 149.579);
  --warn: oklch(82.8% .189 84.429);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--primary); color: #fff; }

code { font-family: var(--mono); font-size: .9em; }

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Palco: ocupa a tela inteira, globo nasce na parte de baixo
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, oklch(100% 0 0 / .045) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(100% 0 0 / .045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
}

.backdrop-glow {
  position: absolute;
  left: 50%;
  top: -40vh;
  width: min(1400px, 140vw);
  height: 80vh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, oklch(54.6% .245 262.881 / .32), oklch(54.6% .245 262.881 / .06) 60%, transparent);
  filter: blur(20px);
  animation: glow-breathe 12s ease-in-out infinite;
}

.backdrop-noise {
  position: absolute;
  inset: 0;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes glow-breathe {
  0%, 100% { opacity: .85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.globe {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  opacity: 0;
  transform: translateY(6%);
  transition: opacity 1.6s var(--ease) .2s, transform 2s var(--ease) .2s;
}

.globe.is-ready { opacity: 1; transform: none; }
.globe.is-grab { cursor: grab; }
.globe.is-dragging { cursor: grabbing; }

/* --------------------------------------------------------------------------
   Barra superior
   -------------------------------------------------------------------------- */

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding-inline: var(--gutter);
  pointer-events: none;
}

.bar > * { pointer-events: auto; }

.host {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
}

.host .icon { font-size: 18px; color: var(--primary-soft); }

.host [data-host] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(100% 0 0 / .03);
  font-size: .8rem;
  color: var(--muted);
}

.status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: ping 2.2s var(--ease) infinite;
}

@keyframes ping {
  0% { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Conteúdo central
   -------------------------------------------------------------------------- */

.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 9vh, 104px) var(--gutter) 0;
  text-align: center;
  pointer-events: none;
}

.content > * { pointer-events: auto; }

.notfound {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  margin: 0 0 28px;
  padding: 6px 14px 6px 6px;
  border: 1px solid oklch(82.8% .189 84.429 / .25);
  border-radius: 14px;
  background: oklch(82.8% .189 84.429 / .06);
  font-size: .85rem;
  color: var(--muted);
  text-align: left;
  animation: rise 1s var(--ease) both;
}

.notfound[hidden] { display: none; }

.notfound-code {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: oklch(82.8% .189 84.429 / .16);
  font-family: var(--mono);
  font-weight: 500;
  color: var(--warn);
}

.notfound code { color: var(--text); overflow-wrap: anywhere; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary-soft);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary));
}

.eyebrow::after { transform: scaleX(-1); }

.title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: clamp(2.4rem, 6.2vw, 5.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.grad {
  padding-bottom: .06em;
  background: linear-gradient(100deg, #fff 0%, var(--primary-soft) 30%, var(--primary) 55%, var(--primary-soft) 80%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lede {
  max-width: 30rem;
  margin: 22px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   HUD com métricas da conexão
   -------------------------------------------------------------------------- */

.hud {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 4vh, 36px);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, auto);
  margin: 0;
  border-radius: 14px;
  background: oklch(14.1% .005 285.823 / .62);
  box-shadow: 0 0 0 1px var(--line-strong), 0 20px 50px -20px oklch(0% 0 0 / .8), inset 0 1px 0 oklch(100% 0 0 / .05);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  translate: -50% 0;
}

.metric { padding: 12px 26px; text-align: center; }
.metric + .metric { border-left: 1px solid var(--line); }

.metric dt {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.metric dd {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric small { margin-left: 3px; font-size: .75rem; color: var(--faint); font-weight: 400; }
.metric small[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Entrada
   -------------------------------------------------------------------------- */

[data-rise] { animation: rise 1.1s var(--ease) var(--d, 0ms) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .bar { height: 64px; }
  .hud { width: calc(100% - 2 * var(--gutter)); grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 10px 6px; }
  .metric dt { font-size: .58rem; letter-spacing: .1em; }
  .metric dd { font-size: .95rem; }
}

@media (max-height: 560px) {
  .hud { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
