/* ==========================================================================
   云开赛场 · KAIYUN V4
   /assets/site.css — 共享外壳：reset / tokens / 排版 / 页头 / 页脚 / 基础组件
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --paper: #F4EBDC;
  --paper-high: #FFFDF6;
  --ink: #1A1D1A;
  --ink-soft: #3C423C;
  --green: #143D2F;
  --green-night: #0B1512;
  --moss: #2F5D4A;
  --red: #C53A2F;
  --yellow: #F4B400;
  --silver: #B8C1BD;
  --mist: #D9DED6;

  --line-light: rgba(184, 193, 189, 0.28);
  --line-dark: rgba(26, 29, 26, 0.16);

  --wrap: 1280px;
  --gutter: clamp(18px, 4.2vw, 56px);
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 72px;
  --sp-6: 120px;

  --font-display: "Oswald", "Bebas Neue", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --rail-h: 34px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.02vw, 17px);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

#main-content { scroll-margin-top: 120px; }

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

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

.sr-only,
.copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- shared type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moss);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--yellow);
  flex: 0 0 auto;
}

.page-head {
  display: grid;
  gap: 14px;
  padding-block: clamp(32px, 5vw, 64px) clamp(20px, 3vw, 32px);
  max-width: 60ch;
}
.page-head__index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--red);
  text-transform: uppercase;
}
.page-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-head__lede {
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 52ch;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: center;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn--sm { padding: 10px 16px; font-size: 11px; }
.btn--solid { background: var(--red); color: var(--paper-high); border-color: var(--red); }
.btn--solid:hover { background: var(--paper-high); color: var(--ink); border-color: var(--paper-high); }
.btn--ghost { background: transparent; color: var(--paper-high); border-color: var(--line-light); }
.btn--ghost:hover { color: var(--yellow); border-color: var(--yellow); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }

/* ---------- tags & chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.6;
}
.tag--red { background: rgba(197, 58, 47, 0.12); color: var(--red); border-color: rgba(197, 58, 47, 0.42); }
.tag--yellow { background: rgba(244, 180, 0, 0.18); color: #7E5B00; border-color: rgba(244, 180, 0, 0.55); }
.tag--moss { background: rgba(47, 93, 74, 0.12); color: var(--moss); border-color: rgba(47, 93, 74, 0.36); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px;
  border: 1px solid rgba(26, 29, 26, 0.22);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1.4;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip:hover { border-color: var(--moss); color: var(--moss); }
.chip[aria-pressed="true"] { background: var(--green); color: var(--paper-high); border-color: var(--green); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { padding-block: 18px 0; }
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.breadcrumbs__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs__link { color: var(--moss); border-bottom: 1px solid transparent; transition: border-color 0.18s var(--ease), color 0.18s var(--ease); }
.breadcrumbs__link:hover { color: var(--green); border-color: var(--moss); }
.breadcrumbs__sep { color: var(--silver); }
.breadcrumbs__current { color: var(--ink); }

/* ---------- grid ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.grid-12__rail { grid-column: 1 / span 3; }
.grid-12__main { grid-column: 4 / span 9; }

/* ---------- prose ---------- */
.prose { max-width: 72ch; color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin-top: 2.2em;
}
.prose h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.35;
  margin-top: 1.8em;
}
.prose p { line-height: 1.85; }
.prose ul { display: grid; gap: 0.55em; }
.prose li { position: relative; padding-left: 20px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 8px;
  height: 2px;
  background: var(--red);
}
.prose a { color: var(--moss); border-bottom: 1px solid rgba(47, 93, 74, 0.4); }
.prose a:hover { border-color: var(--moss); }
.prose blockquote {
  padding: 18px 22px;
  background: var(--paper-high);
  border-left: 3px solid var(--yellow);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
}

/* ---------- image frame ---------- */
.img-frame {
  position: relative;
  background: var(--mist);
  border: 1px solid rgba(26, 29, 26, 0.12);
  overflow: hidden;
}
.img-frame__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(140deg, var(--mist) 0%, #C9D2CB 55%, #B4BFB8 100%);
  overflow: hidden;
}
.img-frame__inner img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.94) contrast(1.04); }
.img-frame__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: repeating-linear-gradient(0deg, rgba(11, 21, 18, 0.06) 0 1px, transparent 1px 3px);
}
.img-frame__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 10px 13px;
  background: var(--paper-high);
  border-top: 1px solid rgba(26, 29, 26, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.img-frame--wide .img-frame__inner { aspect-ratio: 21 / 9; }
.img-frame--tall .img-frame__inner { aspect-ratio: 4 / 5; }

/* ---------- card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 28px);
  background: var(--paper-high);
  border: 1px solid rgba(26, 29, 26, 0.12);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--moss); }
.card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--moss);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: -0.01em;
}
.card__text { font-size: 14px; line-height: 1.78; color: var(--ink-soft); }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #6C7671;
}

/* ---------- rules ---------- */
.rule {
  height: 1px;
  border: 0;
  background: var(--line-dark);
  margin-block: clamp(32px, 5vw, 64px);
}
.rule--label {
  display: flex;
  align-items: center;
  gap: 14px;
  height: auto;
  background: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss);
}
.rule--label::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line-dark); }

