/* ==========================================================================
   Wiki Portal template
   --------------------------------------------------------------------------
   Layout: a two-track grid, a narrow left rail beside the content column,
   both scrolling together as one page, with a decorative masthead band
   across the top that the page chrome sits on top of.
   Every value below is either a shared theme token or a local --wiki-* token
   declared here; no token from theme.css is redefined, per the template
   contract.
   ========================================================================== */

.wiki-page {
  --wiki-well: #1c1830;
  --wiki-strong: #fff;
  --wiki-strong-2: rgba(255, 255, 255, 0.92);
  --wiki-soft-1: rgba(255, 255, 255, 0.86);
  --wiki-soft-2: rgba(255, 255, 255, 0.82);
  --wiki-soft-3: rgba(255, 255, 255, 0.8);
  --wiki-soft-4: rgba(255, 255, 255, 0.78);
  --wiki-soft-5: rgba(255, 255, 255, 0.75);
  --wiki-soft-6: rgba(255, 255, 255, 0.72);
  --wiki-soft-7: rgba(255, 255, 255, 0.6);
  --wiki-on-fill: #fff;
  /* Local palette: a muted, low-chroma navy-violet. Panels sit LIGHTER than
     the canvas, which is what lets a page this dense separate its sections
     with fill alone and no borders. */
  --wiki-canvas: #241f3f;
  --wiki-rail-bg: #2b2551;
  --wiki-panel: #322c5c;
  --wiki-panel-raised: #3a3369;
  --wiki-border: #423a75;
  --wiki-border-soft: #37315f;
  --wiki-link: #b9aaff;
  --wiki-link-hover: #d9d0ff;
  --wiki-accent: #7d5fe6;
  --wiki-accent-bright: #9b80ff;
  --wiki-text: #ece9f8;
  --wiki-text-dim: #b0a8d2;
  /* Was #8a82ad: 3.56:1 on a panel. This clears 4.5:1 on every panel fill. */
  --wiki-text-faint: #aaa3cc;
  --wiki-footer-bg: #1d1936;

  /* Layout dials */
  --wiki-rail-width: 168px;
  --wiki-content-max: 1120px;
  --wiki-gutter: var(--space-8);
  --wiki-masthead-height: 132px;

  background: var(--wiki-canvas);
  color: var(--wiki-text);
  margin: 0;
}

/* Light mode: the wiki on a bright screen. Lilac-white panels,
   deep violet text and links; the violet accent fills kept (PRD section 13.10). Only this template's own tokens
   change; screen only, so print keeps the template's own palette. */
