:root {
  --ink: #0A0F14;
  --panel: #141C23;
  --grid: #1F2B33;
  --grid-strong: #2C3D48;
  --ice: #E8F1F5;
  --mist: #9FB3C0;
  --orange: #F05A28;
  --orange-lt: #FF7A45;
  --lime: #B7FF3C;
  --blue: #2EA8FF;
  --orange-deep: #5C1E0F;

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

  --shell: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --dur: 260ms;
}

@media (min-width: 901px) {
  :root { --header-h: 78px; }
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(159, 179, 192, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(159, 179, 192, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .008em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--ice);
}

h1, .h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); }
h2, .h2 { font-size: clamp(1.55rem, 3.2vw, 2.5rem); }
h3, .h3 { font-size: clamp(1.12rem, 1.9vw, 1.45rem); }

p { margin: 0; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--ice); }

ul, ol { margin: 0; padding: 0; }

button { font: inherit; color: inherit; }

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

.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;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--ink);
}
#main-content:focus { outline: none; }

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

.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }
.section--panel {
  background: var(--panel);
  border-block: 1px solid var(--grid-strong);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(22px, 3vw, 40px);
}

.section-title {
  margin-top: 8px;
  font-size: clamp(1.6rem, 3.4vw, 2.8rem);
  line-height: 1.04;
}

.section-desc {
  max-width: 46ch;
  color: var(--mist);
  font-size: 15px;
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange);
  flex: 0 0 auto;
}

.lede {
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  line-height: 1.72;
  color: #C9D8E0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--orange);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.link-more:hover,
.link-more:focus-visible {
  color: var(--orange-lt);
  border-bottom-color: currentColor;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(10, 15, 20, 0);
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.site-header[data-scrolled="true"],
.site-header[data-nav-open="true"] {
  background: rgba(8, 12, 16, .94);
  border-bottom-color: var(--grid-strong);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 2;
  pointer-events: none;
}

.header-inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--ice);
  text-decoration: none;
}
.brand:hover { color: var(--ice); }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--orange);
  color: #0A0F14;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
  transition: background-color var(--dur) var(--ease-out);
}
.brand:hover .brand-mark { background: var(--orange-lt); }

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.18;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ice);
}
.brand-note {
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--mist);
}

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

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 22px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { flex: 0 0 auto; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 2px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--mist);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur) var(--ease-out);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur) var(--ease-out);
}
.nav-link:hover,
.nav-link:focus-visible { color: var(--ice); }
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--ice); font-weight: 700; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-foot { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: 0 0 auto;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid rgba(183, 255, 60, .32);
  background: rgba(183, 255, 60, .06);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--lime);
}
.version-dot {
  width: 5px;
  height: 5px;
  background: var(--lime);
  flex: 0 0 auto;
}
.version-label { line-height: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--grid-strong);
  color: var(--ice);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.nav-toggle:hover { border-color: var(--orange); }

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    display: block;
    background: #0B1116;
    border-bottom: 1px solid var(--grid-strong);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .55);
    padding: 6px var(--gutter) 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    max-height: calc(100vh - var(--header-h) - 8px);
    overflow-y: auto;
    transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility .22s;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid var(--grid); }
  .nav-item:last-child { border-bottom: 0; }
  .nav-link {
    display: block;
    width: 100%;
    padding: 15px 0;
    font-size: 17px;
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--orange); }
  .nav-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--grid);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .08em;
    color: var(--mist);
  }
  .nav-foot-value { color: var(--lime); }
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .version-chip { display: none; }
  .brand-note { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--orange);
  color: #0A0F14;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
}
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--orange-lt); color: #0A0F14; }

.btn--ghost {
  background: transparent;
  border-color: var(--grid-strong);
  color: var(--ice);
}
.btn--ghost:hover,
.btn--ghost:focus-visible { border-color: var(--orange); color: var(--orange-lt); }

.btn--sm {
  min-height: 40px;
  padding: 0 15px;
  font-size: 13.5px;
}

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--grid-strong);
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--mist);
  cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.chip:hover { color: var(--ice); border-color: var(--mist); }
.chip[aria-pressed="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: #0A0F14;
  font-weight: 700;
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--mist);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li::after { content: "/"; color: var(--grid-strong); }
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--mist); }
.breadcrumb a:hover { color: var(--ice); }
.breadcrumb [aria-current="page"] { color: var(--ice); }

