:root {
  --space: #0A1D36;
  --space-deep: #061224;
  --cyan: #38E8E0;
  --mist: #BDF4F1;
  --orange: #FF7A3D;
  --paper: #F3EBDD;
  --paper-card: #FBF7EE;
  --ink: #2A211C;
  --steel: #8297AA;
  --mint: #4FD6A3;
  --amber: #F2B84B;

  --edge: rgba(42, 33, 28, .16);
  --edge-strong: rgba(42, 33, 28, .32);
  --edge-light: rgba(189, 244, 241, .2);

  --font-head: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: var(--font-head);
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 44px);
  --radius: 2px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 132px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.15; }
h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.25; }
h3 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; font-weight: 700; }
h4 { font-size: 17px; line-height: 1.5; font-weight: 700; }

p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--space);
  text-decoration: none;
  transition: color .2s var(--ease);
}
a:hover { color: var(--orange); }

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

button { font: inherit; color: inherit; }

::selection { background: var(--cyan); color: var(--space); }

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

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

.page-body {
  padding-block: clamp(36px, 6vw, 76px);
}

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.grid--7-5 { grid-template-columns: 7fr 5fr; }
.grid--5-7 { grid-template-columns: 5fr 7fr; }
.grid--8-4 { grid-template-columns: 8fr 4fr; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- typographic helpers ---------- */
.mono {
  font-family: var(--font-mono);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--accent {
  background: var(--orange);
  border-color: var(--orange);
  color: #20160F;
}
.btn--accent:hover { background: #FF9366; border-color: #FF9366; color: #20160F; }

.btn--ghost {
  background: transparent;
  border-color: rgba(189, 244, 241, .45);
  color: var(--mist);
}
.btn--ghost:hover { border-color: var(--cyan); color: #fff; }

.btn--ink {
  background: var(--space);
  border-color: var(--space);
  color: var(--paper);
}
.btn--ink:hover { background: var(--space-deep); color: var(--mist); }

.btn--sm {
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: .01em;
}

/* ---------- tags & chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid rgba(10, 29, 54, .16);
  border-radius: 999px;
  background: var(--mist);
  color: var(--space);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .08em;
  white-space: nowrap;
}
.tag--mint { background: rgba(79, 214, 163, .18); border-color: rgba(79, 214, 163, .55); color: #1B6B52; }
.tag--amber { background: rgba(242, 184, 75, .22); border-color: rgba(242, 184, 75, .6); color: #7A5410; }
.tag--orange { background: rgba(255, 122, 61, .16); border-color: rgba(255, 122, 61, .48); color: #9C3A0F; }
.tag--dark { background: rgba(189, 244, 241, .12); border-color: rgba(189, 244, 241, .32); color: var(--mist); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .12em;
  white-space: nowrap;
}
.status-chip--live { color: var(--mint); background: rgba(79, 214, 163, .1); }
.status-chip--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  flex: none;
}

/* ---------- paper cards & panels ---------- */
.paper-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 6px 6px 0 rgba(42, 33, 28, .06);
}
.paper-card--stack {
  box-shadow:
    8px 8px 0 rgba(42, 33, 28, .07),
    16px 16px 0 rgba(42, 33, 28, .035);
}

.panel-dark {
  background: var(--space);
  color: var(--mist);
  border: 1px solid rgba(56, 232, 224, .22);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 36px);
}
.panel-dark h2,
.panel-dark h3 { color: var(--paper); }

/* ---------- media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--space-deep);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(56, 232, 224, .14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 232, 224, .14) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: .55;
}
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--free { aspect-ratio: auto; }
.media-frame--free::after { display: none; }
.media-frame figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  padding: 7px 12px;
  background: rgba(6, 18, 36, .82);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}

/* ---------- section head / breadcrumb ---------- */
.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
  margin-bottom: clamp(22px, 3vw, 36px);
}
.section-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.section-title { margin-bottom: 8px; }
.section-kicker {
  font-size: 14.5px;
  line-height: 1.7;
  color: #6B5A4E;
  max-width: 62ch;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--steel);
  margin-bottom: clamp(18px, 3vw, 28px);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb li:not(:first-child)::before {
  content: "/";
  color: var(--steel);
  opacity: .7;
}
.breadcrumb a {
  color: var(--space);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 1px;
}
.breadcrumb a:hover { color: var(--orange); border-color: var(--orange); }
.breadcrumb [aria-current="page"] { color: var(--ink); border: 0; }

/* ---------- reveal ---------- */
[data-reveal] {
  transition: opacity .34s var(--ease), transform .34s var(--ease);
}
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}
.has-js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ================= HEADER ================= */
.skip-link {
  position: absolute;
  top: -120px;
  left: 14px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--orange);
  color: #20160F;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: #20160F; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--space);
  color: var(--mist);
  border-bottom: 1px solid rgba(56, 232, 224, .26);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-condensed {
  box-shadow: 0 12px 32px rgba(6, 18, 36, .42);
}

.header-utility {
  background: var(--space-deep);
  border-bottom: 1px solid rgba(56, 232, 224, .16);
  max-height: 56px;
  overflow: hidden;
  transition: max-height .34s var(--ease), opacity .24s var(--ease);
}
.site-header.is-condensed .header-utility {
  max-height: 0;
  opacity: 0;
  border-bottom-width: 0;
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
}
.utility-motto {
  color: var(--cyan);
  white-space: nowrap;
}
.utility-index {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--steel);
}
.utility-index::before {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(130, 151, 170, .6);
  flex: none;
}
.utility-index-label { letter-spacing: .18em; }
.utility-index-value {
  color: var(--mist);
  letter-spacing: .08em;
  font-family: var(--font-mono);
}

