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

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

body,
h1, h2, h3, h4, h5,
p, ul, ol, dl, dt, dd, figure, blockquote, fieldset {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

/* ============ tokens ============ */
:root {
  --ink-900: #071521;
  --ink-800: #0a1c2b;
  --ink-700: #0e2436;
  --line-600: #1e3a4f;
  --line-500: #2a4e68;

  --cyan: #2de2d0;
  --orange: #ff9b54;
  --sage: #a9c7b4;
  --mist: #e8f0f6;
  --slate: #8fa6b8;
  --coral: #ff6e6a;
  --mint: #6fe3b0;

  --glass: rgba(14, 36, 54, 0.72);
  --glass-strong: rgba(14, 36, 54, 0.92);

  --rail-w: 266px;
  --gap: 18px;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  --font-display: "Barlow Condensed", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-panel: 0 26px 52px -34px rgba(0, 0, 0, 0.94);
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ============ base typography ============ */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  color: var(--mist);
  background-color: var(--ink-900);
  background-image:
    radial-gradient(760px 460px at 84% -12%, rgba(45, 226, 208, 0.1), transparent 70%),
    radial-gradient(560px 380px at 0% 0%, rgba(255, 155, 84, 0.07), transparent 72%),
    linear-gradient(rgba(45, 226, 208, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 226, 208, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--mist);
}

h1 { font-size: clamp(40px, 6vw, 78px); }
h2 { font-size: clamp(26px, 3.4vw, 38px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }
h4 { font-size: 18px; letter-spacing: 0; }

p { max-width: 38em; }

strong { color: var(--mist); font-weight: 700; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--cyan);
}

/* ============ utilities ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - 32px, 780px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(32px, 5.5vw, 68px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--sage);
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--cyan);
}

.skip-link {
  position: absolute;
  top: -72px;
  left: 14px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--cyan);
  color: #04212b;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: top 0.16s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* ============ header : framework rail ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 21, 33, 0.95);
  border-bottom: 1px solid var(--line-600);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background 0.2s var(--ease);
}

.site-header[data-open] {
  background: rgba(7, 21, 33, 0.99);
}

.rail {
  display: flex;
  flex-direction: column;
  padding: 0 18px 16px;
}

/* status strip */
.rail__strip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-600);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
}

.rail__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(45, 226, 208, 0.16);
  animation: railPulse 3.2s ease-in-out infinite;
}

@keyframes railPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(45, 226, 208, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(45, 226, 208, 0.04); }
}

.rail__strip-label {
  color: var(--slate);
}

.rail__ver {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rail__sep {
  color: var(--line-500);
}

.rail__strip-note {
  color: var(--sage);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* brand row */
.rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--cyan), var(--sage));
  color: #04212b;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--mist);
}

.brand__tag {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--slate);
  letter-spacing: 0.01em;
}

/* mobile toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--line-600);
  border-radius: 9px;
  color: var(--mist);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.site-header[data-open] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.site-header[data-open] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.site-header[data-open] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* nav */
.rail__nav {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.26s var(--ease), opacity 0.18s var(--ease), visibility 0s linear 0.26s;
}

.site-header[data-open] .rail__nav {
  max-height: min(62vh, 460px);
  opacity: 1;
  visibility: visible;
  overflow-y: auto;
  pointer-events: auto;
  transition: max-height 0.26s var(--ease), opacity 0.18s var(--ease), visibility 0s;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-block: 4px;
}

.nav-list__link {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14.5px;
  color: var(--slate);
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-list__idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--line-500);
  transition: color 0.16s var(--ease);
}

.nav-list__link:hover {
  background: rgba(45, 226, 208, 0.07);
  color: var(--mist);
}

.nav-list__link:hover .nav-list__idx {
  color: var(--cyan);
}

.nav-list__link[aria-current="page"] {
  color: var(--cyan);
  background: rgba(45, 226, 208, 0.1);
  border-color: rgba(45, 226, 208, 0.28);
  font-weight: 600;
}

.nav-list__link[aria-current="page"] .nav-list__idx {
  color: rgba(45, 226, 208, 0.62);
}

/* rail foot */
.rail__foot {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: max-height 0.26s var(--ease), opacity 0.18s var(--ease), visibility 0s linear 0.26s;
}

.site-header[data-open] .rail__foot {
  max-height: 260px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-600);
  transition: max-height 0.26s var(--ease), opacity 0.18s var(--ease), visibility 0s;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--slate);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend__dot--current { background: var(--cyan); }
.legend__dot--check { background: var(--orange); }
.legend__dot--legacy { background: var(--sage); }

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--cyan);
  color: #04212b;
}

.btn--primary:hover {
  background: #5ff0e2;
}

.btn--orange {
  background: var(--orange);
  color: #2a1204;
}

