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

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

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, figcaption, 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;
  background: none;
  border: 0;
  cursor: pointer;
}

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

table { border-collapse: collapse; width: 100%; }

[hidden] { display: none !important; }

/* ========== 02. Tokens ========== */
:root {
  --void: #061426;
  --deep: #0A2038;
  --panel: #0F2B4A;
  --grid: #1C3E60;
  --fog: #E8F1F8;
  --ash: #6F8194;
  --cyan: #1FF0D0;
  --amber: #FFA23A;
  --red: #FF5D6C;
  --green: #5DE2A2;

  --shell: 1240px;
  --pad-block: clamp(48px, 7vw, 96px);
  --gap: 24px;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-cond: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ========== 03. Base ========== */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--fog);
  background-color: var(--void);
  background-image:
    linear-gradient(to right, rgba(28, 62, 96, .22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 62, 96, .22) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.12;
  color: var(--fog);
  text-wrap: balance;
}

h1 { font-size: clamp(38px, 6vw, 64px); }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.22; }
h4 { font-size: 18px; letter-spacing: 0; }

p { text-wrap: pretty; }

strong { font-weight: 700; color: var(--fog); }

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

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

/* ========== 04. Utilities ========== */
.shell {
  width: min(100% - 48px, var(--shell));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ========== 05. Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(6, 20, 38, .96);
  border-bottom: 1px solid var(--grid);
  backdrop-filter: blur(10px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 120;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--void);
  background: var(--cyan);
  border-radius: 0;
  transition: top .2s var(--ease);
}

.skip-link:focus { top: 10px; }

.header-rail {
  background: var(--deep);
  border-bottom: 1px solid var(--grid);
}

.header-rail__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ash);
  text-transform: uppercase;
}

.header-rail__signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(232, 241, 248, .86);
}

.header-rail__meta { color: var(--ash); }

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--ash);
}

.dot--live {
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(31, 240, 208, .16);
  animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(31, 240, 208, .16); }
  50% { opacity: .55; box-shadow: 0 0 0 6px rgba(31, 240, 208, .04); }
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 18px 0 20px;
}

.masthead__aside {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}

.masthead__kicker {
  display: inline-block;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ash);
}

.masthead__brand {
  grid-column: 2;
  display: block;
  text-align: center;
}

.masthead__mark {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--fog);
}

.masthead__sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--cyan);
}

.masthead__tools {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.viewswitch {
  display: inline-flex;
  border: 1px solid var(--grid);
  background: var(--panel);
}

.viewswitch__btn {
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--ash);
  transition: background .2s var(--ease), color .2s var(--ease);
}

.viewswitch__btn + .viewswitch__btn { border-left: 1px solid var(--grid); }

.viewswitch__btn:hover { color: var(--fog); }

.viewswitch__btn[aria-pressed="true"] {
  background: var(--cyan);
  color: var(--void);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--fog);
  background: var(--panel);
}

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

.nav-toggle__bars {
  display: grid;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
}

.nav-toggle[aria-expanded="true"] {
  color: var(--void);
  background: var(--cyan);
  border-color: var(--cyan);
}

/* ========== 06. Navigation ========== */
.site-nav {
  border-top: 1px solid var(--grid);
  background: var(--deep);
}

.site-nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.site-nav__list {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav__link {
  display: block;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(232, 241, 248, .74);
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}

.site-nav__link:hover {
  color: var(--cyan);
  background: rgba(15, 43, 74, .7);
}

.site-nav__link[aria-current="page"] {
  color: var(--fog);
  background: var(--panel);
  border-bottom-color: var(--amber);
}

.site-nav__quick {
  grid-column: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-link {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(31, 240, 208, .34);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--cyan);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.quick-link:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--void);
}

.readbar {
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

/* ========== 07. Footer ========== */
.site-footer {
  margin-top: var(--pad-block);
  background: var(--deep);
  border-top: 1px solid var(--grid);
  box-shadow: inset 0 2px 0 -1px rgba(31, 240, 208, .3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr;
  gap: 40px 32px;
  padding: 56px 0 44px;
}

.footer-brand__mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -.01em;
  color: var(--fog);
}

.footer-brand__sub {
  margin-top: 6px;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer-brand__note {
  margin: 16px 0 20px;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ash);
}

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
}

.footer-col__list li + li { margin-top: 2px; }

.footer-col__list a {
  display: inline-block;
  padding: 5px 0;
  font-size: 14.5px;
  color: rgba(232, 241, 248, .82);
  transition: color .2s var(--ease);
}

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

.footer-col .btn { margin-top: 18px; }

.footer-contact__list li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid rgba(28, 62, 96, .6);
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ash);
}

.footer-contact__val {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fog);
  overflow-wrap: anywhere;
}

.footer-contact__note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ash);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ash);
}

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

.footer-bottom__links a:hover { color: var(--cyan); }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  padding: 10px 14px;
  border: 1px solid rgba(31, 240, 208, .5);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--cyan);
  transition: background .2s var(--ease), color .2s var(--ease);
}

