/* App shell: left rail + main column */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
}

.shell__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--bg-panel) 0%, #fff 42%, var(--bg-canvas) 100%);
  border-left: 1px solid var(--line);
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 1.25rem 1rem 1.5rem;
  background: linear-gradient(180deg, var(--bg-rail) 0%, var(--bg-rail-2) 55%, #0a0509 100%);
  color: #f5ebe3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    var(--accent),
    var(--gold) 35%,
    var(--violet) 70%,
    var(--jade)
  );
  opacity: 0.85;
  animation: rail-hue 14s ease-in-out infinite alternate;
}

@keyframes rail-hue {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(25deg);
  }
}

.rail__brand {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0 0.5rem 0.5rem;
}

.rail__mark {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.75;
  color: var(--gold);
}

.rail__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.35rem 0 0;
}

.rail__domain {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin-top: 0.35rem;
}

.rail__nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
}

.rail__link {
  display: block;
  padding: 0.45rem 0.6rem 0.45rem 0.75rem;
  border-radius: 10px;
  color: #f0e8df;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.rail__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.rail__link[aria-current="page"] {
  background: rgba(225, 75, 51, 0.22);
  border-color: rgba(225, 75, 51, 0.45);
  color: #fff;
}

.rail__sub {
  margin: 0.25rem 0 0.35rem;
  padding: 0;
  border: none;
}

.rail__sub summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  padding: 0.35rem 0.6rem;
}

.rail__sub summary::-webkit-details-marker {
  display: none;
}

.rail__sub ul {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0 0 0 0.35rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.rail__sub a {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8dfd6;
  text-decoration: none;
  border-radius: 8px;
}

.rail__sub a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.rail__sub a[aria-current="page"] {
  color: var(--gold);
}

.rail__cta {
  position: relative;
  margin-top: auto;
  padding-top: 1rem;
}

.rail__cta a {
  display: block;
  text-align: center;
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(225, 75, 51, 0.35);
}

.rail__cta a:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

/* Mobile drawer */
.menu-toggle {
  display: none;
  position: fixed;
  z-index: 90;
  bottom: 1rem;
  right: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--bg-rail);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.menu-toggle:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 5, 12, 0.45);
}

.backdrop.is-visible {
  display: block;
}

@media (max-width: 880px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    z-index: 80;
    width: min(20rem, 88vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-soft);
  }

  .rail.is-open {
    transform: translateX(0);
  }

  .shell__main {
    border-left: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }
}

.page-header {
  padding: 2.25rem 1.5rem 1rem;
  max-width: calc(var(--max-text) + 8rem);
}

.page-header__eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin: 0 0 0.5rem;
}

.page-header h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  margin: 0 0 0.75rem;
}

.page-header p {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--max-text);
}

.content {
  padding: 0 1.5rem 3.5rem;
  flex: 1;
}

.content--prose {
  max-width: calc(var(--max-text) + 2rem);
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.site-footer__grid {
  display: grid;
  gap: 1.5rem;
  max-width: 56rem;
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.footer-org {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.footer-meta,
.footer-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
}

.social-row a {
  font-weight: 700;
  text-decoration: none;
}