.btn--orange:hover {
  background: #ffb079;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-600);
  color: var(--mist);
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ============ surfaces ============ */
.panel {
  background: var(--glass);
  border: 1px solid var(--line-600);
  border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow-panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.panel--solid {
  background: var(--ink-700);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.panel--stack {
  margin-top: var(--gap);
}

/* ============ grid ============ */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid--2,
.grid--3 {
  grid-template-columns: 1fr;
}

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
}

@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============ tags ============ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag--current {
  color: var(--cyan);
  border-color: rgba(45, 226, 208, 0.4);
  background: rgba(45, 226, 208, 0.1);
}

.tag--check {
  color: var(--orange);
  border-color: rgba(255, 155, 84, 0.4);
  background: rgba(255, 155, 84, 0.1);
}

.tag--legacy {
  color: var(--sage);
  border-color: rgba(169, 199, 180, 0.4);
  background: rgba(169, 199, 180, 0.1);
}

.tag--alert {
  color: var(--coral);
  border-color: rgba(255, 110, 106, 0.4);
  background: rgba(255, 110, 106, 0.1);
}

.tag--ok {
  color: var(--mint);
  border-color: rgba(111, 227, 176, 0.4);
  background: rgba(111, 227, 176, 0.1);
}

/* ============ breadcrumb ============ */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--slate);
  transition: color 0.16s var(--ease);
}

.breadcrumb a:hover {
  color: var(--cyan);
}

.breadcrumb__sep {
  color: var(--line-500);
}

.breadcrumb [aria-current="page"] {
  color: var(--mist);
}

/* ============ media container ============ */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-600);
  border-radius: var(--r-md);
  background:
    linear-gradient(150deg, rgba(14, 36, 54, 0.94), rgba(7, 21, 33, 0.98));
  aspect-ratio: 16 / 10;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(45, 226, 208, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 226, 208, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.85;
}

.media > img,
.media > picture > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 16 / 9; }
.media--band { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 4 / 5; }

.media__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--slate);
}

/* ============ section anchors ============ */
a[aria-current="location"] {
  color: var(--cyan);
}

/* ============ scroll progress & back-to-top ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  pointer-events: none;
  transition: transform 0.1s linear;
}

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-600);
  border-radius: 50%;
  background: rgba(14, 36, 54, 0.86);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s, border-color 0.16s var(--ease);
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s, border-color 0.16s var(--ease);
}

.to-top:hover {
  border-color: var(--cyan);
}

/* ============ footer ============ */
.site-footer {
  margin-top: clamp(36px, 6vw, 72px);
  padding-block: clamp(38px, 5vw, 58px) 26px;
  border-top: 1px solid var(--line-600);
  background:
    linear-gradient(180deg, rgba(10, 28, 43, 0.55), rgba(7, 21, 33, 0.98) 62%),
    var(--ink-900);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}

.footer-col {
  min-width: 0;
}

.footer-col--brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.brand--footer .brand__name {
  font-size: 17px;
}

.brand--footer .brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 14px;
}

.footer-note {
  max-width: 30em;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--slate);
}

.footer-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--line-600);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.footer-stamp__key {
  color: var(--slate);
}

.footer-stamp__val {
  color: var(--cyan);
  font-weight: 700;
}

.footer-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--sage);
}

.footer-title::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--cyan);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
}

.footer-links--tight {
  margin-bottom: 22px;
}

.footer-links a {
  color: var(--slate);
  transition: color 0.16s var(--ease), padding-left 0.16s var(--ease);
}

.footer-links a:hover {
  color: var(--cyan);
  padding-left: 3px;
}

.footer-defs {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
}

.footer-defs dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--line-500);
}

.footer-defs dd {
  margin: 0;
  color: var(--mist);
  word-break: break-word;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 22px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line-600);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.footer-copy,
.footer-icp {
  max-width: none;
}

/* ============ responsive shell ============ */
@media (max-width: 420px) {
  .rail__sep,
  .rail__strip-note {
    display: none;
  }

  .rail__strip {
    font-size: 10.5px;
  }
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.3fr 1fr;
  }

  .footer-col--brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  body {
    padding-left: var(--rail-w);
  }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    border-bottom: 0;
    border-right: 1px solid var(--line-600);
    background: linear-gradient(180deg, rgba(10, 28, 43, 0.96), rgba(7, 21, 33, 0.99));
  }

  .rail {
    height: 100%;
    padding: 20px 18px 22px;
    gap: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-600) transparent;
  }

  .rail__head {
    padding: 0;
  }

  .rail__nav,
  .rail__foot {
    max-height: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    pointer-events: auto;
    transition: none;
  }

  .rail__foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line-600);
  }

  .nav-toggle {
    display: none;
  }

  .scroll-progress {
    left: var(--rail-w);
    width: calc(100% - var(--rail-w));
  }

  .to-top {
    right: 24px;
    bottom: 24px;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1.2fr;
    gap: 40px;
  }

  .footer-col--brand {
    grid-column: auto;
  }
}

@media (min-width: 1280px) {
  :root {
    --rail-w: 288px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .rail__dot {
    animation: none;
  }
}