@media screen {
  :root[data-theme="light"] .wiki-page {
    --color-accent: var(--wiki-link);
    --color-accent-emphasis: var(--wiki-link-hover);
    --wiki-well: #ebe7f8;
    --wiki-strong: #1d1838;
    --wiki-strong-2: #1d1838;
    --wiki-soft-1: #2e2852;
    --wiki-soft-2: #2e2852;
    --wiki-soft-3: #2e2852;
    --wiki-soft-4: #4a4370;
    --wiki-soft-5: #4a4370;
    --wiki-soft-6: #4a4370;
    --wiki-soft-7: #5c5582;
    --wiki-canvas: #f6f4fc;
    --wiki-rail-bg: #ece8fa;
    --wiki-panel: #ffffff;
    --wiki-panel-raised: #f1eefb;
    --wiki-border: #d5cdee;
    --wiki-border-soft: #e4def5;
    --wiki-link: #4b2fc4;
    --wiki-link-hover: #33209a;
    --wiki-text: #1d1838;
    --wiki-text-dim: #4f4874;
    --wiki-text-faint: #5c5582;
    --wiki-footer-bg: #ebe7f8;
    color-scheme: light;
  }

  /* The band turns light with the page, so the dark links and tabs that sit
     on it keep their contrast (Color Standard, rule 1). */
  :root[data-theme="light"] .wiki-page .wiki-masthead {
    background:
      radial-gradient(60% 120% at 6% 0%, rgba(96, 214, 168, 0.3), transparent 62%),
      radial-gradient(70% 150% at 68% -10%, rgba(150, 108, 240, 0.3), transparent 66%),
      linear-gradient(180deg, #ddd5f7 0%, #e8e3fa 55%, var(--wiki-canvas) 100%);
  }
}

.wiki-theme-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.wiki-theme-btn:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

/* A display rule anywhere below must not un-hide a [hidden] element. */
.wiki-page [hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Skip link and shell
   -------------------------------------------------------------------------- */

.wiki-skip {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 60;
  padding: var(--space-2) var(--space-4);
  background: var(--wiki-accent);
  color: var(--wiki-on-fill);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.wiki-skip:focus {
  top: var(--space-2);
}

/* One scroll, two tracks. The rail is a normal grid column rather than a
   fixed, independently scrolling element: that is what removes the rail's
   own scrollbar, and with it the light track that used to cut down the
   boundary between the rail and the content. */
.wiki-layout {
  position: relative;
  display: grid;
  grid-template-columns: var(--wiki-rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Masthead artwork
   A decorative band the header chrome is laid over. It is a background, not
   content: aria-hidden, no text, and it fades into the canvas at its lower
   edge so the content below it starts on flat colour.

   It spans BOTH grid tracks and is painted exactly once. That is the whole
   point: a gradient's percentage positions resolve against its own box, so
   painting the band twice, once in a 168px rail and once in a wide content
   column, could never line up at the seam however carefully the two were
   matched. One box, one paint, no seam. (PRD section 14, defect D1.)
   -------------------------------------------------------------------------- */

.wiki-masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: var(--wiki-masthead-height);
  pointer-events: none;
  background:
    radial-gradient(60% 120% at 6% 0%, rgba(96, 214, 168, 0.42), transparent 62%),
    radial-gradient(50% 130% at 30% 8%, rgba(126, 224, 196, 0.28), transparent 60%),
    radial-gradient(70% 150% at 68% -10%, rgba(150, 108, 240, 0.45), transparent 66%),
    linear-gradient(180deg, #3a2f66 0%, #2b2551 55%, var(--wiki-canvas) 100%);
}

/* --------------------------------------------------------------------------
   Left rail
   The rail is a grid column, not a fixed overlay: it scrolls with the page,
   and it is narrow enough that the article column still centres in what is
   left of the viewport. Giving it a scroll of its own would buy persistence
   at the cost of a scrollbar cutting down the artwork, which is the trade
   this template deliberately declines.
   -------------------------------------------------------------------------- */

/* The rail is positioned only so that it stacks above the artwork; it holds
   no scroll of its own. Its background starts exactly where the band ends,
   so the top of the rail is the band itself showing through rather than a
   second copy of it. */
.wiki-rail {
  position: relative;
  z-index: 1;
  padding: var(--space-3) var(--space-4) var(--space-10);
  background: linear-gradient(
    to bottom,
    transparent 0 var(--wiki-masthead-height),
    var(--wiki-rail-bg) var(--wiki-masthead-height)
  );
}

/* Wordmark: large enough to hold the top of the artwork band on its own,
   the way a masthead logo has to. */
.wiki-wordmark {
  display: block;
  padding: var(--space-4) 0 var(--space-6);
  color: var(--wiki-strong);
  text-align: center;
}

.wiki-wordmark:hover {
  text-decoration: none;
  color: var(--wiki-strong);
}

.wiki-wordmark-glyph {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--wiki-strong);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.wiki-wordmark-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.wiki-wordmark-text em {
  display: block;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--wiki-soft-2);
}

/* One line, small: the chat link is a rail affordance, not a page CTA. */
.wiki-rail-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--wiki-accent);
  color: var(--wiki-on-fill);
  font-size: 0.7rem;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  transition: background var(--transition-base);
}

.wiki-rail-cta svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.wiki-rail-cta:hover {
  background: var(--wiki-accent-bright);
  text-decoration: none;
}

.wiki-rail-search {
  margin-bottom: var(--space-4);
}

.wiki-rail-filter {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--wiki-soft-5);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--wiki-text);
  font: inherit;
  font-size: 0.7rem;
}

.wiki-rail-filter::placeholder {
  color: var(--wiki-text-faint);
}

.wiki-rail-filter:focus-visible,
.wiki-search input:focus-visible {
  outline: 2px solid var(--wiki-accent-bright);
  outline-offset: 1px;
}

