/* ============ 1. CSS Variables ============ */
:root {
  --color-primary: #C8102E;
  --color-gold: #FFD700;
  --color-lapis: #005A8D;
  --color-grey: #6B6969;
  --color-moss: #5A7D6D;
  --color-terracotta: #B85C3C;
  --color-rice: #F5EFE6;
  --color-white: #FFFFFF;
  --color-lake: #1E88A8;
  --color-ink: #2B2B2B;

  --font-display: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  --font-body: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;

  --rail-width: 232px;
  --topbar-height: 40px;
  --header-main-height: 64px;
  --content-max: 1120px;
  --radius: 8px;
  --border-w: 3px;
  --border-color: #2B2B2B;

  --shadow-brutal: 4px 6px 0 rgba(0, 0, 0, 0.12);
  --shadow-brutal-hover: 6px 9px 0 rgba(200, 16, 46, 0.14);
  --shadow-btn: 3px 4px 0 var(--border-color);
  --shadow-btn-hover: 5px 6px 0 var(--border-color);

  color-scheme: light;
}

/* ============ 2. Reset & Base ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  background: var(--color-rice);
  color: var(--color-ink);
  padding-top: var(--topbar-height);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

ul, ol {
  list-style: none;
}

a {
  color: var(--color-lapis);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--color-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.25;
  color: var(--color-ink);
}

p {
  color: var(--color-ink);
}

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

::selection {
  background: var(--color-primary);
  color: #fff;
}

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

/* ============ 3. Skip Link ============ */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1.25rem;
  z-index: 999;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  border: 2px solid var(--border-color);
  border-top: 0;
  box-shadow: 3px 4px 0 var(--border-color);
  transition: top 0.25s ease;
}

.skip-link:focus-visible {
  top: 0;
  color: #fff;
  outline: none;
}

/* ============ 4. Scroll Progress ============ */
.scroll-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-gold) 55%, var(--color-lapis) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 300;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .scroll-progress {
    left: var(--rail-width);
  }
}

/* ============ 5. Main Content Layout ============ */
.main-content {
  min-height: 70vh;
}

.main-content:focus-visible {
  outline: none;
}

@media (min-width: 1024px) {
  .main-content {
    margin-left: var(--rail-width);
  }
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* ============ 6. Typography ============ */
.display-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--color-primary);
  text-shadow: 3px 3px 0 var(--color-gold);
}

.lead {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-grey);
}

.mono {
  font-family: var(--font-mono);
}

.section {
  padding: 2.5rem 0;
  position: relative;
}

@media (min-width: 1024px) {
  .section {
    padding: 4rem 0;
  }
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.625rem;
  border-bottom: 3px solid var(--border-color);
}

.section-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--color-terracotta);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--color-ink);
}

.section-sub {
  font-size: 0.875rem;
  color: var(--color-grey);
  margin-top: 0.25rem;
}

/* ============ 7. Grid ============ */
.grid {
  display: grid;
  gap: 1.25rem;
}

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

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

.grid--4 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============ 8. Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-align: center;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-btn-hover);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 2px 0 var(--border-color);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: #A80D24;
  color: #fff;
}

.btn--gold {
  background: var(--color-gold);
  color: var(--color-ink);
}

.btn--gold:hover {
  background: #FFC700;
  color: var(--color-ink);
}

.btn--outline {
  border-color: var(--color-lapis);
  color: var(--color-lapis);
}

.btn--outline:hover {
  background: var(--color-lapis);
  color: #fff;
}

/* ============ 9. Breadcrumb ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-grey);
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--color-lapis);
  font-weight: 500;
}

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

.breadcrumb [aria-current="page"] {
  color: var(--color-ink);
  font-weight: 700;
}

.breadcrumb-sep {
  color: var(--color-grey);
  opacity: 0.7;
}

/* ============ 10. Cards & Boards ============ */
.card {
  background: var(--color-white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-brutal);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-brutal-hover);
  border-color: var(--color-primary);
}

.card--board {
  border-left-width: 6px;
  border-left-color: var(--color-terracotta);
}

