:root {
  --space: #0B1B2B;
  --panel: #10263A;
  --divide: #16344D;
  --blue: #1F4E79;
  --link: #2E7FB8;
  --tick: #7FB2D6;
  --paper: #F2F5F7;
  --ice: #D7E3EC;
  --orange: #FF6A1A;
  --green: #37C08A;
  --gray: #8A99A6;

  --font-sans: "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --shell-w: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --cut: 16px;
  --band-h: 52px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  padding-bottom: calc(var(--band-h) + 8px);
  background-color: var(--space);
  color: var(--ice);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--link); }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--paper);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; }

::selection {
  background: var(--orange);
  color: #0B1B2B;
}

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

[id] { scroll-margin-top: 132px; }

/* ============ shell & surfaces ============ */
.shell {
  width: 100%;
  max-width: var(--shell-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.surface-paper {
  background: var(--paper);
  color: var(--space);
}

.surface-paper h1,
.surface-paper h2,
.surface-paper h3,
.surface-paper h4 { color: var(--space); }

.cut-panel {
  position: relative;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--divide);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: box-shadow .2s var(--ease), background-color .2s var(--ease);
}

.cut-panel:hover { box-shadow: inset 0 0 0 1px var(--orange); }

.divider {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--divide);
}

.index-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--orange);
  line-height: 1;
}

/* ============ skip link ============ */
.skip-link {
  position: absolute;
  left: 16px;
  top: -90px;
  z-index: 120;
  padding: 10px 20px;
  background: var(--orange);
  color: #0B1B2B;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: top .18s var(--ease);
}

.skip-link:focus { top: 10px; }

/* ============ header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--space);
  border-bottom: 1px solid var(--divide);
  transition: box-shadow .2s var(--ease);
}

.site-header[data-scrolled] {
  box-shadow: 0 12px 30px rgba(3, 12, 22, .55);
}

.header-top {
  border-bottom: 1px solid var(--divide);
}

.header-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 11px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.brand__mark {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 100% 64%, 64% 100%, 0 100%);
}

.brand__mark::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  background: var(--orange);
  transform: translateY(-50%) rotate(-34deg);
}

.brand__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--ice);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .26em;
  color: var(--gray);
  margin-top: 2px;
}

.header-hint {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--gray);
}

.header-hint__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 192, 138, .14);
}

.header-bar { position: relative; }

.header-bar__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

.site-nav { flex: 1 1 auto; }

.nav-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.nav-item { display: flex; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding: 15px 20px 15px 0;
  margin-right: 20px;
  color: var(--ice);
  font-size: 14px;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color .16s var(--ease);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--gray);
  transition: color .16s var(--ease);
}

.nav-text { white-space: nowrap; }

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 20px;
  bottom: 0;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .16s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible { color: var(--paper); }

.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-link[aria-current="page"] { color: var(--paper); }

.nav-link[aria-current="page"] .nav-index { color: var(--orange); }

.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  background: none;
  border: 0;
  color: var(--ice);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  cursor: pointer;
}

.nav-toggle__bars {
  position: relative;
  width: 20px;
  height: 12px;
  flex: 0 0 auto;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transition: transform .2s var(--ease), top .2s var(--ease), bottom .2s var(--ease);
}

.nav-toggle__bars::before { top: 2px; }
.nav-toggle__bars::after { bottom: 2px; }

[data-nav-toggle][aria-expanded="true"] .nav-toggle__bars::before {
  top: 5px;
  transform: rotate(45deg);
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle__bars::after {
  bottom: 6px;
  transform: rotate(-45deg);
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: var(--orange);
  pointer-events: none;
}

/* ============ footer ============ */
.site-footer {
  position: relative;
  background: var(--space);
  border-top: 1px solid var(--divide);
  padding-top: 10px;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background-image: repeating-linear-gradient(90deg, var(--divide) 0 1px, transparent 1px 34px);
  pointer-events: none;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(24px, 3.5vw, 48px);
  padding-block: clamp(36px, 5vw, 64px);
}

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

.footer-brand__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray);
  max-width: 30ch;
}

.footer-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--tick);
  text-transform: uppercase;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--divide);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  display: inline-block;
  color: var(--ice);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--gray);
}