/* Rail typography is deliberately one step below the page's smallest body
   size. A rail carries forty links; at body size it would compete with the
   article, and at this size the whole structure is visible without scrolling. */
.wiki-rail-group {
  margin-bottom: var(--space-4);
}

.wiki-rail-group h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1) 0;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 0.72rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
  color: var(--wiki-strong);
}

.wiki-pulse {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55);
  animation: wiki-pulse 2.4s ease-out infinite;
}

@keyframes wiki-pulse {
  70% { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .wiki-pulse { animation: none; }
}

.wiki-rail-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-rail-group a {
  display: block;
  padding: 2px 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--wiki-link);
}

.wiki-rail-group a:hover {
  color: var(--wiki-link-hover);
  text-decoration: underline;
}

/* Recent changes: title on one line, attribution beneath it in a dimmer
   colour, so the feed scans as a list of pages rather than a list of people. */
.wiki-rail-changes li {
  margin-bottom: var(--space-2);
}

.wiki-rail-changes span {
  display: block;
  font-size: 0.66rem;
  line-height: 1.3;
  color: var(--wiki-text-faint);
}

.wiki-rail-more {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: 0.72rem;
  color: var(--wiki-link);
}

.wiki-rail-empty {
  margin: var(--space-4) 0;
  font-size: 0.72rem;
  color: var(--wiki-text-faint);
}

/* --------------------------------------------------------------------------
   Content column
   -------------------------------------------------------------------------- */

.wiki-column {
  position: relative;
  min-width: 0;
}

/* Utility controls ride in the corner of the artwork. They are the lowest
   priority items on the page, so they get the smallest type, the least
   contrast, and no row of their own. */
.wiki-utility {
  position: absolute;
  top: var(--space-1);
  right: var(--space-4);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.7rem;
  color: var(--wiki-soft-4);
}

.wiki-utility a {
  color: var(--wiki-soft-4);
}

.wiki-utility a:hover {
  color: var(--wiki-strong);
}

.wiki-utility-clock {
  font-variant-numeric: tabular-nums;
}

.wiki-utility-icon {
  display: grid;
  place-items: center;
  padding: 2px;
  border: none;
  background: none;
  color: var(--wiki-soft-4);
  cursor: pointer;
}

.wiki-utility-icon:hover,
.wiki-utility-icon[aria-pressed="true"] {
  color: var(--wiki-strong);
}

/* Top bar: tabs on the left, page actions and search on the right. It is
   transparent because it sits on the artwork, and it scrolls away with the
   page rather than sticking, which is how the reference layout behaves. */
/* The topbar wraps rather than compresses. Its groups hold fixed-width items
   (the 30px sister chips), so squeezing the row does not shrink them, it
   overflows them onto whatever sits to the right. Wrapping costs a row of
   height; compressing costs legibility. */
.wiki-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 46px;
  padding: var(--space-6) var(--wiki-gutter) 0 0;
}

.wiki-topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.wiki-tabs {
  display: flex;
}

/* Flat tabs. The active one is marked by weight and a barely-there fill;
   a heavier treatment would out-shout the page title two lines below it. */
.wiki-tab {
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--wiki-link);
  font: inherit;
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.wiki-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--wiki-link-hover);
}

.wiki-tab.is-active {
  background: rgba(0, 0, 0, 0.24);
  color: var(--wiki-strong);
}

.wiki-family {
  display: flex;
  gap: 1px;
}

.wiki-family-chip {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--wiki-well);
  color: var(--wiki-soft-5);
  font-size: 0.62rem;
  font-weight: var(--font-weight-bold);
}

/* Brightness, not a colour swap: each chip carries its own foreground, so a
   shared hover colour would break contrast on the light one. */
.wiki-family-chip:hover {
  text-decoration: none;
  filter: brightness(1.15);
}

/* Each sister wiki keeps its own colour, so the chips are recognisable as a
   set of destinations rather than as three copies of one button. */
.wiki-family-chip--os { background: #d8cfae; color: #2c2718; }
.wiki-family-chip--rs { background: #2f7a4a; color: #fff; }
.wiki-family-chip--classic { background: #14111f; color: #e6dfa8; }

.wiki-family-chip.is-current {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: -2px;
}

.wiki-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2) var(--space-1);
}

.wiki-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--wiki-soft-1);
  font: inherit;
  font-size: var(--font-size-sm);
  cursor: pointer;
  white-space: nowrap;
}

