/* ==========================================================================
   必定赢看台 · 共享样式表 /assets/site.css
   ========================================================================== */

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

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

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Tokens ---------- */
:root {
  --ink:        #070b09;
  --ink-2:      #0a110e;
  --panel:      #0f1a16;
  --panel-2:    #14211c;
  --paper:      #f2f6f3;
  --text:       #d7e3dc;
  --body-text:  #bccbc3;
  --muted:      #8ba49a;
  --dim:        #5b736a;

  --line:        rgba(122, 168, 150, 0.16);
  --line-strong: rgba(122, 168, 150, 0.34);

  --cyan:      #2ef0cf;
  --cyan-soft: rgba(46, 240, 207, 0.10);
  --amber:     #f2b23c;

  --tier-1: #2ef0cf;
  --tier-2: #4adcc2;
  --tier-3: #6ec9ae;
  --tier-4: #96bc96;
  --tier-5: #c0a877;
  --tier-6: #e2a952;
  --tier-7: #f0a03c;
  --tier-8: #e1793c;
  --tier-9: #cf5140;

  --spine-w: 264px;
  --shell-max: 1180px;

  --font-display: "Oswald", "Arial Narrow", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-sans: "Inter", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
body {
  background-color: var(--ink);
  color: var(--body-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(880px 620px at 82% -12%, rgba(46, 240, 207, 0.09), transparent 62%),
    radial-gradient(720px 520px at 4% 106%, rgba(242, 178, 60, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(15, 26, 22, 0.55), rgba(7, 11, 9, 0) 42%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.16;
  color: var(--paper);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.45rem, 3.1vw, 2.25rem); }
h3 { font-size: clamp(1.05rem, 1.9vw, 1.32rem); }
h4 { font-size: 1rem; letter-spacing: 0.08em; }

p { max-width: 74ch; }

strong, b { color: var(--paper); font-weight: 700; }

::selection { background: var(--cyan); color: #04120f; }

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

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 0.62rem 1.1rem;
  background: var(--cyan);
  color: #04120f;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 2px;
  transform: translateY(-240%);
  transition: transform 0.22s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Shell / layout helpers ---------- */
.wrap {
  width: min(var(--shell-max), 100% - 3rem);
  margin-inline: auto;
}
.wrap--narrow { width: min(760px, 100% - 3rem); }

.section { padding-block: clamp(3.5rem, 9vw, 8rem); position: relative; z-index: 1; }
.section--tight { padding-block: clamp(2.2rem, 5vw, 3.75rem); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.15rem;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.75;
  flex: none;
}

.lede {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.95;
  color: var(--muted);
  max-width: 60ch;
}

.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header : left observation spine ---------- */
.spine {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--spine-w);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.1rem 1.55rem 1.7rem;
  background: linear-gradient(180deg, #0c1714 0%, #080d0b 62%, #0a1310 100%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.spine::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(46, 240, 207, 0.55), rgba(46, 240, 207, 0) 38%, rgba(242, 178, 60, 0.35));
  pointer-events: none;
}

.spine__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.spine__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.brand__glyph {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--cyan);
}
.brand__glyph svg { width: 100%; height: 100%; }
.brand__word {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}
.brand__cn {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--paper);
  white-space: nowrap;
}
.brand__sub {
  margin-top: 0.36rem;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.brand--footer .brand__glyph { width: 38px; height: 38px; }
.brand--footer .brand__cn { font-size: 1.28rem; letter-spacing: 0.08em; }
.brand--footer .brand__sub { font-size: 0.58rem; color: var(--cyan); opacity: 0.75; }

/* Nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.44rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}
.nav-toggle:hover { color: var(--paper); border-color: var(--cyan); }
.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 14px;
}
.nav-toggle__bars i {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transition: transform 0.28s var(--ease-out), opacity 0.28s;
}

/* Navigation */
.nav { display: flex; flex-direction: column; gap: 0.7rem; }
.nav__title {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
  padding-left: 0.85rem;
}
.nav__list { display: flex; flex-direction: column; gap: 0.1rem; }

.nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.58rem 0.4rem 0.58rem 0.85rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.94rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.22s, border-color 0.22s, background-color 0.26s, padding-left 0.26s var(--ease-out);
}
.nav__idx {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  transition: color 0.22s;
}
.nav__link:hover { color: var(--paper); border-left-color: var(--cyan); }
.nav__link:hover .nav__idx { color: var(--cyan); }

.nav__link[aria-current="page"] {
  color: #04120f;
  font-weight: 700;
  border-left-color: var(--cyan);
  padding-left: 1.1rem;
  background: linear-gradient(90deg, var(--cyan) 0%, rgba(46, 240, 207, 0.10) 100%);
}
.nav__link[aria-current="page"] .nav__idx { color: rgba(4, 18, 15, 0.55); }

/* Ruler */
.spine__scale {
  position: relative;
  padding-left: 1rem;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.spine__scale::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}
.spine__scale::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0;
  bottom: 0;
  width: 9px;
  background: repeating-linear-gradient(180deg, var(--line-strong) 0 1px, transparent 1px 11px);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, transparent 100%);
}
.spine__scale-item { display: block; }

