/* ===== 0. Reset ===== */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

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

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

button { font: inherit; color: inherit; }

a { color: inherit; }

/* ===== 1. Tokens ===== */
:root {
  --ink-900: #060B14;
  --ink-800: #0D1726;
  --ink-700: #122032;
  --glass: rgba(18, 32, 50, 0.66);
  --line: #1E3248;
  --white: #F5F9FF;
  --muted: #8C9AB0;
  --cyan: #2EF2C8;
  --cyan-soft: rgba(46, 242, 200, 0.10);
  --cyan-line: rgba(46, 242, 200, 0.16);
  --orange: #FF7A2E;
  --orange-soft: rgba(255, 122, 46, 0.10);
  --violet: #A78BFA;
  --violet-soft: rgba(167, 139, 250, 0.10);

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --rail: 76px;
  --shell: 1440px;

  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* ===== 2. Base ===== */
body {
  min-height: 100vh;
  color: var(--white);
  font-family: var(--font-body);
  font-size: clamp(16px, 0.35vw + 15px, 17px);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  background-color: var(--ink-900);
  background-image:
    radial-gradient(1100px 560px at 84% -8%, rgba(46, 242, 200, 0.10), transparent 62%),
    radial-gradient(880px 520px at 4% 2%, rgba(255, 122, 46, 0.08), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(40px, 6vw, 76px); }
h2 { font-size: clamp(26px, 2.6vw, 36px); }
h3 { font-size: clamp(19px, 1.4vw, 23px); }

p { max-width: 62ch; }

strong { font-weight: 800; }

code, time, .mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

::selection { background: rgba(46, 242, 200, 0.28); color: #04120E; }

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

/* ===== 3. Layout shell ===== */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(18px, 3vw, 48px);
}

.page-shell {
  padding-block: clamp(30px, 4.5vw, 68px);
}

.prose { max-width: 42em; }
.prose p { margin-bottom: 1.1em; color: rgba(245, 249, 255, 0.86); }
.prose h2 { margin-block: 1.6em 0.6em; }
.prose h3 { margin-block: 1.4em 0.5em; }
.prose ul, .prose ol { margin-bottom: 1.2em; padding-left: 1.2em; list-style: disc; }
.prose li { margin-bottom: 0.5em; color: rgba(245, 249, 255, 0.86); }

/* ===== 4. Skip link ===== */
.skip-link {
  position: fixed;
  top: 10px;
  left: calc(var(--rail) + 12px);
  z-index: 200;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: #04120E;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}

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

/* ===== 5. Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.97), rgba(6, 11, 20, 0.84));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}

.site-header.is-compact {
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.5);
}

/* 5.1 status strip */
.site-header__top {
  border-bottom: 1px solid rgba(30, 50, 72, 0.72);
  background: linear-gradient(90deg, rgba(46, 242, 200, 0.05), transparent 55%, rgba(255, 122, 46, 0.05));
}

.site-header__top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding-block: 6px;
}

.brand-line {
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(46, 242, 200, 0.5);
  animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 242, 200, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(46, 242, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 242, 200, 0); }
}

/* 5.2 command bar */
.site-header__bar-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  min-height: 72px;
  padding-block: 8px;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px 12px 12px 3px;
  background: linear-gradient(142deg, var(--cyan) 0%, #1BD8B4 55%, #0C8C7E 100%);
  color: #04120E;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 26px rgba(46, 242, 200, 0.24);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.brand--footer .brand__mark {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

/* 5.3 nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav__item { display: block; }

.site-nav__link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.site-nav__index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(140, 154, 176, 0.7);
  transition: color 0.16s ease;
}

.site-nav__link:hover {
  color: var(--white);
  background: rgba(46, 242, 200, 0.07);
}

.site-nav__link:hover .site-nav__index { color: var(--cyan); }

.site-nav__link[aria-current="page"] {
  color: var(--white);
  background: var(--cyan-soft);
  box-shadow: inset 0 -2px 0 var(--cyan);
}

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

.site-nav__cta {
  margin-left: 12px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 122, 46, 0.55);
  border-radius: 999px;
  color: var(--orange);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.site-nav__cta:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #1A0A00;
}

/* 5.4 toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.nav-toggle__text { line-height: 1; }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: background 0.18s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform 0.18s ease;
}

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

.site-header[data-open] .nav-toggle__bars { background: transparent; }
.site-header[data-open] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* 5.5 progress */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  background: rgba(30, 50, 72, 0.55);
}

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  transition: transform 0.12s linear;
}

