/* =========================================================
   Royal Zunzun — shared site kit
   1. Reset  2. Tokens  3. Base & typography  4. Header rail
   5. Footer 6. Shared components 7. Responsive & motion
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

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

/* ---------- 2. Tokens ---------- */
:root {
  --violet-900: #24123A;
  --violet-700: #3B1E5A;
  --violet-400: #7B5C96;
  --gold-600: #C9A227;
  --gold-300: #E8CE78;
  --rime: #E8F0F2;
  --river: #1F6F8B;
  --paper: #FBF9F4;
  --ink: #16121C;
  --muted: #6D6478;

  --rail-w: 88px;
  --topbar-h: 64px;
  --radius: 10px;

  --hair: 1px solid rgba(123, 92, 150, 0.28);
  --hair-gold: 1px solid rgba(201, 162, 39, 0.5);

  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;

  --shadow-paper: 0 1px 0 rgba(22, 18, 28, 0.06), 0 18px 36px -28px rgba(36, 18, 58, 0.55);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;
}

/* ---------- 3. Base & typography ---------- */
body {
  min-height: 100vh;
  padding-top: var(--topbar-h);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(123, 92, 150, 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(123, 92, 150, 0.10) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.26;
  letter-spacing: -0.01em;
  color: var(--violet-700);
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }

strong { font-weight: 700; }
::selection { background: rgba(201, 162, 39, 0.32); color: var(--violet-900); }

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

#main-content { scroll-margin-top: calc(var(--topbar-h) + 12px); }

.sr-only {
  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;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--violet-900);
  color: var(--rime);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid var(--gold-600);
  transform: translateY(-180%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 4. Header rail ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: var(--violet-900);
  color: var(--rime);
  border-bottom: var(--hair-gold);
  box-shadow: 0 12px 30px -26px rgba(36, 18, 58, 0.95);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 8px 16px;
  border-bottom: 1px solid rgba(232, 240, 242, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--rime);
  transition: color var(--dur) var(--ease);
}
.brand:hover { color: var(--gold-300); }

.brand-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gold-600);
  border-radius: 4px;
  color: var(--gold-300);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  background: radial-gradient(circle at 30% 18%, rgba(201, 162, 39, 0.3), transparent 72%);
  box-shadow: inset 0 0 0 3px rgba(201, 162, 39, 0.14);
}

.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.brand-name { font-family: var(--font-serif); font-size: 15px; font-weight: 700; letter-spacing: 0.16em; }
.brand-sub { font-size: 10px; letter-spacing: 0.34em; color: rgba(232, 240, 242, 0.6); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid rgba(232, 240, 242, 0.28);
  border-radius: 6px;
  color: var(--rime);
  font-size: 12px;
  letter-spacing: 0.14em;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: rgba(232, 206, 120, 0.7); color: var(--gold-300); }
.nav-toggle[aria-expanded="true"] {
  border-color: var(--gold-600);
  color: var(--gold-300);
  background: rgba(201, 162, 39, 0.14);
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-toggle-label { white-space: nowrap; }

/* Drawer (mobile / tablet) */
.rail-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0 0;
  background: var(--violet-900);
  border-bottom: 1px solid var(--gold-600);
  box-shadow: 0 26px 44px -32px rgba(0, 0, 0, 0.9);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur) linear;
}
.site-header[data-open="true"] .rail-nav,
.rail-nav[data-open="true"] {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rail-nav-list { display: grid; }

.rail-nav-item { border-top: 1px solid rgba(232, 240, 242, 0.09); }
.rail-nav-item:first-child { border-top: 0; }

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  min-height: 48px;
  color: rgba(232, 240, 242, 0.86);
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.rail-link:hover { color: #fff; background: rgba(201, 162, 39, 0.1); }

.rail-link-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(232, 240, 242, 0.42);
}
.rail-link-label { display: block; }

.rail-link[aria-current="page"] {
  color: var(--gold-300);
  background: rgba(201, 162, 39, 0.14);
  box-shadow: inset 3px 0 0 var(--gold-600);
}
.rail-link[aria-current="page"] .rail-link-index { color: var(--gold-300); }

/* Three-step hint inside the drawer */
.rail-steps {
  margin: 16px 20px 4px;
  padding: 14px 16px;
  border: 1px dashed rgba(201, 162, 39, 0.48);
  border-radius: 8px;
  background: rgba(201, 162, 39, 0.06);
}
.rail-steps-title {
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--gold-300);
}
.rail-steps-list { display: grid; gap: 9px; }
.rail-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(232, 240, 242, 0.85);
}
.rail-step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold-600);
  border-radius: 50%;
  color: var(--gold-300);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.rail-cta { margin: 16px 20px 22px; }

.rail-status { display: none; }

