/* ============================================================
   BEPLAY赛场 · 共享样式 /assets/site.css
   夜间竞技场 · 电光青脉冲 · 索引目录型内容地图
   ============================================================ */

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

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

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

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --void: #080B0F;
  --ink: #10171C;
  --stone: #3A4248;
  --cyan: #22D6D6;
  --mist: #A8F0EC;
  --orange: #FF7A2F;
  --red: #E23B3B;
  --clay: #B8704A;
  --moss: #5C7A4E;
  --bone: #F2EDE4;

  --text: #E4EDEF;
  --text-dim: #9BAEB4;
  --text-mute: #6B7C83;

  --line: rgba(168, 240, 236, 0.16);
  --line-soft: rgba(168, 240, 236, 0.08);

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 28px;

  --container: 1240px;
  --gutter: clamp(18px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 132px;
}

/* ---------- Base ---------- */
body {
  min-height: 100vh;
  background:
    radial-gradient(140% 78% at 88% -12%, rgba(34, 214, 214, 0.10), transparent 62%),
    radial-gradient(96% 62% at -4% 104%, rgba(255, 122, 47, 0.07), transparent 66%),
    var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--bone);
}

p { color: inherit; }

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

main :where(section, article, div, h2, h3)[id] {
  scroll-margin-top: 132px;
}

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

.container--narrow {
  max-width: 820px;
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

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

.prose {
  max-width: 38em;
  font-size: 1.04rem;
  line-height: 1.85;
  color: var(--text-dim);
}

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

.prose strong { color: var(--bone); font-weight: 700; }

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--index { grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); }

/* ---------- Index labels & tags ---------- */
.index-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  line-height: 1.4;
}

.index-label::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3em 0.72em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  line-height: 1.5;
}

.tag--cyan { color: var(--cyan); border-color: rgba(34, 214, 214, 0.45); }
.tag--orange { color: var(--orange); border-color: rgba(255, 122, 47, 0.45); }
.tag--clay { color: var(--clay); border-color: rgba(184, 112, 74, 0.55); }

/* ---------- Placard (说明牌) ---------- */
.placard {
  position: relative;
  padding: clamp(18px, 2vw, 26px);
  background: linear-gradient(158deg, rgba(16, 23, 28, 0.96), rgba(8, 11, 15, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  isolation: isolate;
}

.placard::before,
.placard::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--cyan);
  opacity: 0.55;
  pointer-events: none;
}

.placard::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: var(--radius-m);
}

.placard::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: var(--radius-m);
}

/* ---------- Media frame (图片容器基础规则) ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 12% 0%, rgba(34, 214, 214, 0.22), transparent 56%),
    radial-gradient(110% 96% at 92% 102%, rgba(255, 122, 47, 0.16), transparent 62%),
    linear-gradient(152deg, #10171C 0%, #080B0F 62%);
  isolation: isolate;
}

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

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    116deg,
    transparent 52%,
    rgba(34, 214, 214, 0.14) 53%,
    rgba(34, 214, 214, 0.02) 55%,
    transparent 57%
  );
}

.media-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  background: linear-gradient(0deg, rgba(8, 11, 15, 0.92), transparent);
}

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

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 clamp(20px, 3vw, 36px);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan), rgba(34, 214, 214, 0.08));
}

.timeline-item {
  position: relative;
  padding-block: 14px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(20px, 3vw, 36px) + 0px);
  top: 1.35em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 214, 214, 0.12);
}

/* ---------- Disclosure (可展开内容组) ---------- */
.disclosure {
  border-bottom: 1px solid var(--line);
}

.disclosure-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: 0;
  text-align: left;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--bone);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

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

.disclosure-trigger::-webkit-details-marker { display: none; }

.disclosure-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.3s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.disclosure[data-open="true"] .disclosure-mark {
  transform: rotate(45deg);
  background: var(--orange);
  border-color: var(--orange);
  color: #0A0F12;
}

.disclosure-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}

.disclosure[data-open="true"] .disclosure-panel {
  grid-template-rows: 1fr;
}

.disclosure-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.disclosure-panel-inner > * {
  padding-bottom: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.72em 1.4em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--bone);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #0A0F12;
  font-weight: 700;
}

.btn--primary:hover {
  background: #ff9350;
  border-color: #ff9350;
  color: #080B0F;
}

.btn--ghost {
  color: var(--cyan);
  border-color: rgba(34, 214, 214, 0.45);
}

.btn--ghost:hover {
  background: rgba(34, 214, 214, 0.12);
  color: var(--mist);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55em;
  padding-block: 18px 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

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

.breadcrumb-sep {
  color: var(--stone);
  font-size: 0.8rem;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 0.6em 1.15em;
  border-radius: 999px;
  background: var(--cyan);
  color: #04191A;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.25s var(--ease);
}

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

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 15, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-brand-layer {
  background: linear-gradient(180deg, rgba(16, 23, 28, 0.72), rgba(8, 11, 15, 0.2));
}

.header-brand-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 32px);
  padding-block: 16px;
  transition: padding-block 0.3s var(--ease);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  display: block;
  font-size: clamp(20px, 2.2vw, 29px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--bone);
  transition: font-size 0.3s var(--ease);
}