/* ===== 6. Footer ===== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--cyan-line);
  background: linear-gradient(180deg, rgba(13, 23, 38, 0.94) 0%, #050A12 68%);
  color: var(--muted);
  font-size: 14px;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0%, rgba(46, 242, 200, 0) 42%, var(--orange) 78%, rgba(255, 122, 46, 0) 100%);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(24px, 3vw, 52px);
  padding-block: clamp(36px, 5vw, 64px);
}

.footer__brand { min-width: 0; }

.footer__tagline {
  margin-top: 16px;
  max-width: 26ch;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(140, 154, 176, 0.9);
}

.footer__contact {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.footer__contact-item {
  display: grid;
  gap: 2px;
}

.footer__contact-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: rgba(140, 154, 176, 0.72);
}

.footer__contact-value {
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.footer__col { min-width: 0; }

.footer__col-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--white);
}

.footer__list {
  display: grid;
  gap: 10px;
}

.footer__link {
  display: inline-block;
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  transition: color 0.16s ease, transform 0.16s ease;
}

.footer__link:hover {
  color: var(--cyan);
  transform: translateX(3px);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 20px;
  border-top: 1px solid rgba(30, 50, 72, 0.9);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(140, 154, 176, 0.85);
}

.footer__legal,
.footer__copy { max-width: none; margin: 0; }

/* ===== 7. Back to top ===== */
.back-to-top {
  position: fixed;
  right: clamp(14px, 2vw, 30px);
  bottom: clamp(14px, 2vw, 30px);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(46, 242, 200, 0.45);
  border-radius: 50%;
  background: rgba(13, 23, 38, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cyan);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.back-to-top:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
}

.back-to-top[hidden] { display: none; }

/* ===== 8. Buttons / chips / labels ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn--primary {
  background: var(--cyan);
  color: #04120E;
  box-shadow: 0 14px 34px rgba(46, 242, 200, 0.22);
}

.btn--primary:hover { background: #5DF8D8; transform: translateY(-2px); }

.btn--ghost {
  border-color: rgba(46, 242, 200, 0.4);
  background: rgba(18, 32, 50, 0.5);
  color: var(--white);
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

.btn--accent {
  background: var(--orange);
  color: #1A0A00;
}

.btn--accent:hover { background: #FF9459; transform: translateY(-2px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.chip--orange { color: var(--orange); background: var(--orange-soft); }
.chip--violet { color: var(--violet); background: var(--violet-soft); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--cyan);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

/* ===== 9. Surfaces ===== */
.surface {
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--cyan-line);
  border-radius: var(--radius);
  background: var(--ink-800);
  box-shadow: var(--shadow);
}

.surface--glass {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ===== 10. Breadcrumbs ===== */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: rgba(140, 154, 176, 0.45);
}

.breadcrumbs__link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s ease;
}

.breadcrumbs__link:hover { color: var(--cyan); }

.breadcrumbs__current { color: var(--white); }

/* ===== 11. Grid ===== */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 28px);
}

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

.grid--12 > * { grid-column: span 12; min-width: 0; }

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

/* ===== 12. Media frame ===== */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--cyan-line);
  border-radius: var(--radius);
  background: linear-gradient(142deg, #0B1524 0%, #122032 100%);
  box-shadow: var(--shadow);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(46, 242, 200, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 242, 200, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
}

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

.media-frame--ratio { aspect-ratio: 16 / 10; }

.media-frame--slant {
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
}

/* ===== 13. Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== 14. Brand rail ===== */
.brand-rail { display: none; }

/* ===== 15. Responsive ===== */
@media (min-width: 1100px) {
  body { padding-left: var(--rail); }

  .brand-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: var(--rail);
    padding: 22px 0;
    border-right: 1px solid var(--cyan-line);
    background: linear-gradient(180deg, rgba(18, 32, 50, 0.72), rgba(13, 23, 38, 0.5));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .brand-rail__mark {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--cyan);
  }

  .brand-rail__label {
    writing-mode: vertical-rl;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.34em;
    color: rgba(245, 249, 255, 0.72);
  }

  .brand-rail__rule {
    flex: 1 1 auto;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(46, 242, 200, 0.55), transparent);
  }

  .brand-rail__meta {
    writing-mode: vertical-rl;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.28em;
    color: var(--muted);
  }

  .skip-link { left: calc(var(--rail) + 12px); }
}

@media (max-width: 1180px) {
  .site-nav__index { display: none; }
  .site-nav__link { padding: 9px 11px; font-size: 14.5px; }
}

@media (max-width: 980px) {
  .site-header { position: sticky; }

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 65;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-left: 0;
    padding: 16px clamp(18px, 3vw, 48px) 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 16, 26, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

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

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav__link {
    justify-content: flex-start;
    padding: 13px 14px;
    font-size: 16px;
    border-radius: 12px;
  }

  .site-nav__index { display: inline; font-size: 11px; }

  .site-nav__cta {
    align-self: flex-start;
    margin-left: 0;
    padding: 11px 22px;
  }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }

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

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

  .site-header__top-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-block: 8px;
  }

  .brand-line { font-size: 11px; letter-spacing: 0.1em; }

  .header-status { font-size: 11.5px; }

  .site-header__bar-inner { min-height: 64px; }

  .brand__name { font-size: 17px; }

  .footer__grid { grid-template-columns: 1fr; gap: 30px; }

  .col-4, .col-5, .col-7, .col-8, .col-12 { grid-column: 1 / -1; }

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

  .back-to-top { width: 42px; height: 42px; font-size: 16px; }
}

@media (max-width: 420px) {
  .nav-toggle__text { display: none; }
  .brand__sub { letter-spacing: 0.22em; }
}

/* ===== 16. Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  .status-dot { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .scroll-progress__bar { transition: none; }
}