.card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  background: var(--color-rice);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-ink);
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-rice);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-grey);
}

.topic-board {
  background: var(--color-white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-brutal);
  overflow: hidden;
}

.topic-board__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-rice);
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
}

.topic-board__body {
  padding: 1.25rem;
}

.topic-board__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-rice);
  font-size: 0.875rem;
  color: var(--color-grey);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* ============ 11. Tabs ============ */
.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 3px solid var(--border-color);
  padding-bottom: 0;
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 2px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-grey);
  cursor: pointer;
  position: relative;
  bottom: -2px;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  color: var(--color-primary);
  background: rgba(200, 16, 46, 0.06);
}

.tab-btn[aria-selected="true"] {
  background: var(--color-primary);
  color: #fff;
}

.tab-panel {
  padding: 0.25rem 0 1.5rem;
}

.tab-panel[hidden] {
  display: none;
}

/* ============ 12. Term List ============ */
.term-list {
  display: grid;
  gap: 0.875rem;
}

.term-list dt {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9375rem;
  color: var(--color-primary);
}

.term-list dd {
  margin-left: 0;
  color: var(--color-grey);
  font-size: 0.875rem;
  line-height: 1.6;
}

.reading-list {
  border-left: 4px solid var(--color-terracotta);
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reading-list a {
  color: var(--color-lapis);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reading-list a:hover {
  color: var(--color-primary);
}

/* ============ 13. Image Frame Placeholder ============ */
.image-frame {
  position: relative;
  background: var(--color-white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.image-frame::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 0, 0, 0.02) 0px,
    rgba(0, 0, 0, 0.02) 10px,
    rgba(0, 0, 0, 0.01) 10px,
    rgba(0, 0, 0, 0.01) 20px
  );
  z-index: 1;
  padding: 1rem;
  text-align: center;
}

.image-frame--landscape {
  aspect-ratio: 16 / 9;
}

.image-frame--portrait {
  aspect-ratio: 3 / 4;
}

.image-frame--square {
  aspect-ratio: 1 / 1;
}

/* ============ 14. Site Header ============ */
.site-header {
  position: relative;
}

@media (max-width: 1023px) {
  body {
    padding-top: calc(var(--topbar-height) + var(--header-main-height));
  }
}

/* ---- Rail (side navigation) ---- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  background: var(--color-rice);
  border-right: var(--border-w) solid var(--border-color);
  z-index: 200;
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.rail[data-open] {
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.3s ease, visibility 0s linear 0s;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
  .rail {
    visibility: visible;
    transform: none;
    transition: none;
    box-shadow: none;
  }
}

/* ---- Brand ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  line-height: 1.2;
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--color-primary);
  color: var(--color-gold);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.375rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 2px 3px 0 var(--border-color);
  transform: rotate(-2deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.brand:hover .brand-seal {
  transform: rotate(0deg) scale(1.04);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.brand-tag {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-grey);
  white-space: nowrap;
}

.brand--rail {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  background: var(--color-white);
}

.brand--rail .brand-name {
  font-size: 0.9375rem;
  line-height: 1.3;
}

.brand--header {
  display: flex;
}

.brand--header .brand-seal {
  width: 40px;
  height: 40px;
  font-size: 1.125rem;
  border-radius: 8px;
}

.brand--header .brand-name {
  font-size: 1rem;
}

.brand--footer {
  margin-bottom: 1rem;
}

.brand--footer .brand-seal {
  background: var(--color-gold);
  color: var(--color-primary);
}

.brand--footer .brand-name {
  color: var(--color-gold);
}

.brand--footer .brand-tag {
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Sidenav ---- */
.sidenav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidenav-list {
  display: flex;
  flex-direction: column;
}

.sidenav-item {
  position: relative;
}

.sidenav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8125rem 1.25rem;
  color: var(--color-ink);
  font-weight: 600;
  font-size: 0.9375rem;
  border-left: 4px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidenav-link:hover {
  background: rgba(255, 215, 0, 0.18);
  color: var(--color-primary);
  border-left-color: var(--color-gold);
}

.sidenav-link[aria-current="page"] {
  background: var(--color-primary);
  color: #fff;
  border-left-color: var(--color-gold);
}

.sidenav-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-lapis);
  font-weight: 700;
  width: 1.75rem;
  flex-shrink: 0;
}