/* ---------- data strip ---------- */
.data-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  padding-block: 11px;
  border-block: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}
.strip-item { display: inline-flex; align-items: center; gap: 8px; }
.strip-key { color: var(--mist); opacity: .72; }
.strip-val { color: var(--ice); }
.strip-val--lime { color: var(--lime); }

/* ---------- bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
}

.bento-cell {
  position: relative;
  grid-column: span 4;
  min-width: 0;
  padding: clamp(16px, 2.1vw, 28px);
  background: var(--panel);
  border: 1px solid var(--grid-strong);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.bento-cell:hover { border-color: #3C5563; }

.bento-cell--focus {
  grid-column: span 8;
  background: linear-gradient(150deg, #101A22 0%, #0C1218 58%, #0A0F14 100%);
}
.bento-cell--focus::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--orange);
}
.bento-cell--wide { grid-column: span 8; }
.bento-cell--tall { grid-row: span 2; }
.bento-cell--half { grid-column: span 6; }

.panel-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 8px;
  border: 1px solid rgba(46, 168, 255, .34);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--blue);
}

.panel-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.9vw, 1.5rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.015em;
  color: var(--ice);
}

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento-cell { grid-column: span 6; }
  .bento-cell--half { grid-column: span 3; }
  .bento-cell--focus,
  .bento-cell--wide { grid-column: span 6; }
}

@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento-cell,
  .bento-cell--half,
  .bento-cell--focus,
  .bento-cell--wide { grid-column: span 1; }
  .bento-cell--tall { grid-row: auto; }
}

/* ---------- prose ---------- */
.prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.8;
  color: #C9D8E0;
}
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 1.9em; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .4em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ice); font-weight: 700; }
.prose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--orange);
  color: var(--ice);
}

/* ---------- media frame ---------- */
.media-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--grid-strong);
  background:
    linear-gradient(135deg, rgba(46, 168, 255, .14), rgba(240, 90, 40, .12)),
    var(--panel);
}
.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(159, 179, 192, .13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(159, 179, 192, .13) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .45;
}
.media-frame img,
.media-frame video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--portrait { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--cut {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
}
.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(10, 15, 20, .92), rgba(10, 15, 20, 0));
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--mist);
}

/* ---------- reveal ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}
[data-reveal] {
  transition:
    opacity .4s var(--ease-out),
    transform .4s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 70ms);
}
.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(56px, 9vw, 112px);
  background: #080C10;
  border-top: 1px solid var(--grid-strong);
  color: var(--mist);
  font-size: 14px;
}
.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--orange) 0 160px, var(--lime) 160px 182px, var(--grid-strong) 182px 100%);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.35fr);
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 48px);
}

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

.footer-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ice);
  max-width: 18ch;
}

.footer-note {
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--mist);
}

.footer-col-title {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--ice);
}

.footer-links { list-style: none; display: grid; gap: 10px; }

.footer-link {
  display: inline-block;
  color: var(--mist);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--ice);
  transform: translateX(3px);
}

.footer-contact { list-style: none; display: grid; gap: 12px; }
.footer-contact-item { display: grid; gap: 1px; }
.contact-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: .78;
}
.contact-value {
  color: var(--ice);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.contact-value--mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.footer-col--contact .footer-note { margin-top: 14px; max-width: none; }

.footer-strip {
  background: #0A0F14;
  border-top: 1px solid var(--grid);
}
.footer-strip .data-strip {
  border-block: 0;
  padding-block: 13px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 18px 26px;
  border-top: 1px solid var(--grid);
  font-size: 12.5px;
  color: var(--mist);
}
.footer-copy { margin: 0; letter-spacing: .01em; }

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  list-style: none;
}
.legal-links a {
  color: var(--mist);
  text-decoration: none;
  transition: color var(--dur) var(--ease-out);
}
.legal-links a:hover,
.legal-links a:focus-visible { color: var(--orange-lt); }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-tagline,
  .footer-note { max-width: none; }
}

@media (max-width: 560px) {
  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- motion preferences ---------- */
@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: 0ms !important;
  }
  [data-reveal],
  .has-js [data-reveal] {
    transform: none !important;
  }
  .btn:hover,
  .footer-link:hover { transform: none; }
  .site-nav { transform: none !important; }
}
