:root {
  color-scheme: dark;
  --graphite: #0B0E13;
  --graphite-2: #151B25;
  --steel: #243040;
  --blue: #0A57FF;
  --blue-soft: #5B90FF;
  --orange: #FF5B12;
  --yellow: #FFC24B;
  --white: #F3F5F9;
  --mid: #C3CBD8;
  --note: #78859A;
  --rail-w: 248px;
  --bar-h: 64px;
  --page-x: clamp(20px, 4.5vw, 72px);
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--graphite);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--graphite);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--white);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.2;
}

h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
}

p,
dl,
dd,
dt,
figure {
  margin: 0;
}

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

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

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

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

strong {
  color: var(--white);
  font-weight: 800;
}

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

::selection {
  background: var(--blue);
  color: var(--white);
}

[hidden] {
  display: none !important;
}

#main-content {
  display: block;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-180%);
  padding: 10px 14px;
  border: 1px solid var(--graphite);
  background: var(--yellow);
  color: var(--graphite);
  font-weight: 800;
  line-height: 1.2;
}

.skip-link:focus {
  transform: translateY(0);
}

.skip-link:focus-visible {
  outline-color: var(--graphite);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.note {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.04em;
}

.content-wrap {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: var(--page-x);
}

.narrow {
  width: min(100%, 820px);
}

.page-section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--steel);
}

.eyebrow {
  color: var(--blue-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.prose {
  color: var(--mid);
  font-size: 17px;
  line-height: 1.8;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2,
.prose h3 {
  margin-top: 1.8em;
  color: var(--white);
}

.prose h2 {
  font-size: clamp(26px, 3vw, 36px);
}

.prose h3 {
  font-size: clamp(19px, 2vw, 24px);
}

.prose a {
  color: var(--blue-soft);
  border-bottom: 1px solid rgba(91, 144, 255, 0.45);
}

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

.prose ul {
  padding-left: 1.2em;
  list-style: square;
}

.prose li + li {
  margin-top: 0.5em;
}

.breadcrumb {
  padding-block: 14px;
  border-bottom: 1px solid rgba(36, 48, 64, 0.72);
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

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

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

.breadcrumb li + li::before {
  content: "/";
  color: var(--steel);
}

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

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

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

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--steel);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.btn:hover {
  border-color: var(--blue-soft);
  color: var(--blue-soft);
}

.btn-primary {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--graphite);
}

.btn-primary:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--graphite);
}

.btn-ghost {
  border-color: rgba(36, 48, 64, 0.9);
  color: var(--mid);
}

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

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

.panel-stack {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
}

.panel-stack > .panel:nth-child(even) {
  margin-left: clamp(0px, 4vw, 64px);
}

.panel {
  position: relative;
  padding: clamp(20px, 3.2vw, 40px);
  border: 1px solid var(--steel);
  background: var(--graphite-2);
}

.panel-code {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.data-strip {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--steel);
  background: var(--graphite-2);
}

.data-item {
  flex: 1 1 160px;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--steel);
}

.data-item:last-child {
  border-right: 0;
}

.data-value {
  display: block;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.data-label {
  display: block;
  margin-top: 6px;
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--steel);
  background: var(--graphite-2);
  aspect-ratio: 16 / 10;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
}

.media-frame figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--steel);
  background: rgba(11, 14, 19, 0.88);
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.vertical-note {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Header rail */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  width: var(--rail-w);
  flex-direction: column;
  border-right: 1px solid var(--steel);
  background: var(--graphite);
  color: var(--white);
}

.read-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--rail-w);
  z-index: 300;
  height: 2px;
  background: rgba(36, 48, 64, 0.65);
  pointer-events: none;
}

.read-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--blue), var(--orange));
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(36, 48, 64, 0.72);
}

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

.brand-glyph {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--steel);
}

.brand-glyph span {
  position: absolute;
  top: 6px;
  width: 4px;
  height: 18px;
  transform: skewX(-22deg);
}

.brand-glyph span:nth-child(1) {
  left: 7px;
  background: var(--blue);
}

.brand-glyph span:nth-child(2) {
  top: 4px;
  left: 14px;
  height: 22px;
  background: var(--orange);
}

.brand-glyph span:nth-child(3) {
  top: 9px;
  left: 21px;
  height: 14px;
  background: var(--yellow);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  overflow: hidden;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sub {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--steel);
  background: transparent;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--orange);
  color: var(--yellow);
}

.nav-toggle-box {
  display: grid;
  width: 16px;
  gap: 4px;
}

.nav-toggle-box span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--blue);
  transition: transform 0.2s var(--ease), width 0.2s var(--ease);
}

.nav-toggle-box span:last-child {
  width: 10px;
  justify-self: end;
  background: var(--orange);
}

.rail-nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 16px 20px;
  scrollbar-color: var(--steel) transparent;
  scrollbar-width: thin;
}

.rail-nav-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px 16px;
  border-bottom: 1px solid rgba(36, 48, 64, 0.72);
}