.to-top:hover {
  background: var(--cyan);
  color: var(--void);
}

/* ========== 08. Shared components ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  text-align: center;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}

.btn--solid {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04121F;
}

.btn--solid:hover {
  background: #7CF8E6;
  border-color: #7CF8E6;
}

.btn--ghost {
  background: var(--panel);
  border-color: var(--grid);
  color: var(--fog);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--ash);
  background: rgba(15, 43, 74, .7);
}

.badge--cyan { color: var(--cyan); border-color: rgba(31, 240, 208, .4); }
.badge--amber { color: var(--amber); border-color: rgba(255, 162, 58, .42); }
.badge--green { color: var(--green); border-color: rgba(93, 226, 162, .42); }
.badge--red { color: var(--red); border-color: rgba(255, 93, 108, .42); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--ash);
}

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

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

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

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

.section {
  padding-block: var(--pad-block);
  border-top: 1px solid var(--grid);
}

.section--tight { padding-block: clamp(32px, 4vw, 56px); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head > p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ash);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--amber);
}

.panel {
  padding: clamp(20px, 3vw, 32px);
  background: rgba(15, 43, 74, .72);
  border: 1px solid var(--grid);
}

.grid {
  display: grid;
  gap: var(--gap);
}

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

.grid--span-7 { grid-column: span 7; }
.grid--span-5 { grid-column: span 5; }

.data-list {
  display: grid;
  gap: 0;
}

.data-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(28, 62, 96, .7);
}

.data-list__key {
  font-size: 13.5px;
  color: var(--ash);
}

.data-list__val {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fog);
  text-align: right;
}

.prose {
  max-width: 72ch;
  font-size: 16.5px;
  line-height: 1.78;
  color: rgba(232, 241, 248, .9);
}

.prose > * + * { margin-top: 18px; }

.prose h2 { margin-top: 40px; }
.prose h3 { margin-top: 30px; }
.prose strong { color: var(--fog); }

.prose ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  list-style: none;
}

.prose ul li { position: relative; }

.prose ul li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: .72em;
  width: 8px;
  height: 1px;
  background: var(--cyan);
}

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

/* Dual-device comparison hooks (paired with header data-view) */
.dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--grid);
  border: 1px solid var(--grid);
}

.dual__panel {
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--deep);
  transition: opacity .28s var(--ease), filter .28s var(--ease);
}

.dual__device {
  display: inline-block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ash);
}

.dual__frame {
  border: 1px solid var(--grid);
  background: var(--panel);
  min-height: 140px;
}

:root[data-view="mobile"] .dual__panel[data-device="desktop"],
:root[data-view="desktop"] .dual__panel[data-device="mobile"] {
  opacity: .42;
  filter: saturate(.55);
}

/* Media containers */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--grid);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.media-frame__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 12px;
  border-top: 1px solid var(--grid);
  background: rgba(6, 20, 38, .88);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--ash);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Reveal protocol */
[data-reveal] {
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

:root[data-reveal-ready] [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(16px);
}

/* ========== 09. Responsive ========== */
@media (max-width: 1080px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-brand { grid-column: span 3; }
  .footer-contact { grid-column: span 3; }
}

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

  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 0 16px;
  }

  .masthead__brand { grid-column: 1; text-align: left; }
  .masthead__aside { display: none; }
  .masthead__tools { grid-column: 2; }

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

  .site-nav { display: none; }

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

  .site-nav__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 6px 0 16px;
  }

  .site-nav__list {
    grid-column: 1;
    flex-direction: column;
    justify-content: flex-start;
  }

  .site-nav__link {
    padding: 12px 12px;
    border-bottom: 1px solid var(--grid);
    border-left: 2px solid transparent;
  }

  .site-nav__link[aria-current="page"] {
    border-left-color: var(--amber);
    border-bottom-color: var(--grid);
  }

  .site-nav__quick {
    grid-column: 1;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; }

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

  .grid--span-7,
  .grid--span-5 { grid-column: auto; }

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

  :root[data-view="mobile"] .dual__panel[data-device="desktop"],
  :root[data-view="desktop"] .dual__panel[data-device="mobile"] {
    opacity: 1;
    filter: none;
  }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 32px, var(--shell)); }

  .masthead__mark { font-size: 21px; }
  .masthead__sub { font-size: 10px; letter-spacing: .28em; }

  .header-rail__inner { font-size: 11px; letter-spacing: .06em; }

  .viewswitch__btn { padding: 6px 8px; font-size: 11px; }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 40px 0 32px;
  }

  .footer-brand,
  .footer-contact { grid-column: auto; }

  .footer-bottom { font-size: 11.5px; }

  .to-top { right: 12px; bottom: 12px; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  :root[data-reveal-ready] [data-reveal]:not(.is-visible) {
    opacity: 1;
    transform: none;
  }
}
