@font-face {
  font-family: "Syne";
  src: url("../fonts/syne-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("../fonts/syne-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bay: #c5ced6;
  --chassis: #2c333e;
  --chassis-2: #232830;
  --face: #eef2f5;
  --face-2: #e3e9ee;
  --ink: #1b232c;
  --mute: #5c6b7a;
  --line: #b7c2cc;
  --ceramic: #2a6b82;
  --ceramic-ink: #e7f4f8;
  --amber: #d89a2b;
  --copper: #a66b42;
  --led-ok: #3fa37a;
  --cat-net: #4c84c4;
  --cat-kern: #d4783a;
  --cat-sched: #5a8f62;
  --cat-proto: #8b6914;
  --measure: 38rem;
  --rack: 52rem;
  --u: 4.35rem;
  --ear: 1.7rem;
  --display: "LXGW WenKai Lite", "LXGW WenKai", "KaiTi", "STKaiti", "Songti SC", serif;
  --sans: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "Sarasa Mono SC", "Noto Sans Mono CJK SC", ui-monospace, monospace;
  --wordmark: "Syne", "IBM Plex Sans", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bay);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255, 255, 255, 0.35), transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(44, 51, 62, 0.04) 47px,
      rgba(44, 51, 62, 0.04) 48px
    );
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: var(--ceramic);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 20;
  background: var(--chassis);
  color: var(--face);
  padding: 0.5rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skip:focus {
  top: 0.75rem;
}

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

/* —— mast —— */
.mast {
  background: var(--chassis);
  color: #d7dde6;
  border-bottom: 4px solid var(--copper);
}

.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.led {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(216, 154, 43, 0.25), 0 0 10px var(--amber);
  flex: 0 0 auto;
}

.led.ok {
  background: var(--led-ok);
  box-shadow: 0 0 0 2px rgba(63, 163, 122, 0.25), 0 0 8px var(--led-ok);
}

.led.blink {
  animation: breathe 2.4s ease-in-out infinite;
}

.wordmark {
  font-family: var(--wordmark);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-kicker {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b96a6;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  color: #9aa6b4;
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: #f3f6f8;
  border-bottom-color: var(--amber);
}

/* —— serial console hero —— */
.console {
  background: var(--chassis-2);
  color: #c5d0b8;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 1.35rem 0 1.2rem;
  border-bottom: 1px solid #3a424e;
}

.console-inner {
  display: grid;
  gap: 0.35rem;
}

.console .dim {
  color: #7d8774;
}

.console .prompt {
  color: var(--amber);
}

.console h1 {
  margin: 0.45rem 0 0.15rem;
  color: #f2f5e8;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.console .cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--amber);
  transform: translateY(0.12em);
  animation: blink 1.05s steps(1) infinite;
}

.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.7rem;
  color: #9aa68c;
}

.console-actions a {
  color: #d5e0c8;
  text-decoration: none;
  border-bottom: 1px solid var(--ceramic);
}

.console-actions a:hover {
  color: #fff;
}

/* —— rack —— */
.stage {
  padding: 1.75rem 0 3.5rem;
}

.rack-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