.spine__cta { font-size: 0.76rem; letter-spacing: 0.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: background-color 0.22s, color 0.22s, border-color 0.22s, transform 0.22s var(--ease-out);
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04120f;
  font-weight: 700;
}
.btn--primary:hover { background: #5ff6dd; border-color: #5ff6dd; color: #04120f; }

.btn--ghost { border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { color: var(--paper); border-color: var(--line-strong); }

.btn--block { width: 100%; }

/* ---------- Tags / chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.26rem 0.62rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag--cyan { color: var(--cyan); border-color: rgba(46, 240, 207, 0.42); }
.tag--amber { color: var(--amber); border-color: rgba(242, 178, 60, 0.42); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(158deg, rgba(20, 33, 28, 0.86) 0%, rgba(10, 16, 14, 0.94) 100%);
  transition: border-color 0.26s, transform 0.32s var(--ease-out), box-shadow 0.32s var(--ease-out);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 22px 44px -30px rgba(0, 0, 0, 0.95);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter {
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.filter:hover { color: var(--paper); border-color: var(--line-strong); }
.filter[aria-pressed="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04120f;
  font-weight: 700;
}
[data-filter-item][hidden] { display: none; }
.filter-status {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--dim);
}

/* ---------- Tier spectrum ---------- */
.tiers { display: flex; gap: 3px; align-items: stretch; }
.tier { flex: 1; height: 6px; border-radius: 1px; background: var(--tier-1); }
.tier--1 { background: var(--tier-1); }
.tier--2 { background: var(--tier-2); }
.tier--3 { background: var(--tier-3); }
.tier--4 { background: var(--tier-4); }
.tier--5 { background: var(--tier-5); }
.tier--6 { background: var(--tier-6); }
.tier--7 { background: var(--tier-7); }
.tier--8 { background: var(--tier-8); }
.tier--9 { background: var(--tier-9); }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 0.35rem; }
.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--cyan);
}
.stat__num--amber { color: var(--amber); }
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- Figure / media containers ---------- */
.figure {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--panel);
}
.figure__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 96% at 18% 0%, rgba(46, 240, 207, 0.13), transparent 62%),
    linear-gradient(140deg, #101c18 0%, #0a100e 100%);
  overflow: hidden;
}
.figure__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(122, 168, 150, 0.11) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(180deg, rgba(122, 168, 150, 0.11) 0 1px, transparent 1px 34px);
  pointer-events: none;
}
.figure__frame > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__frame--4x3 { aspect-ratio: 4 / 3; }
.figure__frame--1x1 { aspect-ratio: 1 / 1; }
.figure__frame--21x9 { aspect-ratio: 21 / 9; }

.figure__label {
  position: absolute;
  z-index: 2;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.22rem 0.55rem;
  background: rgba(7, 11, 9, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.figure__caption {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.5rem; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumb a { transition: color 0.2s; }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--muted); }

/* ---------- Tables ---------- */
.table { width: 100%; font-size: 0.9rem; }
.table caption {
  text-align: left;
  padding-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.table th {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.table td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--body-text);
  vertical-align: top;
}
.table tbody tr { transition: background-color 0.2s; }
.table tbody tr:hover { background: rgba(46, 240, 207, 0.045); }
.table--data td:first-child { font-family: var(--font-mono); color: var(--paper); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 286px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 236px), 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }

/* ---------- Prose ---------- */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose ul li { list-style: none; position: relative; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.78em;
  width: 10px;
  height: 1px;
  background: var(--cyan);
}
.prose ol { list-style: decimal; }
.prose ol li { list-style: decimal; }
.prose blockquote {
  border-left: 1px solid var(--cyan);
  padding-left: 1.1rem;
  font-family: var(--font-serif);
  color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(3.5rem, 8vw, 7rem);
  padding-top: clamp(3rem, 6vw, 4.5rem);
  padding-bottom: 1.6rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0a1310 0%, #060a09 100%);
}
.footer__grad {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--tier-1) 0%, var(--tier-2) 12%, var(--tier-3) 25%, var(--tier-4) 37%,
    var(--tier-5) 50%, var(--tier-6) 62%, var(--tier-7) 75%, var(--tier-8) 87%, var(--tier-9) 100%
  );
  opacity: 0.92;
}