/* ---------- reveal ---------- */
html[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
html[data-js="on"] [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: translateY(-180%);
  transition: transform 0.18s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--green);
  color: var(--paper);
  border-bottom: 1px solid var(--line-light);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(184, 193, 189, 0.18);
  overflow: hidden;
  pointer-events: none;
}
.scroll-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width 0.12s linear;
}

/* --- index rail --- */
.header-rail {
  background: var(--green-night);
  border-bottom: 1px solid rgba(184, 193, 189, 0.14);
}
.header-rail__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: var(--rail-h);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}
.rail-signal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.rail-signal__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.18);
  flex: 0 0 auto;
}
.rail-tag { font-weight: 700; color: var(--paper-high); }
.rail-note { color: var(--silver); letter-spacing: 0.06em; }
.rail-motto {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  color: rgba(184, 193, 189, 0.85);
  letter-spacing: 0.14em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-link {
  flex: 0 0 auto;
  color: var(--paper-high);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--red);
  letter-spacing: 0.1em;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.rail-link:hover { color: var(--yellow); border-color: var(--yellow); }

/* --- brand bar --- */
.header-main { position: relative; }
.header-main__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.brand__glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--paper);
  color: var(--green);
  border-radius: 2px 14px 2px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  flex: 0 0 auto;
}
.brand__word { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--paper-high);
}
.brand__meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(184, 193, 189, 0.85);
}

/* --- nav toggle --- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 193, 189, 0.32);
  border-radius: 2px;
  color: var(--paper-high);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1;
}
.nav-toggle:hover { border-color: var(--yellow); color: var(--yellow); }
.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
  flex: 0 0 auto;
}
.nav-toggle__bars i {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), width 0.2s var(--ease);
}
.nav-toggle__bars i:nth-child(2) { width: 68%; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-toggle__text { white-space: nowrap; }

/* --- nav --- */
.site-nav { display: block; margin-left: auto; }
.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.1vw, 18px);
}
.site-nav__item { display: flex; align-items: center; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 2px;
  color: rgba(244, 235, 220, 0.82);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.site-nav__idx {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(244, 180, 0, 0.55);
  transform: translateY(-3px);
  transition: color 0.18s var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s var(--ease);
}
.site-nav__link:hover { color: var(--paper-high); }
.site-nav__link:hover::after { transform: scaleX(1); }
.site-nav__link:hover .site-nav__idx { color: var(--yellow); }
.site-nav__link[aria-current="page"] { color: var(--paper-high); }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); background: var(--red); }
.site-nav__link[aria-current="page"] .site-nav__idx { color: var(--red); }

.site-nav__item--cta { margin-left: 8px; }
.site-nav__item--cta .btn { white-space: nowrap; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  position: relative;
  background: var(--green);
  color: var(--paper);
  border-top: 1px solid var(--line-light);
}

.footer-top {
  position: relative;
  padding-block: clamp(48px, 7vw, 88px) clamp(38px, 5vw, 60px);
  overflow: hidden;
}
.footer-top::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(184, 193, 189, 0.08) 0 1px, transparent 1px 132px);
}
.footer-top > .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  grid-template-areas:
    "brand cols"
    "note note";
  gap: clamp(32px, 4vw, 56px) clamp(32px, 5vw, 80px);
}

.footer-brand { grid-area: brand; }
.footer-brand__glyph {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--green);
  border-radius: 2px 16px 2px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}
.footer-brand__name {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--paper-high);
}
.footer-brand__line {
  margin-top: 12px;
  max-width: 26em;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(244, 235, 220, 0.78);
}
.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(184, 193, 189, 0.32);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--silver);
}
.footer-version__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); flex: 0 0 auto; }

