/* =========================================================================
   Nebulox-71 — aurora cyberpunk theme
   Palette derived from the #071 "Nebulox" sprite (Energy: Celestial).
   No external fonts/CDNs: fully self-contained for IPFS.
   ========================================================================= */

:root {
  /* Backgrounds — deep space indigo-black */
  --bg: #0a0612;
  --bg-elev: #120a24;
  --bg-card: #160c2c;

  /* Structure */
  --violet: #5b3aa0;
  --violet-bright: #8a5cf0;

  /* Aurora accents */
  --cyan: #3fe0d0;
  --magenta: #d24fd0;

  /* Text */
  --text: #e6e1f5;
  --muted: #9a8fc0;
  --line: rgba(138, 92, 240, 0.22);

  --aurora: linear-gradient(100deg, var(--cyan), var(--violet-bright) 50%, var(--magenta));

  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular",
    Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --wrap: 1080px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Living sky: the old static starfield split across two fixed layers so it can
   move. ::before holds near stars that twinkle; ::after holds far stars + the
   aurora wash, drifting a few percent for parallax. Still pure CSS — no image
   requests, so the bundle stays self-contained. Motion is applied further down,
   inside the prefers-reduced-motion gate; without it these render exactly like
   the old static background. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(63, 224, 208, 0.7), transparent),
    radial-gradient(1px 1px at 50% 60%, rgba(230, 225, 245, 0.6), transparent),
    radial-gradient(1px 1px at 12% 80%, rgba(63, 224, 208, 0.5), transparent);
}
body::after {
  z-index: -2;
  inset: -8%; /* oversized so the drift never exposes an edge */
  background-image:
    radial-gradient(1px 1px at 75% 18%, rgba(210, 79, 208, 0.6), transparent),
    radial-gradient(1px 1px at 85% 70%, rgba(138, 92, 240, 0.6), transparent),
    radial-gradient(900px 500px at 50% -10%, rgba(91, 58, 160, 0.35), transparent 70%),
    radial-gradient(760px 420px at 82% 4%, rgba(63, 224, 208, 0.1), transparent 70%),
    radial-gradient(720px 400px at 12% 8%, rgba(210, 79, 208, 0.08), transparent 70%);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
a:hover {
  color: #7ff3e8;
  text-shadow: 0 0 12px rgba(63, 224, 208, 0.55);
}

img {
  max-width: 100%;
  display: block;
}

/* Keep the pixel-art sprite crisp at any size */
.brand-logo,
.hero-art img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--bg-elev);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--cyan);
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Header / nav --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 6, 18, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}
.brand:hover {
  color: var(--text);
  text-shadow: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}
.brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.site-nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.site-nav a {
  color: var(--muted);
  padding-bottom: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet-bright)) no-repeat
    left bottom / 0% 2px;
  transition: color 0.2s ease, background-size 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background-size: 100% 2px;
  text-shadow: none;
}

/* Status LED next to the brand sub-line — the agent is live */
.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  margin-right: 0.45em;
  vertical-align: 1px;
}

/* ---------- Generic section / headings ------------------------------------ */
section {
  padding-block: 4rem;
}
h1,
h2,
h3 {
  font-family: var(--mono);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h2.section-title {
  font-size: 1.7rem;
  margin: 0 0 0.4rem;
}
h2.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 0.7rem;
  background: var(--aurora);
  border-radius: 3px;
}
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--cyan);
  margin: 0 0 0.6rem;
}
.section-intro {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 2.2rem;
}

/* ---------- Buttons -------------------------------------------------------- */
.btn-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}
.btn {
  display: inline-block;
  position: relative;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: var(--aurora);
  color: #0a0612;
  font-weight: 700;
  border: none;
}
.btn-primary:hover {
  color: #0a0612;
  box-shadow: 0 0 24px rgba(63, 224, 208, 0.45);
}
/* Sheen sweep across the primary button on hover */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%
  );
  transform: translateX(-130%);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--text);
  text-shadow: none;
  box-shadow: 0 0 18px rgba(138, 92, 240, 0.3);
}

/* ---------- Hero ----------------------------------------------------------- */
.hero {
  padding-block: 5rem 4rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin: 0.2rem 0 1rem;
}
.hero h1 .grad {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 52ch;
}
.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(138, 92, 240, 0.4), transparent 65%);
  filter: blur(20px);
}
.hero-art img {
  position: relative;
  width: min(320px, 80%);
  filter: drop-shadow(0 0 30px rgba(63, 224, 208, 0.35));
}

/* ---------- Cards / grids -------------------------------------------------- */
.grid {
  display: grid;
  gap: 1.2rem;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1),
    border-color 0.25s ease, box-shadow 0.25s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--aurora);
  opacity: 0.8;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(63, 224, 208, 0.4);
  box-shadow: 0 10px 40px rgba(91, 58, 160, 0.25);
}
.card h3 {
  margin: 0.4rem 0 0.5rem;
  font-size: 1.15rem;
}
.card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.96rem;
}
.card .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
}

/* ---------- Feature band --------------------------------------------------- */
.band {
  background: var(--bg-elev);
  border-block: 1px solid var(--line);
}