.sidenav-link[aria-current="page"] .sidenav-num {
  color: var(--color-gold);
}

.sidenav-label {
  flex: 1;
}

/* ---- Rail footer ---- */
.rail-footer {
  padding: 1rem 1.25rem;
  border-top: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-grey);
  background: var(--color-white);
}

.rail-copy {
  letter-spacing: 0.05em;
}

/* ---- Topbar ---- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--color-lapis);
  border-bottom: 2px solid var(--border-color);
  z-index: 180;
}

@media (min-width: 1024px) {
  .topbar {
    left: var(--rail-width);
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0 1.25rem;
  max-width: var(--content-max);
  margin: 0 auto;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.topbar-inner::-webkit-scrollbar {
  display: none;
}

.topbar-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-gold);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;
  margin-top: 2px;
}

.topbar-version {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

.topbar-mobile-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
}

.topbar-mobile-tip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-moss);
  box-shadow: 0 0 0 2px rgba(90, 125, 109, 0.35);
  flex-shrink: 0;
}

.topbar-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

@media (max-width: 639px) {
  .topbar-switch {
    font-size: 0.75rem;
  }
  .topbar-version {
    display: none;
  }
  .topbar-mobile-tip {
    font-size: 0.75rem;
  }
  .topbar-inner {
    padding: 0 0.875rem;
    gap: 0.5rem;
  }
}

/* ---- Header main (mobile brand row) ---- */
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  height: var(--header-main-height);
  background: var(--color-rice);
  border-bottom: 2px solid var(--border-color);
  padding: 0 1.25rem;
  z-index: 170;
}

@media (min-width: 1024px) {
  .header-main {
    display: none;
  }
}

/* ---- Nav toggle ---- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--color-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 2px 3px 0 var(--border-color);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 5px 0 var(--border-color);
}

.nav-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--border-color);
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Nav overlay ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay[data-open] {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .nav-overlay {
    display: none;
  }
}

/* ============ 15. Site Footer ============ */
.site-footer {
  position: relative;
  margin-top: 4rem;
  background: #0B2434;
  color: rgba(255, 255, 255, 0.82);
}

@media (min-width: 1024px) {
  .site-footer {
    margin-left: var(--rail-width);
  }
}

.footer-deco {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-gold) 50%, var(--color-lapis) 100%);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 1.4fr 1fr 1fr;
    padding: 3.5rem 1.5rem 2.5rem;
  }
}

.footer-brand-block {
  max-width: 30rem;
}

.footer-trust {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
}

.footer-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--color-gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem 0.75rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-nav a:hover {
  color: var(--color-gold);
  padding-left: 4px;
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer-contact-item {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.footer-legal-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
}

.footer-legal-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
  font-weight: 600;
}

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

.footer-legal-note {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem 0.875rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.875rem 1.25rem;
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: var(--content-max);
  margin: 0 auto;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-version {
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.65);
}

.footer-icp {
  font-family: var(--font-mono);
}

.footer-copy {
  font-family: var(--font-mono);
}

/* ============ 16. Reveal Animation ============ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card,
  .btn,
  .sidenav-link,
  .brand-seal,
  .footer-nav a,
  .skip-link {
    transition: none;
  }

  .rail,
  .rail[data-open],
  .nav-overlay {
    transition: opacity 0.1s linear, transform 0.1s linear, visibility 0s linear;
  }

  .card:hover {
    transform: none;
  }
}

/* ============ 18. Print ============ */
@media print {
  .rail,
  .topbar,
  .header-main,
  .scroll-progress,
  .nav-overlay,
  .nav-toggle {
    display: none !important;
  }

  body {
    padding-top: 0;
  }

  .main-content,
  .site-footer {
    margin-left: 0;
  }

  .site-footer {
    background: #fff;
    color: #000;
  }

  .site-footer a {
    color: #000;
  }
}