.footer-grid {
  grid-area: cols;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-content: start;
}
.footer-col { min-width: 0; }
.footer-col__title {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(184, 193, 189, 0.24);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver);
}
.footer-list { display: grid; gap: 10px; }
.footer-list__link {
  display: inline-block;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 235, 220, 0.86);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-list__link:hover { color: var(--yellow); transform: translateX(3px); border-color: rgba(244, 180, 0, 0.5); }

.footer-col--contact .footer-col__title { margin-bottom: 16px; }
.footer-contact { display: grid; gap: 14px; }
.footer-contact__item { display: grid; gap: 4px; }
.footer-contact__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(184, 193, 189, 0.75);
}
.footer-contact__value {
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(244, 235, 220, 0.9);
}

.contact-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  max-width: 100%;
  padding-bottom: 2px;
  font-size: 13.5px;
  line-height: 1.7;
  text-align: left;
  word-break: break-all;
  color: rgba(244, 235, 220, 0.92);
  border-bottom: 1px dashed rgba(244, 180, 0, 0.55);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.contact-copy::after {
  content: "复制";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--yellow);
  opacity: 0.8;
}
.contact-copy:hover { color: var(--paper-high); border-color: var(--yellow); }
.contact-copy[data-copied="true"] { color: var(--yellow); border-color: var(--yellow); }
.contact-copy[data-copied="true"]::after { content: "已复制"; opacity: 1; }

.footer-note {
  grid-area: note;
  max-width: 74ch;
  padding-top: 18px;
  border-top: 1px solid rgba(184, 193, 189, 0.22);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: rgba(184, 193, 189, 0.86);
}

.footer-bottom {
  background: var(--green-night);
  border-top: 1px solid rgba(184, 193, 189, 0.14);
  padding-block: 18px;
}
.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(184, 193, 189, 0.82);
}
.footer-copy { margin-right: auto; }
.footer-icp { color: rgba(184, 193, 189, 0.7); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-legal__link {
  color: rgba(244, 235, 220, 0.84);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-legal__link:hover { color: var(--yellow); border-color: var(--yellow); }

.to-top {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--ink);
  color: var(--paper-high);
  border: 1px solid rgba(244, 235, 220, 0.22);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(11, 21, 18, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s var(--ease), background 0.18s var(--ease);
}
.to-top[data-visible="true"] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--red); }
.to-top__arrow { font-size: 13px; line-height: 1; }
.to-top__text { white-space: nowrap; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    margin-left: 0;
    background: var(--green-night);
    border-top: 1px solid rgba(184, 193, 189, 0.24);
    box-shadow: 0 30px 50px rgba(11, 21, 18, 0.5);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav[data-open="true"] { display: block; animation: navDrop 0.24s var(--ease) both; }

  .site-nav__list {
    position: relative;
    display: block;
    padding: 8px var(--gutter) 26px;
  }
  .site-nav__list::before {
    content: "";
    position: absolute;
    left: calc(var(--gutter) + 15px);
    top: 34px;
    bottom: 96px;
    width: 1px;
    background: rgba(184, 193, 189, 0.3);
  }
  .site-nav__item {
    display: block;
    border-bottom: 1px solid rgba(184, 193, 189, 0.14);
  }
  .site-nav__item:last-child { border-bottom: 0; }
  .site-nav__link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 0 15px 44px;
    font-size: 15px;
    color: rgba(244, 235, 220, 0.88);
  }
  .site-nav__link::after { left: 44px; right: auto; width: 28px; bottom: 6px; }
  .site-nav__idx {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(184, 193, 189, 0.32);
    border-radius: 50%;
    background: var(--green-night);
    color: var(--yellow);
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .site-nav__link[aria-current="page"] .site-nav__idx { color: var(--red); border-color: rgba(197, 58, 47, 0.6); }

  .site-nav__item--cta {
    margin-left: 0;
    padding: 20px 0 0;
    border-bottom: 0;
  }
  .site-nav__item--cta .btn { width: 100%; }

  .footer-top > .wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "cols"
      "note";
  }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .grid-12__rail,
  .grid-12__main { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .rail-motto { display: none; }
}

@media (max-width: 640px) {
  .header-main__inner { min-height: 62px; }
  .brand__meta { display: none; }
  .br/and__name { font-size: 18px; }
  .rail-note { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom__inner { justify-content: flex-start; }
  .footer-copy { margin-right: 0; flex: 1 0 100%; }
  .to-top__text { display: none; }
  .to-top { padding: 12px 13px; }
}

@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[data-js="on"] [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .card:hover,
  .footer-list__link:hover { transform: none; }
}