.masthead { padding-block: 16px 14px; }

.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  color: var(--paper);
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56, 232, 224, .16);
  flex: none;
  animation: brandBreath 4.2s ease-in-out infinite;
}
.brand-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.masthead-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.masthead-version {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--steel);
  white-space: nowrap;
}

.masthead-cta { justify-self: end; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(189, 244, 241, .4);
  border-radius: var(--radius);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); color: #fff; }
.nav-toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.nav-toggle-text { line-height: 1; }

.site-nav {
  background: var(--space);
  border-top: 1px solid rgba(189, 244, 241, .16);
  border-bottom: 1px solid rgba(56, 232, 224, .2);
}

.nav-list {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(4px, 2vw, 32px);
  min-height: 54px;
  padding-block: 0;
}
.nav-list > li { display: flex; }

.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--mist);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .24s var(--ease);
}
.nav-list a:hover,
.nav-list a:focus-visible { color: #fff; }
.nav-list a:hover::after,
.nav-list a:focus-visible::after { transform: scaleX(1); }
.nav-list a[aria-current="page"] { color: #fff; }
.nav-list a[aria-current="page"]::after { transform: scaleX(1); background: var(--cyan); }

.nav-list .nav-featured {
  padding-right: 12px;
  color: #fff;
}
.nav-list .nav-featured::after {
  height: 3px;
  bottom: 10px;
  background: var(--orange);
  transform: scaleX(1);
}
.nav-list .nav-featured:hover::after { background: var(--orange); }

.nav-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 61, .2);
  flex: none;
  animation: navPulse 3.4s ease-in-out infinite;
}

.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .12s linear;
  pointer-events: none;
}

@keyframes brandBreath {
  0%, 100% { box-shadow: 0 0 0 4px rgba(56, 232, 224, .16); }
  50% { box-shadow: 0 0 0 7px rgba(56, 232, 224, .06); }
}
@keyframes navPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.84); }
}

/* ================= FOOTER ================= */
.site-footer {
  position: relative;
  background: var(--space);
  color: var(--mist);
  border-top: 1px solid rgba(56, 232, 224, .3);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 22px, transparent 22px 44px);
  opacity: .85;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.5fr;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(44px, 6vw, 76px) clamp(32px, 4vw, 52px);
  border-bottom: 1px solid rgba(189, 244, 241, .16);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer-brand-line {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--paper);
}
.footer-brand-note {
  font-size: 13px;
  line-height: 1.75;
  color: var(--steel);
  max-width: 30ch;
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer-heading::after {
  content: "";
  width: 18px;
  height: 1px;
  background: rgba(56, 232, 224, .5);
  flex: none;
}

.footer-nav ul li + li { margin-top: 10px; }
.footer-nav a {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
  color: var(--mist);
  font-size: 14.5px;
  text-decoration: none;
}
.footer-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width .22s var(--ease);
}
.footer-nav a:hover { color: #fff; }
.footer-nav a:hover::after { width: 100%; }

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--paper);
}
.footer-contact-item span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--steel);
  text-transform: uppercase;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 26px;
  padding-block: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--steel);
}
.footer-copy,
.footer-icp,
.footer-meta { color: var(--steel); }
.footer-meta { color: rgba(189, 244, 241, .55); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .grid--7-5,
  .grid--5-7,
  .grid--8-4 { grid-template-columns: minmax(0, 1fr); }

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

  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 96px; }

  .masthead-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
  }
  .masthead-status { display: none; }
  .brand-word { font-size: 20px; }
  .nav-toggle { display: inline-flex; grid-column: 3; }
  .masthead-cta { grid-column: 2; justify-self: end; }

  .site-nav { display: none; background: var(--space-deep); }
  .site-nav[data-open="true"] {
    display: block;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    min-height: 0;
    padding-block: 6px 14px;
    max-width: none;
  }
  .nav-list > li { width: 100%; }
  .nav-list a {
    width: 100%;
    padding: 15px 2px;
    font-size: 16px;
    border-bottom: 1px solid rgba(189, 244, 241, .12);
  }
  .nav-list a::after { display: none; }
  .nav-list a[aria-current="page"] { color: var(--cyan); }
  .nav-list .nav-featured { padding-right: 2px; }
  .nav-list .nav-featured::before {
    content: "";
    width: 3px;
    height: 18px;
    border-radius: 2px;
    background: var(--orange);
    flex: none;
  }

  .scroll-meter { position: sticky; }
}

@media (max-width: 700px) {
  .utility-inner {
    gap: 10px;
    min-height: 40px;
    font-size: 10.5px;
    letter-spacing: .06em;
  }
  .utility-index-label { display: none; }
  .utility-index::before { width: 14px; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }

  .page-body { padding-block: 28px 48px; }

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

  .section-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .section-num { font-size: 34px; }

  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .masthead-cta { display: none; }
}

/* ================= MOTION / A11Y ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .btn:hover { transform: none; }
  .scroll-meter { transition: none; }
}

@media print {
  .site-header,
  .site-footer,
  .scroll-meter,
  .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  a[href]::after { content: ""; }
}