.rail-code {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rail-signature {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.nav-list {
  padding-block: 8px;
}

.nav-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px 8px;
  border-left: 2px solid transparent;
  color: var(--mid);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  border-left-color: rgba(91, 144, 255, 0.55);
  background: rgba(10, 87, 255, 0.07);
  color: var(--white);
}

.nav-link[aria-current="page"] {
  border-left-color: var(--blue);
  background: rgba(10, 87, 255, 0.14);
  color: var(--white);
}

.nav-index {
  color: var(--steel);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: right;
}

.nav-link:hover .nav-index {
  color: var(--blue-soft);
}

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

.nav-label {
  min-width: 0;
}

.rail-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: var(--graphite);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.rail-cta:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--graphite);
}

.rail-cta-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
}

.rail-utility {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(36, 48, 64, 0.72);
}

.utility-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.utility-btn {
  padding: 8px 6px;
  border: 1px solid var(--steel);
  background: transparent;
  color: var(--mid);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s;
}

.utility-btn:hover,
.utility-btn[aria-expanded="true"] {
  border-color: var(--blue-soft);
  color: var(--white);
}

.utility-btn[aria-expanded="true"] {
  border-color: var(--orange);
  color: var(--yellow);
}

.utility-panel {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--steel);
  background: var(--graphite-2);
}

.utility-note {
  color: var(--note);
  font-size: 12px;
  line-height: 1.6;
}

.utility-link {
  display: inline-block;
  margin-top: 8px;
  border-bottom: 1px solid rgba(91, 144, 255, 0.4);
  color: var(--blue-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.utility-link:hover {
  border-bottom-color: var(--orange);
  color: var(--white);
}

.nav-scrim {
  display: none;
}

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

/* Footer archive */
.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--steel);
  background: var(--graphite-2);
  color: var(--white);
}

.site-footer::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(36, 48, 64, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 48, 64, 0.34) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  opacity: 0.35;
  pointer-events: none;
}

.footer-main {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 1280px);
  margin-inline: auto;
  padding: clamp(36px, 6vw, 72px) var(--page-x);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 64px);
}

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

.footer-code {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-brand {
  color: var(--white);
  font-size: clamp(30px, 4.2vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.footer-brand span {
  display: block;
  margin-top: 10px;
  color: var(--mid);
  font-size: 0.44em;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.footer-domain {
  margin-top: 16px;
  color: var(--blue-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer-tagline {
  max-width: 24em;
  margin-top: 10px;
  color: var(--note);
  font-size: 14px;
  line-height: 1.7;
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 12px;
  border: 1px solid var(--steel);
  background: transparent;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, color 0.2s;
}

.back-top:hover {
  border-color: var(--orange);
  color: var(--yellow);
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 24px;
}

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

.footer-heading {
  margin-bottom: 14px;
  color: var(--mid);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 2px;
}

.footer-links a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid rgba(36, 48, 64, 0.6);
  color: var(--mid);
  font-size: 14px;
  line-height: 1.6;
  transition: color 0.2s, border-color 0.2s;
}

.footer-links a:hover {
  border-bottom-color: var(--blue);
  color: var(--blue-soft);
}

.footer-contact {
  min-width: 0;
  padding-left: clamp(0px, 3vw, 40px);
  border-left: 1px solid rgba(36, 48, 64, 0.72);
}

.contact-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.contact-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(36, 48, 64, 0.6);
}

.contact-row dt {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.08em;
}

.contact-row dd {
  color: var(--white);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

.service-note {
  max-width: 30em;
  margin-top: 14px;
  color: var(--note);
  font-size: 12px;
  line-height: 1.7;
}

.footer-base {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 1280px);
  margin-inline: auto;
  padding: 16px var(--page-x) calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--steel);
}

.footer-legal,
.footer-meta {
  color: var(--note);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-meta {
  color: var(--blue-soft);
  opacity: 0.8;
}

@media (max-width: 1023px) {
  body {
    padding-top: var(--bar-h);
  }

  .site-header {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--steel);
  }

  .rail-top {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .rail-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: min(86vw, 340px);
    border-right: 1px solid var(--steel);
    border-bottom: 0;
    background: var(--graphite);
    padding: calc(var(--bar-h) + 20px) 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
  }

  .site-header[data-open] .rail-nav {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: none;
    border: 0;
    background: rgba(11, 14, 19, 0.72);
  }

  .site-header[data-open] .nav-scrim {
    display: block;
  }

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

  .site-header[data-open] .nav-toggle-box span:last-child {
    width: 16px;
    transform: translateY(-3px) rotate(-45deg);
    justify-self: auto;
  }

  .read-progress {
    left: 0;
  }
}

@media (max-width: 980px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .footer-identity {
    grid-column: 1 / -1;
  }

  .footer-contact {
    grid-column: 1 / -1;
    padding-top: 24px;
    padding-left: 0;
    border-top: 1px solid rgba(36, 48, 64, 0.72);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  .grid-12 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-9,
  .span-12 {
    grid-column: 1 / -1;
  }

  .panel-stack > .panel:nth-child(even) {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .footer-base {
    flex-direction: column;
  }

  .contact-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .media-frame {
    aspect-ratio: 4 / 3;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
