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

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

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

ol, ul { list-style: none; }

a { color: inherit; }

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

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

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

/* ============ tokens ============ */
:root {
  --abyss: #050D18;
  --deep: #0A1B2E;
  --harbor: #12314F;
  --steel: #244866;
  --orange: #FF5A1F;
  --ember: #FFB38A;
  --cyan: #2DF5C8;
  --ice: #F4F9FC;
  --mist: #8EA6B8;
  --amber: #FFC857;

  --bg: var(--abyss);
  --surface: var(--deep);
  --line: rgba(36, 72, 102, 0.92);
  --line-soft: rgba(36, 72, 102, 0.5);
  --text: var(--ice);
  --text-dim: var(--mist);

  --font-display: "Helvetica Neue", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-data: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail-w: 272px;
  --header-h: 64px;
  --gutter: clamp(18px, 4vw, 40px);
  --grid-gap: clamp(14px, 1.8vw, 24px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --rail-w: 236px; }
}

/* ============ base ============ */
body {
  min-height: 100vh;
  background-color: var(--abyss);
  background-image:
    radial-gradient(70% 46% at 84% -10%, rgba(255, 90, 31, 0.10), transparent 62%),
    radial-gradient(52% 38% at 2% 2%, rgba(45, 245, 200, 0.07), transparent 64%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ============ header shell ============ */
.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: var(--rail-w);
  display: flex;
  background: linear-gradient(180deg, rgba(5, 13, 24, 0.62) 0%, rgba(5, 13, 24, 0.94) 100%);
  border-right: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.24s var(--ease), border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.site-header[data-scrolled="true"] {
  background: var(--deep);
  border-right: 1px solid var(--line);
  box-shadow: 24px 0 60px -50px rgba(0, 0, 0, 0.95);
}

.site-header__rail {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  padding: 28px 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* ============ progress ============ */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: 2px;
  background: rgba(36, 72, 102, 0.38);
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--orange) 100%);
  box-shadow: 0 0 12px rgba(45, 245, 200, 0.4);
  transition: width 0.08s linear;
}

/* ============ skip link ============ */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--orange);
  color: #120703;
  font: 600 13px/1 var(--font-body);
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}

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

/* ============ brand ============ */
.brand {
  display: inline-flex;
  align-items: flex-start;
  gap: 11px;
  text-decoration: none;
  color: var(--ice);
}

.brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border: 1px solid var(--orange);
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.22), rgba(45, 245, 200, 0.12));
}

.brand__mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--orange);
}

.brand__mark::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  background: var(--cyan);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand__line {
  font: 400 10.5px/1.4 var(--font-data);
  letter-spacing: 0.14em;
  color: var(--mist);
}

/* ============ nav toggle ============ */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ice);
  font: 500 11px/1 var(--font-data);
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

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

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 9px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  background: var(--orange);
  transition: transform 0.2s var(--ease);
}

.site-header[data-open="true"] .nav-toggle__bars span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle__bars span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

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

/* ============ nav ============ */
.site-nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 18px;
}

.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav__item { list-style: none; }

.site-nav__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 2px;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.site-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--ice);
  background: rgba(18, 49, 79, 0.55);
}

.site-nav__link:hover::before,
.site-nav__link:focus-visible::before {
  transform: scaleY(1);
}

.site-nav__link[aria-current="page"] {
  color: var(--ice);
  background: rgba(18, 49, 79, 0.85);
}

.site-nav__link[aria-current="page"]::before {
  transform: scaleY(1);
  background: var(--cyan);
}

.site-nav__index {
  flex: 0 0 auto;
  font: 500 11px/1.4 var(--font-data);
  letter-spacing: 0.1em;
  color: rgba(142, 166, 184, 0.66);
}

.site-nav__link[aria-current="page"] .site-nav__index { color: var(--cyan); }

.site-nav__label { line-height: 1.4; }

.site-nav__foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--line-soft);
}

.site-nav__version {
  font: 400 10.5px/1.4 var(--font-data);
  letter-spacing: 0.16em;
  color: var(--mist);
}

.site-nav__cta { width: 100%; }

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: 600 13px/1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--primary {
  background: var(--orange);
  color: #120703;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--ember);
  color: #1A0A03;
}

.btn--ghost {
  background: transparent;
  color: var(--ice);
  border-color: var(--steel);
}

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

/* ============ to top ============ */
.to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  color: var(--text-dim);
  font: 500 10.5px/1 var(--font-data);
  letter-spacing: 0.16em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

/* ============ mobile header ============ */
@media (max-width: 1023.98px) {
  body { padding-left: 0; padding-top: var(--header-h); }

  .site-header {
    inset: 0 0 auto 0;
    width: auto;
    flex-direction: column;
    background: rgba(5, 13, 24, 0.84);
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .site-header[data-scrolled="true"] {
    background: var(--deep);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 22px 44px -38px rgba(0, 0, 0, 0.95);
  }

  .site-header__rail {
    gap: 0;
    padding: 0 var(--gutter);
    overflow: visible;
  }

  .site-header__top {
    align-items: center;
    min-height: var(--header-h);
  }

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex: 0 0 auto;
    gap: 16px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 14px var(--gutter) 22px;
    background: var(--deep);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 34px 60px -34px rgba(0, 0, 0, 0.95);
  }

  .site-header[data-open="true"] .site-nav { display: flex; }

  .site-nav__list { gap: 1px; }

  .site-nav__link {
    padding: 12px 12px 12px 14px;
    font-size: 16px;
  }

  .site-nav__foot {
    margin-top: 4px;
    padding-top: 14px;
  }

  .to-top { display: none; }

  .brand__line { letter-spacing: 0.1em; }
}