/* ---------- Blog / posts --------------------------------------------------- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.post-card:hover {
  color: var(--text);
  text-shadow: none;
  transform: translateY(-2px);
  border-color: rgba(63, 224, 208, 0.4);
  box-shadow: 0 10px 40px rgba(91, 58, 160, 0.25);
}
.post-card .post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.post-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}
.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* Category chips */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.chip-announcement { color: var(--cyan); }
.chip-news { color: var(--violet-bright); }
.chip-report { color: var(--magenta); }

.empty-state {
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ---------- Single post / prose ------------------------------------------- */
.post {
  padding-block: 3rem 4rem;
  max-width: 760px;
}
.back-link {
  font-family: var(--mono);
  font-size: 0.82rem;
}
.post-header {
  margin: 1.5rem 0 2rem;
}
.post-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.7rem 0 0.5rem;
}
.post-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
.prose {
  font-size: 1.05rem;
}
.prose h2 {
  margin-top: 2.2rem;
  font-size: 1.4rem;
}
.prose h3 {
  margin-top: 1.6rem;
  font-size: 1.15rem;
}
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--line);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.prose pre {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
}
.prose pre code {
  border: none;
  background: none;
  padding: 0;
}
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 3px solid var(--cyan);
  background: rgba(63, 224, 208, 0.06);
  color: var(--muted);
}
.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.prose figure {
  margin: 1.8rem 0;
}
.prose figure img {
  width: 100%;
  display: block;
}
.prose figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.6rem;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.9rem;
  font-family: var(--mono);
}
.prose thead th {
  text-align: left;
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--violet-bright);
}
.prose tbody td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
.prose tbody tr:last-child td {
  border-bottom: none;
}
.prose tbody tr:hover {
  background: rgba(138, 92, 240, 0.06);
}

/* ---------- Definition / stat rows ---------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: var(--bg-card);
}
.stat .big {
  font-family: var(--mono);
  font-size: 1.7rem;
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .lbl {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Footer --------------------------------------------------------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: rgba(18, 10, 36, 0.6);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 2rem;
  padding-block: 2.6rem 1.6rem;
}
.footer-brand {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.footer-name {
  font-family: var(--mono);
  font-weight: 700;
  margin: 0;
}
.footer-tag {
  color: var(--muted);
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}
.footer-heading {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--cyan);
  margin: 0 0 0.8rem;
}
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}
.wallet-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 0.3rem;
}
.wallet {
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  display: block;
}
.footer-base {
  border-top: 1px solid var(--line);
  padding-block: 1rem 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--mono);
}

/* ---------- Responsive ----------------------------------------------------- */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .grid-3,
  .grid-2,
  .stat-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 1rem; }
  section { padding-block: 3rem; }
}

/* =========================================================================
   Motion system — every animation lives behind prefers-reduced-motion, so
   reduced-motion users get the identical static design.
   Concept: "the agent is live" — the sky breathes, the hero comes online
   like a transmission, telemetry (cards) streams in on scroll.
   ========================================================================= */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes materialize {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes twinkle {
  from { opacity: 1; }
  to { opacity: 0.4; }
}
@keyframes aurora-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.05); }
}
@keyframes aurora-pan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--cyan); }
  50% { opacity: 0.45; box-shadow: 0 0 10px var(--cyan); }
}
@keyframes sheen {
  to { transform: translateX(130%); }
}

@media (prefers-reduced-motion: no-preference) {
  /* Ambient sky: near stars twinkle, aurora + far stars drift (parallax) */
  body::before {
    animation: twinkle 6s ease-in-out infinite alternate;
  }
  body::after {
    animation: aurora-drift 30s ease-in-out infinite alternate;
  }

  /* Hero load sequence: copy cascades in, sprite materializes then floats */
  .hero-copy > * {
    animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  .hero-copy > *:nth-child(2) { animation-delay: 0.1s; }
  .hero-copy > *:nth-child(3) { animation-delay: 0.2s; }
  .hero-copy > *:nth-child(4) { animation-delay: 0.3s; }
  .hero-art img {
    animation: materialize 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both,
      float 6s ease-in-out 0.9s infinite;
  }
  .hero-art::before {
    animation: glow-breathe 6s ease-in-out infinite;
  }

  /* Aurora slowly pans through the gradient headline */
  .hero h1 .grad {
    background-size: 220% 100%;
    animation: aurora-pan 7s ease-in-out infinite alternate;
  }

  .pulse-dot {
    animation: led-pulse 2.4s ease-in-out infinite;
  }

  .btn-primary:hover::after {
    animation: sheen 0.7s ease forwards;
  }

  /* Scroll-driven reveals (CSS-only, no IntersectionObserver). Browsers
     without animation-timeline just render everything immediately. */
  @supports (animation-timeline: view()) {
    .card,
    .post-card,
    .stat {
      animation: rise 1s cubic-bezier(0.2, 0.7, 0.3, 1) both;
      animation-timeline: view();
      animation-range: entry 5% entry 45%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Language toggle (EN / 简体 / 繁體) in the header. Separate class from
   .site-nav so its uppercase/letter-spacing styling never leaks onto CJK
   glyphs. aria-current="true" marks the active language. */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.lang-switch a {
  color: var(--muted);
  padding: 0.12rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-switch a:hover {
  color: var(--text);
}
.lang-switch a[aria-current="true"] {
  color: var(--text);
  border-color: var(--line);
}