.rack {
  display: grid;
  grid-template-columns: var(--ear) 1fr var(--ear);
  background: var(--chassis);
  box-shadow:
    0 18px 40px rgba(28, 34, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ear {
  background: linear-gradient(90deg, #1f242c, #2a313c 40%, #1f242c);
  position: relative;
}

.ear::before {
  content: "";
  position: absolute;
  inset: 3px 0.45rem;
  background-image:
    radial-gradient(circle, #0b0e12 1.55px, transparent 1.7px),
    radial-gradient(circle, #0b0e12 1.55px, transparent 1.7px);
  background-size: 100% calc(var(--u) + 3px);
  background-position: 50% 0.7rem, 50% calc(var(--u) - 1.05rem);
  background-repeat: repeat-y;
}

.units {
  background: #1a1f27;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
}

.u {
  min-height: var(--u);
  background: var(--face);
  display: grid;
  grid-template-columns: 3.4rem 0.42rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.85rem;
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

a.u:hover,
a.u:focus-visible {
  background: #f7fafc;
  color: inherit;
}

a.u:hover .u-title,
a.u:focus-visible .u-title {
  color: var(--ceramic);
}

.u::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--copper);
}

a.u:hover::before,
a.u:focus-visible::before {
  width: 3px;
}

.u-id {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--mute);
}

.cable {
  width: 0.42rem;
  align-self: stretch;
  margin: 0.45rem 0;
  background: var(--cat, var(--ceramic));
}

.u-body {
  min-width: 0;
  padding: 0.45rem 0;
}

.u-title,
.u-deck {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u-title {
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.25;
  color: var(--ink);
}

.u-deck {
  margin-top: 0.12rem;
  font-size: 0.78rem;
  color: var(--mute);
}

.u-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--mute);
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.u-meta .led {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.45rem;
  width: 0.42rem;
  height: 0.42rem;
}

.u.is-filter {
  background: var(--face-2);
  grid-template-columns: 3.4rem 1fr;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.filter {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--face);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.filter[aria-pressed="true"] {
  background: var(--chassis);
  color: var(--face);
  border-color: var(--chassis);
}

.filter .dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.3rem;
  vertical-align: middle;
  background: currentColor;
}

.filter[data-cat="net"] .dot { background: var(--cat-net); }
.filter[data-cat="kern"] .dot { background: var(--cat-kern); }
.filter[data-cat="sched"] .dot { background: var(--cat-sched); }
.filter[data-cat="proto"] .dot { background: var(--cat-proto); }

.u.is-empty {
  background: repeating-linear-gradient(
    -45deg,
    var(--face-2),
    var(--face-2) 8px,
    #e8eef2 8px,
    #e8eef2 16px
  );
  color: var(--mute);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.u.is-hidden {
  display: none;
}

.u.enter {
  animation: slide-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.u.enter:nth-child(1) { animation-delay: 0.02s; }
.u.enter:nth-child(2) { animation-delay: 0.07s; }
.u.enter:nth-child(3) { animation-delay: 0.12s; }
.u.enter:nth-child(4) { animation-delay: 0.17s; }
.u.enter:nth-child(5) { animation-delay: 0.22s; }
.u.enter:nth-child(6) { animation-delay: 0.27s; }
.u.enter:nth-child(7) { animation-delay: 0.32s; }

/* —— article —— */
.article-mast {
  padding: 1.6rem 0 0.4rem;
}

.crumb {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--mute);
  letter-spacing: 0.04em;
}

.crumb a {
  color: var(--mute);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--ceramic);
}

.ptouch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.9rem 0 0.5rem;
  background: #f4e8c1;
  color: #1a1a16;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem 0.22rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.ptouch .cable {
  margin: 0;
  height: 0.7rem;
  width: 0.55rem;
  align-self: center;
}

.article h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
  margin: 0.35rem 0 0.6rem;
}

.byline {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mute);
}

.prose {
  width: min(100%, var(--measure));
  padding: 1.1rem 0 3rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 1.1rem;
}

.prose h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 2rem 0 0.7rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--face-2);
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.prose pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--chassis);
  color: #d5ddd0;
  padding: 0.9rem 1rem;
  overflow: auto;
  margin: 0 0 1.2rem;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.prose blockquote {
  margin: 0 0 1.2rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--copper);
  color: #33404c;
}

.prose .kicker-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mute);
  letter-spacing: 0.04em;
  margin-top: 2.4rem;
}

/* —— about —— */
.about {
  width: min(100%, 40rem);
  padding: 2rem 0 3.5rem;
}

.about h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 500;
  margin: 0 0 1rem;
}

.about p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 1rem;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
  margin: 1.6rem 0 2rem;
}

.spec th,
.spec td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.spec th {
  color: var(--mute);
  font-weight: 500;
  width: 7.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* —— 404 —— */
.vacant {
  padding: 3rem 0 4rem;
}

.vacant .rack {
  max-width: 36rem;
}

.vacant-copy {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.vacant-copy h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}

/* —— footer —— */
.colophon {
  border-top: 1px solid rgba(44, 51, 62, 0.18);
  padding: 1.4rem 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.colophon a {
  color: var(--mute);
  text-decoration: none;
}

.colophon a:hover {
  color: var(--ink);
}

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

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

@keyframes slide-in {
  from { transform: translateX(-0.7rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 720px) {
  .wrap {
    width: min(calc(100% - 1.25rem), var(--rack));
  }

  .rack {
    grid-template-columns: 1fr;
  }

  .ear {
    display: none;
  }

  .u {
    grid-template-columns: 2.6rem 0.38rem 1fr;
    gap: 0.5rem;
    padding: 0.15rem 0.7rem 0.15rem 0.55rem;
  }

  .u-meta {
    grid-column: 3;
    text-align: left;
    padding-bottom: 0.4rem;
  }

  .u.is-filter {
    grid-template-columns: 1fr;
    padding: 0.55rem 0.7rem;
  }

  .u.is-filter .u-id {
    display: none;
  }

  .u-title,
  .u-deck {
    white-space: normal;
  }

  .brand-kicker {
    display: none;
  }

  .console h1 {
    font-size: 1.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .led.blink,
  .console .cursor,
  .u.enter {
    animation: none;
  }
}

@media print {
  .mast, .console, .colophon, .filters, .ear, .skip { display: none !important; }
  body { background: #fff; }
  .prose { width: 100%; }
}