@media (max-width: 479.98px) {
  .brand__name { font-size: 16px; }
  .brand__line { display: none; }
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 9px 10px; }
}

/* ============ footer ============ */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 9vw, 120px);
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(10, 27, 46, 0.72) 0%, rgba(5, 13, 24, 0.98) 58%);
}

.site-footer__inner {
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  padding: clamp(38px, 6vw, 78px) 0 26px;
}

.site-footer__lead {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: clamp(26px, 4vw, 44px);
  border-bottom: 1px solid var(--line-soft);
}

.site-footer__brand {
  position: relative;
  padding-left: 18px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ice);
}

.site-footer__brand::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 8px;
  height: 0.72em;
  background: var(--orange);
}

.site-footer__statement {
  max-width: 46ch;
  font-size: clamp(15px, 1.9vw, 20px);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--ember);
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 3.4vw, 44px);
  padding: clamp(26px, 4vw, 44px) 0 clamp(24px, 3.2vw, 38px);
}

.site-footer__col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font: 500 10.5px/1.4 var(--font-data);
  letter-spacing: 0.2em;
  color: var(--mist);
}

.site-footer__col-title::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--cyan);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.site-footer__link {
  display: inline-block;
  color: rgba(244, 249, 252, 0.86);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.18s var(--ease);
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--cyan);
  text-decoration: underline;
}

.site-footer__links--plain .site-footer__contact {
  font: 400 12.5px/1.75 var(--font-data);
  letter-spacing: 0.02em;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font: 400 11.5px/1.6 var(--font-data);
  letter-spacing: 0.1em;
  color: var(--mist);
}

.site-footer__legal {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.site-footer__mark {
  width: 8px;
  height: 8px;
  background: var(--orange);
}

.site-footer__icp { color: rgba(142, 166, 184, 0.9); }

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

@media (min-width: 900px) {
  .site-footer__cols { grid-template-columns: 1.1fr 1fr 1.3fr; }
  .site-footer__lead {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
  }
  .site-footer__statement { text-align: right; }
}

/* ============ shared layout ============ */
.container {
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.section {
  padding-block: clamp(34px, 5.4vw, 72px);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: clamp(18px, 2.8vw, 34px);
}

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

.col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }

@media (min-width: 768px) {
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-6 { grid-column: span 6; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }
}

/* ============ shared components ============ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 12px/1.5 var(--font-body);
  letter-spacing: 0.14em;
  color: var(--mist);
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--orange);
}

.index-label {
  font: 500 12px/1.5 var(--font-data);
  letter-spacing: 0.12em;
  color: var(--mist);
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--steel) 0%, rgba(36, 72, 102, 0) 100%);
}

.panel {
  position: relative;
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background:
    linear-gradient(158deg, rgba(18, 49, 79, 0.92) 0%, rgba(10, 27, 46, 0.96) 52%, rgba(5, 13, 24, 0.98) 100%);
  box-shadow: 0 30px 70px -58px rgba(0, 0, 0, 0.95);
}

.panel--cut {
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat__value {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ice);
}

.stat__label {
  font: 400 11px/1.5 var(--font-data);
  letter-spacing: 0.16em;
  color: var(--mist);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 11px/1.4 var(--font-data);
  letter-spacing: 0.1em;
  color: var(--mist);
}

.tag--cyan {
  color: var(--cyan);
  border-color: rgba(45, 245, 200, 0.45);
  background: rgba(45, 245, 200, 0.08);
}

.tag--amber {
  color: var(--amber);
  border-color: rgba(255, 200, 87, 0.45);
  background: rgba(255, 200, 87, 0.08);
}

/* ============ media frames ============ */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background:
    radial-gradient(120% 92% at 14% 0%, rgba(45, 245, 200, 0.13), transparent 62%),
    radial-gradient(90% 70% at 96% 100%, rgba(255, 90, 31, 0.16), transparent 66%),
    linear-gradient(142deg, var(--harbor) 0%, var(--abyss) 78%);
}

.media-frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.media-frame--cut {
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
}

.media-frame__caption {
  margin-top: 10px;
  font: 400 12px/1.6 var(--font-data);
  letter-spacing: 0.08em;
  color: var(--mist);
}

/* ============ prose ============ */
.prose {
  max-width: 70ch;
  font-size: 17px;
  line-height: 1.9;
  color: #D5E3EC;
}

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

.prose h2 {
  margin-top: 1.9em;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ice);
}

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 768px) {
  .prose { font-size: 18px; }
}

/* ============ reveal ============ */
:root.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}

:root.js-reveal [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  :root.js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .read-progress__bar { transition: none; }
}