.rail-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(201, 162, 39, 0.16);
  pointer-events: none;
}
.rail-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-300));
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  transition: transform 120ms linear;
}

/* ---------- 5. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
}

.footer-index {
  background: var(--violet-900);
  color: var(--rime);
  border-top: 3px solid var(--gold-600);
}
.footer-index-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(18px, 3vw, 28px) clamp(18px, 4vw, 56px);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-600);
  border-radius: 4px;
  color: var(--gold-300);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  background: rgba(201, 162, 39, 0.12);
}
.footer-brand-text {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--rime);
}
.footer-routes { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; }
.footer-route-link {
  padding: 5px 0;
  color: rgba(232, 240, 242, 0.74);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-route-link:hover { color: var(--gold-300); border-bottom-color: var(--gold-600); }

.footer-paper {
  background-color: var(--rime);
  background-image:
    linear-gradient(180deg, rgba(232, 240, 242, 0.2) 0%, rgba(251, 249, 244, 0.92) 62%, var(--paper) 100%),
    linear-gradient(to right, rgba(123, 92, 150, 0.12) 1px, transparent 1px);
  background-size: auto, 44px 44px;
  border-top: 1px solid rgba(201, 162, 39, 0.55);
}
.footer-paper-inner {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(26px, 4vw, 44px) clamp(18px, 4vw, 56px) clamp(20px, 3vw, 30px);
}

.footer-summary { display: grid; gap: 10px; align-content: start; }
.footer-summary-title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 700;
  color: var(--violet-700);
  letter-spacing: 0.02em;
}
.footer-summary-text { font-size: 14px; line-height: 1.85; color: var(--muted); max-width: 34em; }
.footer-note { font-size: 12px; line-height: 1.7; color: var(--muted); letter-spacing: 0.02em; }

.footer-cols { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.footer-col { min-width: 0; }
.footer-col-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--violet-700);
  border-bottom: 1px solid rgba(59, 30, 90, 0.18);
}

.footer-list { display: grid; gap: 9px; font-size: 14px; }
.footer-link {
  color: var(--violet-700);
  border-bottom: 1px solid rgba(59, 30, 90, 0.28);
  padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-link:hover { color: var(--river); border-bottom-color: var(--river); }

.footer-contact-list { display: grid; gap: 10px; }
.footer-contact-item { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; }
.footer-contact-key {
  flex: 0 0 auto;
  min-width: 4.2em;
  padding-top: 2px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.footer-contact-value { color: var(--ink); word-break: break-word; }

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(59, 30, 90, 0.16);
  font-size: 12.5px;
  color: var(--muted);
}
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-legal-link {
  color: var(--violet-700);
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(59, 30, 90, 0.3);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-legal-link:hover { color: var(--river); border-color: var(--river); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- 6. Shared components ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 56px);
}

.section {
  position: relative;
  padding-block: clamp(34px, 5.5vw, 72px);
}
.section + .section { border-top: var(--hair); }
.section--rime { background: rgba(232, 240, 242, 0.72); }
.section--deep { background: var(--violet-900); color: var(--rime); }
.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep .section-title { color: var(--rime); }
.section--deep .section-lede { color: rgba(232, 240, 242, 0.76); }

.section-head { display: grid; gap: 10px; margin-bottom: clamp(20px, 3vw, 34px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--river);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold-600);
}
.section-title { font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem); color: var(--violet-700); }
.section-lede { max-width: 46em; font-size: 16px; color: var(--muted); }

.display-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--violet-700);
}
.display-number {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(3.2rem, 2rem + 6vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--gold-600);
}

.panel {
  position: relative;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid rgba(59, 30, 90, 0.16);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}
.panel::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--gold-600);
  border-left: 1px solid var(--gold-600);
  opacity: 0.7;
  pointer-events: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid rgba(59, 30, 90, 0.22);
  border-radius: 999px;
  background: rgba(251, 249, 244, 0.75);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--violet-700);
}
.tag--gold { border-color: rgba(201, 162, 39, 0.6); background: rgba(201, 162, 39, 0.14); color: #7A5F0F; }
.tag--river { border-color: rgba(31, 111, 139, 0.45); background: rgba(31, 111, 139, 0.1); color: var(--river); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn--gold {
  background: var(--gold-600);
  color: var(--violet-900);
  border-color: var(--gold-600);
  box-shadow: 0 10px 20px -16px rgba(36, 18, 58, 0.9);
}
.btn--gold:hover { background: var(--gold-300); border-color: var(--gold-300); transform: translateY(-1px); }
.btn--violet { background: var(--violet-700); color: #fff; border-color: var(--violet-700); }
.btn--violet:hover { background: var(--violet-900); border-color: var(--violet-900); }
.btn--ghost { background: transparent; color: var(--violet-700); border-color: rgba(59, 30, 90, 0.35); }
.btn--ghost:hover { background: rgba(59, 30, 90, 0.06); border-color: var(--violet-700); }

.breadcrumb { padding-block: 14px; border-bottom: var(--hair); }
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  font-family: var(--font-mono);
  color: rgba(109, 100, 120, 0.6);
}
.breadcrumb-link {
  color: var(--violet-700);
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(59, 30, 90, 0.28);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.breadcrumb-link:hover { color: var(--river); border-bottom-color: var(--river); }
.breadcrumb-item[aria-current="page"] { color: var(--ink); font-weight: 600; }

.grid-split { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: minmax(0, 1fr); }

.stair { display: grid; gap: 18px; }

.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(59, 30, 90, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--rime) 0%, #DDEAEE 52%, rgba(201, 162, 39, 0.18) 100%);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(123, 92, 150, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(123, 92, 150, 0.18) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  opacity: 0.45;
  pointer-events: none;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rime);
  background: linear-gradient(180deg, transparent, rgba(36, 18, 58, 0.82));
}

.tabs { display: grid; gap: 18px; }
.tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(59, 30, 90, 0.16);
}
.tab {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover { color: var(--violet-700); background: rgba(59, 30, 90, 0.05); }
.tab[aria-selected="true"] {
  color: var(--violet-700);
  background: rgba(201, 162, 39, 0.16);
  border-bottom-color: var(--gold-600);
  box-shadow: inset 0 1px 0 rgba(201, 162, 39, 0.4);
}
.tabs-panel { padding-top: 4px; animation: tabIn 200ms var(--ease); }
.tabs-panel[hidden] { display: none; }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 7. Responsive & motion ---------- */
@media (min-width: 560px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 780px) {
  .stair { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .stair > *:nth-child(2) { margin-top: 28px; }
  .stair > *:nth-child(3) { margin-top: 56px; }
}

@media (min-width: 860px) {
  .grid-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .grid-split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

@media (min-width: 820px) {
  .footer-paper-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
}

@media (min-width: 960px) {
  body {
    padding-top: 0;
    padding-left: var(--rail-w);
    background-size: 56px 56px;
  }

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

  .site-header {
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    height: 100vh;
    height: 100dvh;
    border-bottom: 0;
    border-right: var(--hair-gold);
    background-image:
      linear-gradient(180deg, rgba(201, 162, 39, 0.18), transparent 26%),
      linear-gradient(180deg, var(--violet-900) 0%, var(--violet-700) 68%, var(--violet-900) 100%);
    box-shadow: 16px 0 38px -34px rgba(36, 18, 58, 0.95);
  }

  .rail-head {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 0;
    padding: 16px 6px 14px;
    border-bottom: var(--hair-gold);
  }

  .brand { flex-direction: column; gap: 8px; text-align: center; }
  .brand-seal { width: 34px; height: 34px; font-size: 18px; }
  .brand-name { font-size: 12.5px; letter-spacing: 0.14em; }
  .brand-sub { display: none; }

  .nav-toggle { display: none; }

  .rail-nav {
    position: static;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .rail-nav-item { border-top: 1px solid rgba(232, 240, 242, 0.1); }

  .rail-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 11px 8px 11px 14px;
    min-height: 0;
    font-size: 12px;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: rgba(232, 240, 242, 0.78);
  }
  .rail-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 1px;
    background: var(--gold-600);
    opacity: 0.45;
    transform: translateY(-50%);
    transition: width var(--dur) var(--ease), opacity var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .rail-link:hover::before { width: 14px; opacity: 1; }
  .rail-link-index { font-size: 9px; letter-spacing: 0.14em; }

  .rail-link[aria-current="page"] {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.24), rgba(201, 162, 39, 0));
    box-shadow: none;
  }
  .rail-link[aria-current="page"]::before { width: 20px; opacity: 1; background: var(--gold-300); }

  .rail-steps { display: none; }

  .rail-cta {
    margin: auto 10px 12px;
    min-height: 40px;
    padding: 9px 6px;
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .rail-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px 16px;
    font-size: 9.5px;
    line-height: 1.55;
    letter-spacing: 0.04em;
    text-align: center;
    color: rgba(232, 240, 242, 0.56);
    border-top: 1px solid rgba(232, 240, 242, 0.1);
  }
  .rail-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--river);
    box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.3);
  }

  .rail-progress {
    top: 0;
    bottom: 0;
    left: auto;
    right: -1px;
    width: 2px;
    height: auto;
  }
  .rail-progress-fill {
    background: linear-gradient(180deg, var(--gold-600), var(--gold-300));
    transform: scaleY(var(--progress, 0));
    transform-origin: top center;
  }
}

@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .rail-progress-fill { transition: none; }
}