.footer__inner {
  width: min(var(--shell-max), 100% - 3rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 2.4rem;
}

.footer__lead .brand { margin-bottom: 0.4rem; }
.footer__line {
  margin-top: 1.1rem;
  max-width: 32ch;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
}
.footer__stamp {
  display: block;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

.footer__h {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.1rem;
}
.footer__nav ul,
.footer__meta ul { display: flex; flex-direction: column; gap: 0.55rem; }
.footer__nav a {
  display: inline-block;
  font-size: 0.9rem;
  color: #b3c4bb;
  transition: color 0.2s, padding-left 0.24s var(--ease-out);
}
.footer__nav a:hover { color: var(--cyan); padding-left: 0.32rem; }

.footer__contact li { font-size: 0.86rem; line-height: 1.7; color: var(--muted); }
.footer__contact .mono {
  font-family: var(--font-mono);
  color: #cbdbd3;
  letter-spacing: 0.02em;
}
.footer__contact-note { font-size: 0.78rem !important; color: var(--dim) !important; }

.footer__base {
  width: min(var(--shell-max), 100% - 3rem);
  margin: 2.8rem auto 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.footer__base p { max-width: none; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer__legal a { transition: color 0.2s; }
.footer__legal a:hover { color: var(--cyan); }

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

/* ---------- Reveal ---------- */
html.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}
html.has-js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.72s var(--ease-out), transform 0.72s var(--ease-out);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  z-index: 130;
  pointer-events: none;
  background: linear-gradient(90deg, var(--tier-1), var(--tier-5), var(--tier-9));
}

/* ---------- Desktop shell offset ---------- */
@media (min-width: 1000px) {
  body { padding-left: var(--spine-w); }
  .scroll-progress { left: var(--spine-w); }
}

/* ---------- Tablet / mobile : spine becomes top bar + drawer ---------- */
@media (max-width: 999px) {
  html { scroll-padding-top: 4.6rem; }

  .spine {
    inset: 0 0 auto 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0.72rem 1.05rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 13, 11, 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    overflow: visible;
    z-index: 100;
  }
  .spine::after { display: none; }

  .spine__top { width: 100%; }
  .spine__foot { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand__glyph { width: 26px; height: 26px; }
  .brand__cn { font-size: 0.94rem; }
  .brand__sub { display: none; }

  .nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 330px);
    padding: 4.6rem 1.5rem 2rem;
    gap: 1.1rem;
    background: linear-gradient(165deg, #0c1714 0%, #070c0a 100%);
    border-right: 1px solid var(--line-strong);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-102%);
    transition: transform 0.44s var(--ease-out);
    z-index: 110;
    box-shadow: 24px 0 60px -40px #000;
  }
  .spine[data-open] .nav { transform: translateX(0); }

  .nav__list { gap: 0.2rem; }
  .nav__link { padding: 0.72rem 0.4rem 0.72rem 0.95rem; font-size: 1rem; }

  .spine[data-open] .nav-toggle__bars i:first-child { transform: translateY(2.5px) rotate(45deg); }
  .spine[data-open] .nav-toggle__bars i:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
  .spine[data-open] .nav-toggle__bars i:last-child { transform: translateY(-2.5px) rotate(-45deg); }

  body[data-nav-open] { overflow: hidden; }
  body[data-nav-open]::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(4, 8, 7, 0.66);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  body { padding-top: 3.5rem; }

  .grid--split { grid-template-columns: minmax(0, 1fr); }
  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  .footer__lead { grid-column: 1 / -1; }
}

/* ---------- Small phones ---------- */
@media (max-width: 560px) {
  .wrap, .wrap--narrow, .footer__inner, .footer__base { width: min(var(--shell-max), 100% - 2rem); }
  .footer__inner { grid-template-columns: minmax(0, 1fr); }
  .footer__base { flex-direction: column; align-items: flex-start; }
  .card { padding: 1.25rem; }
  .section__head { align-items: flex-start; }
}

/* ---------- Short viewports ---------- */
@media (min-width: 1000px) and (max-height: 730px) {
  .spine__scale { display: none; }
  .spine { padding-top: 1.5rem; }
}

/* ---------- Reduced motion ---------- */
@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;
  }
  html.has-js [data-reveal] { opacity: 1; transform: none; }
  .nav { transition: none; }
  .scroll-progress { display: none; }
}