.footer-contact__val {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ice);
  word-break: break-word;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px;
  border-top: 1px solid var(--divide);
}

.footer-legal__text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--gray);
}

.footer-legal__text--dim { color: #5C6B78; }

.stable-band {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: var(--space);
  border-top: 1px solid var(--divide);
  box-shadow: 0 -10px 26px rgba(3, 12, 22, .55);
}

.stable-band__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--band-h);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--gray);
}

.stable-band__status {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 192, 138, .14);
}

.stable-band__label { color: var(--ice); }

.stable-band__value {
  color: var(--orange);
  font-weight: 600;
  letter-spacing: .08em;
}

.stable-band__meta {
  padding-left: 12px;
  border-left: 1px solid var(--divide);
  color: var(--gray);
}

.stable-band__link {
  margin-left: auto;
  color: var(--tick);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}

.stable-band__link:hover,
.stable-band__link:focus-visible {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: transparent;
  border: 0;
  color: var(--ice);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--divide);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
  transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  background: var(--blue);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.btn--primary {
  background: var(--orange);
  color: #0B1B2B;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--orange);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #FF8543;
  color: #0B1B2B;
  box-shadow: inset 0 0 0 1px #FF8543;
}

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--divide);
}

/* ============ breadcrumb ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--gray);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--divide);
}

.breadcrumb__link {
  color: var(--tick);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}

.breadcrumb__link:hover,
.breadcrumb__link:focus-visible {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ============ prose ============ */
.prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ice);
}

.surface-paper .prose { color: var(--space); }

.prose h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  margin: 2em 0 .7em;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.6em 0 .5em;
  padding-left: 12px;
  border-left: 2px solid var(--orange);
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.2em;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li { margin-bottom: .45em; }

.prose a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--divide);
  transition: color .16s var(--ease), border-color .16s var(--ease);
}

.prose a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.surface-paper .prose a { color: var(--blue); }

/* ============ grids ============ */
.grid {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
}

.grid--split {
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
}

.grid--aside {
  grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
}

/* ============ media ============ */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--divide);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
  aspect-ratio: 16 / 9;
}

.media-frame > img,
.media-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 12px;
  background: var(--space);
  color: var(--tick);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--gray);
}

/* ============ page entry ============ */
.page-head {
  padding-block: clamp(28px, 4vw, 48px) 0;
}

main { display: block; }

#main-content { display: block; }

/* ============ responsive ============ */
@media (max-width: 940px) {
  .header-hint { display: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-bar__inner {
    justify-content: flex-end;
    align-items: center;
  }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: 0 0 auto;
    background: var(--panel);
    border-top: 1px solid var(--divide);
    border-bottom: 1px solid var(--divide);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
    transition: max-height .24s var(--ease), visibility .24s step-end;
  }
  .site-nav[data-open] {
    max-height: min(72vh, 460px);
    overflow-y: auto;
    visibility: visible;
    transition: max-height .24s var(--ease), visibility 0s;
  }
  .nav-list {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .nav-item { width: 100%; }
  .nav-link {
    width: 100%;
    margin-right: 0;
    padding: 15px var(--gutter);
    border-bottom: 1px solid var(--divide);
    justify-content: flex-start;
  }
  .nav-link::after {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 3px;
    height: auto;
    transform: scaleY(0);
    transform-origin: center top;
  }
  .nav-link:hover::after,
  .nav-link:focus-visible::after,
  .nav-link[aria-current="page"]::after { transform: scaleY(1); }

  .grid--split,
  .grid--aside { grid-template-columns: minmax(0, 1fr); }

  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .stable-band__meta { display: none; }
}

@media (max-width: 620px) {
  :root { --band-h: 50px; --gutter: 18px; }

  body { font-size: 15.5px; }

  .header-top__inner { padding-block: 9px; gap: 12px; }

  .brand__sub { display: none; }

  .brand__name { font-size: 14px; letter-spacing: .08em; }

  .footer-main { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .footer-legal { flex-direction: column; align-items: flex-start; }

  .stable-band__inner { font-size: 11px; gap: 8px; }

  .stable-band__link { font-size: 11px; }

  .footer-brand { gap: 12px; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}