.wiki-topbar-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--wiki-strong);
  text-decoration: none;
}

.wiki-menu {
  position: relative;
}

.wiki-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-1));
  min-width: 180px;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--wiki-panel-raised);
  border: 1px solid var(--wiki-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.wiki-menu-list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--wiki-text);
}

.wiki-menu-list a:hover {
  background: var(--wiki-accent);
  color: var(--wiki-on-fill);
  text-decoration: none;
}

.wiki-search {
  display: flex;
  align-items: stretch;
  margin-left: var(--space-2);
  border: 1px solid var(--wiki-soft-5);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.wiki-search input {
  width: 290px;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--wiki-strong);
  font: inherit;
  font-size: var(--font-size-sm);
}

.wiki-search input::placeholder {
  color: var(--wiki-soft-7);
}

.wiki-search button {
  display: grid;
  place-items: center;
  padding: 0 var(--space-3);
  border: none;
  background: transparent;
  color: var(--wiki-soft-3);
  cursor: pointer;
}

.wiki-search button:hover {
  color: var(--wiki-strong);
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */

.wiki-main {
  position: relative;
  z-index: 1;
  max-width: var(--wiki-content-max);
  margin: 0 auto;
  padding: var(--space-10) var(--wiki-gutter) var(--space-16);
}

.wiki-page.is-wide {
  --wiki-content-max: 1440px;
}

.wiki-main:focus {
  outline: none;
}

.wiki-demo-note {
  margin: 0 0 var(--space-6) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--wiki-panel);
  font-size: var(--font-size-sm);
  color: var(--wiki-text-dim);
}

/* Welcome: prose on the left, a statistics block on the right. */
.wiki-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-10);
  align-items: start;
  margin-bottom: var(--space-10);
}

.wiki-welcome h1 {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  color: var(--wiki-strong);
}

.wiki-welcome-text p {
  margin: 0;
  max-width: 62ch;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--wiki-text);
}

.wiki-welcome-text a {
  color: var(--wiki-link);
}

.wiki-welcome-text em {
  font-style: italic;
}

/* Statistics read as sentences, not as a table: label, colon, bold value,
   all on one line and left-aligned. Spreading the value to a far right edge
   would turn four short facts into four long ones to scan. */
.wiki-stats {
  margin: var(--space-1) 0 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.9;
  color: var(--wiki-text);
}

.wiki-stats div {
  display: block;
}

.wiki-stats dt {
  display: inline;
}

.wiki-stats dt::after {
  content: ":";
}

.wiki-stats dd {
  display: inline;
  margin: 0 0 0 var(--space-1);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}

/* Featured banner: art block, then a body marked by an accent edge. */
.wiki-banner {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
  margin-bottom: var(--space-10);
}

.wiki-banner-art {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  aspect-ratio: 16 / 11;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 25%, rgba(155, 128, 255, 0.5), transparent 62%),
    linear-gradient(150deg, #40337a, #221d42 72%);
  color: #f0e6b4;
  text-align: center;
}

.wiki-banner-art span {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: #cdbfff;
}

.wiki-banner-art strong {
  font-size: var(--font-size-3xl);
  line-height: 1;
  letter-spacing: 0.05em;
}

.wiki-banner-body {
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-success);
  background: var(--wiki-panel);
}

.wiki-banner-body h2 {
  margin: 0 0 var(--space-3) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  color: var(--wiki-link-hover);
}

.wiki-banner-body h2 strong {
  font-weight: var(--font-weight-bold);
}

.wiki-banner-body p {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--wiki-text);
}

.wiki-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-3) !important;
}

.wiki-banner-links a {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--wiki-link);
}

.wiki-banner-links a + a::before {
  content: "\2022";
  margin-right: var(--space-3);
  color: var(--wiki-text-faint);
}

/* Feature cards: art on top, caption block beneath, three across. The art is
   wide and short (2:1) so three cards fit above the fold beside everything
   else this page has to carry. */