.brand-sub {
  display: block;
  max-height: 20px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 18px);
  flex-shrink: 0;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.34em 0.8em;
  border-radius: 999px;
  background: var(--orange);
  color: #0A0F12;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  box-shadow: 0 0 0 1px rgba(255, 122, 47, 0.35),
    0 8px 20px -10px rgba(255, 122, 47, 0.9);
}

.version-chip--wide {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(34, 214, 214, 0.42);
  font-weight: 600;
  letter-spacing: 0.14em;
  box-shadow: none;
}

.header-help {
  padding-block: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.header-help:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.9em;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--bone);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

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

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

.nav-toggle-box span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

.site-header[data-nav-open="true"] .nav-toggle-box span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.site-header[data-nav-open="true"] .nav-toggle-box span:nth-child(2) {
  opacity: 0;
}

.site-header[data-nav-open="true"] .nav-toggle-box span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.site-header[data-nav-open="true"] .nav-toggle {
  border-color: var(--orange);
  color: var(--orange);
}

/* Nav layer */
.header-nav-layer {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(16, 23, 28, 0.92), rgba(8, 11, 15, 0.96));
}

.header-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 32px);
  padding-block: 2px;
}

.nav-bar { min-width: 0; }

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2.2vw, 34px);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding-block: 12px;
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible { color: var(--bone); }

.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-link[aria-current="page"] {
  color: var(--cyan);
  font-weight: 600;
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--orange);
}

.nav-aside {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
  flex-shrink: 0;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  white-space: nowrap;
}

.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 214, 214, 0.16),
    0 0 10px rgba(34, 214, 214, 0.85);
}

.nav-aside-link {
  padding: 0.38em 0.95em;
  border: 1px solid rgba(255, 122, 47, 0.45);
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--orange);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-aside-link:hover {
  background: var(--orange);
  color: #0A0F12;
}

/* Condensed state */
.site-header[data-condensed="true"] .header-brand-inner {
  padding-block: 8px;
}

.site-header[data-condensed="true"] .brand-name {
  font-size: clamp(18px, 1.6vw, 21px);
}

.site-header[data-condensed="true"] .brand-sub {
  max-height: 0;
  opacity: 0;
}

/* Scroll progress */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
  pointer-events: none;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 110px);
  padding-block: clamp(40px, 6vw, 78px) 0;
  background: linear-gradient(180deg, rgba(16, 23, 28, 0.78), rgba(8, 11, 15, 1));
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -90px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 122, 78, 0.30), transparent 70%);
  pointer-events: none;
}

.site-footer::after {
  content: "";
  position: absolute;
  bottom: -160px;
  left: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 112, 74, 0.22), transparent 72%);
  pointer-events: none;
}

.footer-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(28px, 4vw, 54px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.footer-tagline {
  max-width: 28em;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  line-height: 1.5;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.footer-list a {
  display: inline-block;
  width: fit-content;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-list a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(34, 214, 214, 0.5);
}

.footer-contact {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: clamp(16px, 3vw, 32px);
  padding-block: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.contact-value {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.contact-note {
  grid-column: 1 / -1;
  padding-left: 14px;
  border-left: 2px solid var(--clay);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text-mute);
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 22px 26px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.footer-legal a {
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

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

/* ---------- Back to top (JS 注入) ---------- */
.back-top {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(16px, 3vw, 34px);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(16, 23, 28, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.back-top[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root { --header-h: 112px; }

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

  .header-help { display: none; }

  .header-nav-layer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(16, 23, 28, 0.99), rgba(8, 11, 15, 0.99));
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.9);
    transition: max-height 0.38s var(--ease), visibility 0.38s var(--ease);
  }

  .site-header[data-nav-open="true"] .header-nav-layer {
    max-height: min(78vh, 560px);
    overflow-y: auto;
    visibility: visible;
  }

  .header-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 6px 20px;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    display: block;
    padding-block: 14px;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link::after {
    bottom: 4px;
    right: auto;
    width: 28px;
  }

  .nav-aside {
    justify-content: space-between;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 12px;
  }

  main :where(section, article, div, h2, h3)[id] {
    scroll-margin-top: 112px;
  }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .footer-contact {
    grid-template-columns: 1fr;
  }

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

  .disclosure-trigger { font-size: 0.98rem; }
}

@media (max-width: 420px) {
  .brand-sub { display: none; }
  .nav-toggle-text { display: none; }
}

/* ============================================================
   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;
    scroll-behavior: auto !important;
  }

  .scroll-progress { transition: none; }
}
