@font-face {
  font-family: "ZLabs Pixel CN";
  src: url("/fonts/ZLabsPixel12pxCN.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --paper-deep: #ebe4d5;
  --ink: #282722;
  --muted: #6b685f;
  --moss: #617154;
  --moss-soft: #aab69d;
  --wood: #876b4b;
  --line: #d7cfbd;
  --card: rgba(255, 253, 247, 0.78);
  --grid: rgba(87, 80, 68, 0.055);
  --glow: rgba(97, 113, 84, 0.25);
  --pixel: "ZLabs Pixel CN", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111614;
  --paper-deep: #1b231e;
  --ink: #ebe9df;
  --muted: #afb4a9;
  --moss: #a9bf9c;
  --moss-soft: #667862;
  --wood: #c39a6b;
  --line: #38463d;
  --card: rgba(28, 36, 31, 0.82);
  --grid: rgba(222, 228, 215, 0.055);
  --glow: rgba(169, 191, 156, 0.2);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: color 180ms ease, background-color 180ms ease;
}

a { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  font: 700 14px/1 var(--pixel);
  letter-spacing: 0.06em;
  text-decoration: none;
}

nav { display: flex; gap: 24px; align-items: center; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--ink); }

.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 48px;
  padding: 74px 0 62px;
}

.hero-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--moss);
  font: 700 12px/1.4 var(--pixel);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font: 800 clamp(46px, 7vw, 88px)/1.06 var(--pixel);
  letter-spacing: -0.045em;
}

.lede {
  max-width: 650px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.85;
}

.stamp {
  display: inline-block;
  margin: 28px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--moss);
  background: var(--card);
  color: var(--muted);
  font: 12px/1.4 var(--pixel);
}

.beacon {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
}

.signal {
  position: absolute;
  border: 1px solid var(--moss-soft);
  border-radius: 50%;
  animation: broadcast 3.6s infinite ease-out;
}
.signal-a { inset: 38%; animation-delay: 0s; }
.signal-b { inset: 25%; animation-delay: 1.2s; }
.signal-c { inset: 12%; animation-delay: 2.4s; }

.tower {
  position: relative;
  width: 92px;
  height: 142px;
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
  filter: drop-shadow(0 18px 24px var(--glow));
}

.tower i {
  display: block;
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.tower i:nth-child(1) { margin-inline: 0; }
.tower i:nth-child(2) { margin-inline: 8px; }
.tower i:nth-child(3) { margin-inline: 16px; }
.tower i:nth-child(4) { margin-inline: 25px; }
.tower i:nth-child(5) { margin-inline: 34px; background: var(--wood); }

.pulse-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  top: calc(50% - 79px);
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 8px var(--glow);
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes broadcast {
  0% { transform: scale(0.55); opacity: 0; }
  25% { opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 0; }
}

@keyframes pulse {
  50% { transform: scale(1.4); box-shadow: 0 0 0 14px transparent; }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--card);
}

.metric-card { padding: 30px; min-height: 190px; }
.metric-card + .metric-card { border-left: 1px solid var(--line); }
.metric-card p { margin: 0; color: var(--muted); font: 11px/1 var(--pixel); letter-spacing: 0.1em; }
.metric-card strong { display: block; margin: 28px 0 20px; font: 700 clamp(28px, 4vw, 46px)/1 var(--pixel); }
#server-age { font-size: clamp(24px, 3vw, 38px); white-space: nowrap; }
.metric-card span { color: var(--muted); font-size: 13px; line-height: 1.6; }

.panel { padding: 96px 0 20px; }
.posts-panel { padding-top: 84px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font: 700 clamp(28px, 4.5vw, 52px)/1.14 var(--pixel); letter-spacing: -0.03em; }
.section-heading .eyebrow { margin-bottom: 14px; }

.live-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--moss);
  font: 11px/1 var(--pixel);
}
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 5px var(--glow); }

.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.service {
  padding: 22px 24px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}
.service:hover { transform: translateY(-2px); border-color: var(--moss); }
.service-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--moss); }
.service-dot.offline { background: var(--wood); }
.service strong { font: 700 15px/1.2 var(--pixel); }
.service small { color: var(--muted); font: 11px/1 var(--pixel); }

.posts { border-top: 1px solid var(--line); }
.post {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.post time { color: var(--muted); font: 11px/1 var(--pixel); }
.post strong { font-size: 17px; line-height: 1.5; }
.post span { color: var(--moss); transition: transform 160ms ease; }
.post:hover span { transform: translateX(4px); }
.text-link { color: var(--moss); text-underline-offset: 5px; }
.loading { color: var(--muted); }

footer {
  min-height: 120px;
  margin-top: 80px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .site-header, main, footer { width: min(calc(100% - 28px), 1120px); }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .lede { overflow-wrap: anywhere; }
  nav a { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .beacon { width: 250px; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card + .metric-card { border-left: 0; border-top: 1px solid var(--line); }
  .services { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .post { grid-template-columns: 1fr auto; gap: 8px; }
  .post time { grid-column: 1 / -1; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