.wiki-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.wiki-feature {
  display: flex;
  flex-direction: column;
  background: var(--wiki-panel);
  color: inherit;
  transition: background var(--transition-base);
}

.wiki-feature:hover {
  text-decoration: none;
  background: var(--wiki-panel-raised);
}

.wiki-feature-art {
  display: block;
  aspect-ratio: 2 / 1;
}

.wiki-feature-body {
  display: block;
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.wiki-feature-meta {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--wiki-text-faint);
}

.wiki-feature-title {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--wiki-strong);
}

.wiki-feature:hover .wiki-feature-title {
  color: var(--wiki-link-hover);
}

.wiki-feature-blurb {
  display: block;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--wiki-text-dim);
}

/* Portal tiles: the same card shape at a smaller scale. */
.wiki-portals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-10);
}

.wiki-portal {
  display: flex;
  flex-direction: column;
  background: var(--wiki-panel);
  color: inherit;
  transition: background var(--transition-base);
}

.wiki-portal:hover {
  text-decoration: none;
  background: var(--wiki-panel-raised);
}

.wiki-portal-art {
  display: block;
  aspect-ratio: 2 / 1;
}

.wiki-portal-label {
  display: block;
  padding: var(--space-3);
  text-align: center;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--wiki-strong);
}

/* Two-column band: a wide panel beside a narrow promo rail. */
.wiki-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-5);
}

.wiki-panel {
  padding: var(--space-6);
  background: var(--wiki-panel);
  margin-bottom: var(--space-5);
}

.wiki-split > .wiki-panel {
  margin-bottom: 0;
}

.wiki-panel h2 {
  margin: 0 0 var(--space-5) 0;
  font-size: var(--font-size-xl);
  color: var(--wiki-strong);
}

.wiki-panel-kicker {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--font-size-xs);
  color: var(--wiki-text-faint);
}

.wiki-panel-kicker + h2 {
  margin-top: 0;
}

/* Skill grid: three columns of icon-and-label links. An explicit column
   count beats auto-fill here because the labels are short and uneven. */
.wiki-skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-skill-grid a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--wiki-link);
}

.wiki-skill-grid a:hover {
  background: var(--wiki-panel-raised);
  color: var(--wiki-link-hover);
  text-decoration: none;
}

.wiki-skill-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: var(--radius-sm);
}

/* Promo rail cards */
.wiki-rail-right {
  display: grid;
  gap: var(--space-5);
}

.wiki-promo {
  display: block;
  color: var(--wiki-strong);
  transition: filter var(--transition-base);
}

.wiki-promo:hover {
  text-decoration: none;
  filter: brightness(1.1);
}

.wiki-promo-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.wiki-promo--chat {
  background: linear-gradient(120deg, #6a4bd8, #8f6bff);
}

.wiki-promo--social {
  --wiki-soft-4: rgba(255, 255, 255, 0.78);
  background: #100e1c;
  color: #f4f2ff;
}

.wiki-promo-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
}

.wiki-promo--social .wiki-promo-icon {
  border-radius: var(--radius-sm);
  background: #fff;
  color: #100e1c;
}

.wiki-promo-body {
  display: block;
  min-width: 0;
  line-height: var(--line-height-tight);
}

.wiki-promo-body strong {
  display: block;
  font-size: var(--font-size-base);
}

.wiki-promo-body span {
  display: block;
  margin-top: 2px;
  font-size: var(--font-size-xs);
  color: var(--wiki-soft-4);
}

.wiki-promo-arrow {
  margin-left: auto;
  font-size: var(--font-size-lg);
  color: var(--wiki-soft-6);
}

/* A caps strip along the bottom of the card, which reads as a label for the
   whole block rather than as another link. */
.wiki-promo-foot {
  display: block;
  padding: var(--space-3) var(--space-5);
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.68rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--wiki-strong-2);
}

.wiki-notice p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--wiki-text);
}

/* Link lists: the wiki workhorse. */
.wiki-list {
  list-style: disc;
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--wiki-text);
}

.wiki-list li::marker {
  color: var(--wiki-text-faint);
}

.wiki-list a {
  color: var(--wiki-link);
  font-weight: var(--font-weight-medium);
}

.wiki-list a:hover {
  color: var(--wiki-link-hover);
}

.wiki-list span {
  color: var(--wiki-text-dim);
}

.wiki-list--dated b {
  font-weight: var(--font-weight-bold);
}

.wiki-panel-more {
  margin: var(--space-4) 0 0 0;
  text-align: right;
  font-size: var(--font-size-sm);
}

.wiki-panel-more a {
  color: var(--wiki-link);
  font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   Placeholder artwork
   Nine gradient fills stand in for the screenshots a real wiki would use.
   Swapping one for a background-image is the only change needed to drop real
   art in; the aspect ratios live on the containers.
   -------------------------------------------------------------------------- */

.wiki-art--1 { background: linear-gradient(135deg, #4a3a86, #221d44); }
.wiki-art--2 { background: linear-gradient(135deg, #2f5f7a, #1c2a4d); }
.wiki-art--3 { background: linear-gradient(135deg, #a06a3c, #4a2f52); }
.wiki-art--4 { background: linear-gradient(135deg, #7a4a8f, #2a1f4d); }
.wiki-art--5 { background: linear-gradient(135deg, #3d7a5a, #1d3a44); }
.wiki-art--6 { background: linear-gradient(135deg, #8a6a3a, #3a2a4a); }
.wiki-art--7 { background: linear-gradient(135deg, #5a5aa0, #23204a); }
.wiki-art--8 { background: linear-gradient(135deg, #9a5570, #3a2246); }
.wiki-art--9 { background: linear-gradient(135deg, #4a7a9a, #22254a); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.wiki-footer {
  padding: var(--space-8) var(--wiki-gutter) var(--space-12);
  background: var(--wiki-footer-bg);
  font-size: var(--font-size-xs);
  color: var(--wiki-text-faint);
}

.wiki-footer p {
  max-width: 70ch;
  margin: 0 0 var(--space-2) 0;
  line-height: var(--line-height-normal);
}

.wiki-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: var(--space-4) 0 0 0;
  padding: 0;
}

.wiki-footer-links a {
  color: var(--wiki-text-dim);
}

/* --------------------------------------------------------------------------
   Rail toggle, shown only at narrow widths
   -------------------------------------------------------------------------- */

.wiki-rail-toggle {
  display: none;
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 50;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--wiki-border);
  border-radius: var(--radius-full);
  background: var(--wiki-accent);
  color: var(--wiki-on-fill);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   Responsive steps
   Each breakpoint removes one column from the widest grid on the page, in
   the order the content can most afford to lose it.
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .wiki-search input {
    width: 200px;
  }
}

@media (max-width: 1200px) {
  .wiki-portals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .wiki-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-rail-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wiki-notice {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .wiki-features {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-welcome {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }
  .wiki-banner {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-banner-art {
    aspect-ratio: 21 / 9;
  }
  .wiki-skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* Below this width the rail leaves the flow and becomes a drawer, which is
     the only honest way to keep a 168px column usable. This is the one place
     the rail is fixed and scrolls on its own, so the scrollbar rules live
     here too: on top of the content it has no seam to break. */
  .wiki-layout {
    display: block;
  }
  .wiki-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--wiki-rail-bg);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--wiki-border) transparent;
  }
  .wiki-rail::-webkit-scrollbar {
    width: 6px;
  }
  .wiki-rail::-webkit-scrollbar-thumb {
    background: var(--wiki-border);
    border-radius: var(--radius-full);
  }
  .wiki-rail::-webkit-scrollbar-track {
    background: transparent;
  }
  .wiki-rail.is-open {
    transform: translateX(0);
  }
  .wiki-rail-toggle {
    display: grid;
  }
  .wiki-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-4) 0;
  }
  .wiki-search {
    flex: 1 1 100%;
    margin-left: 0;
  }
  .wiki-search input {
    width: 100%;
  }
  .wiki-page {
    --wiki-masthead-height: 190px;
  }
  .wiki-portals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wiki-rail-right {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-main {
    padding: var(--space-6) var(--space-4) var(--space-12);
  }
  .wiki-footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

@media (max-width: 520px) {
  .wiki-skill-grid,
  .wiki-portals {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiki-welcome h1 {
    font-size: var(--font-size-2xl);
  }
}
