/* =====================================================================
   PvRust 2.0 changelog - Rust in-game UI styling
   Palette is anchored on the two server colours: #CD412B and #1E2020.
   ===================================================================== */

:root {
  /* --- core palette ------------------------------------------------ */
  --rust:        #CD412B;
  --rust-hot:    #E5533A;
  --rust-deep:   #8E2A1B;
  --ink:         #1E2020;

  --bg:          #1E2020;
  --bg-deep:     #171919;
  --bg-band:     #222525;
  --panel:       #262A29;
  --panel-hi:    #2E3231;
  --line:        #3A3F3E;
  --line-soft:   #303534;

  /* --- text --------------------------------------------------------- */
  --text:        #E6E3DE;
  --text-dim:    #A5A9A6;
  --text-faint:  #74807B;
  --perk-new:    #A9E081;   /* rank perks a tier adds over the one below */

  /* --- era accents (mirrors the in-game era colours) ---------------- */
  --era-beginnings: #6E7671;
  --era-historical: #9A8259;
  --era-current:    #5C81ED;
  --era-new:        var(--rust);

  /* --- geometry ----------------------------------------------------- */
  --wrap:        1240px;
  --radius:      3px;   /* Rust UI is almost square - keep it tight */
  --topbar-h:    58px;

  --font-head: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-ui:   "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--rust-hot); }

:focus-visible {
  outline: 2px solid var(--rust-hot);
  outline-offset: 2px;
}

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.wrap--narrow { max-width: 720px; }

/* =====================================================================
   Scroll progress + top bar
   ===================================================================== */

/* The track is opaque on purpose: at 50% black, page content scrolling behind
   this 3px strip showed through it as a moving sliver above the top bar. */
.scrollbar {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: var(--bg-deep);
}
.scrollbar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--rust-deep), var(--rust-hot));
  transition: width .1s linear;
}

.topbar {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 24px;
  padding-inline: 24px;
  background: rgba(23,25,25,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
}
.topbar.is-stuck {
  background: rgba(23,25,25,.96);
  border-bottom-color: var(--line-soft);
}

.topbar__brand {
  color: var(--text); text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
}
/* Square by design - drop a 1:1 SVG in and it needs no other change. */
.topbar__logo {
  width: 36px; height: 36px; flex: none;
  border-radius: var(--radius);
  object-fit: contain;
}
.topbar__ver {
  font-style: normal; font-size: 12px; letter-spacing: .12em;
  padding: 2px 6px; border: 1px solid var(--rust);
  color: var(--rust-hot); border-radius: var(--radius);
}

.topbar__nav { display: flex; gap: 4px; margin-left: auto; }
.topbar__nav a {
  font-family: var(--font-ui);
  font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none;
  padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: color .18s, background .18s, border-color .18s;
}
.topbar__nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.topbar__nav a.is-active {
  color: var(--rust-hot);
  border-color: rgba(205,65,43,.45);
  background: rgba(205,65,43,.10);
}

/* =====================================================================
   Language switch
   ===================================================================== */

.langswitch {
  display: flex; gap: 2px; margin-left: 18px; flex: none;
  padding: 2px; border-radius: var(--radius);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line-soft);
}
.langswitch__btn {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 11px; letter-spacing: .12em;
  padding: 5px 10px; cursor: pointer;
  color: var(--text-faint); background: transparent;
  border: none; border-radius: var(--radius);
  transition: color .18s, background .18s;
}
.langswitch__btn:hover { color: var(--text); }
.langswitch__btn.is-active {
  color: #fff; background: var(--rust);
}

.topbar__menu {
  display: none; margin-left: auto;
  width: 40px; height: 34px; padding: 8px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.topbar__menu span {
  display: block; height: 2px; background: var(--text); margin: 3px 0;
  transition: transform .2s, opacity .2s;
}
.topbar__menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.topbar__menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topbar__menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* =====================================================================
   Hero
   ===================================================================== */

.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(var(--topbar-h) + 64px) 24px 96px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(205,65,43,.16), transparent 62%),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: -20%; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 55% at 50% 42%, #000 30%, transparent 100%);
}
.hero__inner { max-width: 880px; }

.hero__eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase; letter-spacing: .34em;
  font-size: 12px; color: var(--text-faint); margin: 0 0 24px;
}

.hero__title { margin: 0 0 28px; line-height: .86; }
.hero__title-sm,
.hero__title-lg { display: block; font-family: var(--font-head); font-weight: 700; }
.hero__title-sm {
  font-size: clamp(20px, 3vw, 34px); letter-spacing: .5em;
  color: var(--text-faint); text-indent: .5em; margin-bottom: 10px;
}
.hero__title-lg {
  font-size: clamp(58px, 12.5vw, 168px);
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fff 10%, var(--rust) 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--rust);
}

.hero__lead {
  max-width: 640px; margin: 0 auto 36px;
  font-size: 17.5px; color: var(--text-dim);
}

.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin: 64px 0 0;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
}
.hero__stats > div { background: rgba(30,32,32,.9); padding: 20px 12px; }
.hero__stats dt {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(28px, 4vw, 42px); line-height: 1; color: var(--rust-hot);
}
.hero__stats dd {
  margin: 8px 0 0; font-family: var(--font-ui);
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint);
}

.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid var(--line);
  border-radius: 14px; display: grid; place-items: start center; padding-top: 7px;
}
.hero__scroll span {
  width: 3px; height: 8px; border-radius: 2px; background: var(--rust);
  animation: scroll-dot 1.7s ease-in-out infinite;
}
@keyframes scroll-dot {
  0%,100% { transform: translateY(0); opacity: 1; }
  60%     { transform: translateY(12px); opacity: 0; }
}

/* =====================================================================
   Buttons
   ===================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  padding: 13px 26px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s, color .18s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--rust); color: #fff; border-color: var(--rust-hot);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.btn--primary:hover { background: var(--rust-hot); }
.btn--ghost {
  border-color: var(--line); color: var(--text-dim); background: rgba(255,255,255,.02);
}
.btn--ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn--lg { padding: 17px 38px; font-size: 14px; }

/* =====================================================================
   Bands / shared section furniture
   ===================================================================== */

.band { padding: 96px 0; border-top: 1px solid var(--line-soft); }
.band--intro { background: var(--bg-band); }
.band--timeline { padding: 72px 0; background: var(--bg-deep); }
.band--retexture { background: var(--bg-band); }
.band--wiki { background: var(--bg-deep); }

.kicker {
  font-family: var(--font-ui);
  text-transform: uppercase; letter-spacing: .26em; font-size: 11.5px;
  color: var(--rust); margin: 0 0 14px;
}
.band__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.06;
  margin: 0 0 28px; letter-spacing: .01em;
}

.prose { max-width: 720px; color: var(--text-dim); }
.prose p { margin: 0 0 18px; }
.prose--lead { font-size: 17.5px; }
.prose code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .9em; padding: 2px 6px; border-radius: var(--radius);
  background: rgba(255,255,255,.06); color: #D1FF7E;
}

/* =====================================================================
   Era legend
   ===================================================================== */

.legend {
  margin-top: 44px; padding: 26px 28px;
  border: 1px solid var(--line-soft); border-left: 3px solid var(--rust);
  border-radius: var(--radius); background: rgba(0,0,0,.22);
  max-width: 860px;
}
.legend__title {
  font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: .18em; font-size: 12px; color: var(--text);
  margin: 0 0 8px;
}
.legend__hint { margin: 0 0 20px; color: var(--text-dim); font-size: 15px; }
.legend__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend__list li { display: flex; align-items: center; gap: 12px; }
.legend__swatch {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
.legend__name {
  font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: .13em; font-size: 12.5px; color: var(--text);
  min-width: 148px;
}
.legend__years { font-size: 13.5px; color: var(--text-faint); }

/* =====================================================================
   Timeline
   ===================================================================== */

.timeline {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 2px;
  background: linear-gradient(90deg, var(--era-beginnings), var(--era-historical),
              var(--era-current), var(--rust));
  opacity: .45;
}
.timeline li { position: relative; padding: 34px 18px 0 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-deep); border: 3px solid var(--c);
}
.timeline__year {
  font-family: var(--font-head); font-weight: 700; font-size: 22px;
  color: var(--c); line-height: 1.1;
}
.timeline__name {
  font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: .14em; font-size: 12px; color: var(--text); margin-top: 4px;
}
.timeline__note { font-size: 13.5px; color: var(--text-faint); margin-top: 6px; }

/* =====================================================================
   Chapters
   ===================================================================== */

.chapter { padding: 104px 0 40px; border-top: 1px solid var(--line-soft); }
.chapter__head { margin-bottom: 56px; }
.chapter__index {
  font-family: var(--font-head); font-weight: 700;
  font-size: 13px; letter-spacing: .3em; color: var(--rust);
  display: block; margin-bottom: 10px;
}
.chapter__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(32px, 5vw, 60px); line-height: 1; margin: 0 0 14px;
}
.chapter__lead { max-width: 620px; color: var(--text-dim); margin: 0; }

/* =====================================================================
   Feature card
   ===================================================================== */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 44px; align-items: start;
  padding: 44px 0;
  border-top: 1px solid var(--line-soft);
}
/* Skipping render work for off-screen cards keeps a ~24000px page smooth, but
   only once the reserved height is EXACT - a guessed value makes the scrollbar
   grow and shrink while you scroll. So this is switched on per card by JS,
   after its real height has been measured. */
.feature.is-measured {
  content-visibility: auto;
  contain-intrinsic-size: auto var(--cv-h);
}
.feature:first-of-type { border-top: none; }
.feature--noshot { grid-template-columns: minmax(0, 1fr); }

.feature__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.feature__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.08; margin: 0;
}
.tag {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius); border: 1px solid;
}
.tag--new { color: #fff; background: var(--rust); border-color: var(--rust-hot); }
.tag--reworked { color: var(--text-dim); border-color: var(--line); background: rgba(255,255,255,.03); }

.feature__body { color: var(--text-dim); font-size: 15.5px; }
.feature__body p { margin: 0 0 14px; }
.feature__note {
  margin-top: 18px; padding-left: 14px;
  border-left: 2px solid var(--rust-deep);
  color: var(--text-faint); font-size: 14.5px;
}

/* --- icon strips ---------------------------------------------------- */
.iconset { margin-top: 24px; }
.iconset__label {
  font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: .18em; font-size: 10.5px; color: var(--text-faint);
  margin: 0 0 10px;
}
.iconset__grid { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.iconset__cell {
  margin: 0; width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.iconset__cap {
  font-family: var(--font-ui); font-size: 10px; line-height: 1.25;
  letter-spacing: .06em; color: var(--text-faint); text-align: center;
  text-transform: uppercase;
}
.iconset__item {
  position: relative;
  width: 62px; height: 62px; padding: 7px;
  display: grid; place-items: center;
  background:
    radial-gradient(70% 70% at 50% 35%, rgba(255,255,255,.07), transparent 70%),
    var(--panel);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: border-color .18s, transform .18s, background .18s;
}
.iconset__item:hover {
  border-color: var(--rust); transform: translateY(-2px);
  background: radial-gradient(70% 70% at 50% 35%, rgba(205,65,43,.18), transparent 70%), var(--panel-hi);
}
.iconset__item img { width: 100%; height: 100%; object-fit: contain; }
.iconset--old .iconset__item { opacity: .58; filter: saturate(.55); }
.iconset--old .iconset__cell:hover .iconset__item { opacity: 1; filter: none; }

.iconset__new {
  position: absolute; top: -5px; right: -5px;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 8px; letter-spacing: .1em;
  padding: 2px 4px; border-radius: var(--radius);
  background: var(--rust); color: #fff;
  border: 1px solid var(--rust-hot);
}

/* =====================================================================
   Rank breakdown
   ===================================================================== */

.ranks {
  margin-top: 30px; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.rank {
  padding: 18px 18px 20px;
  background: rgba(255,255,255,.022);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--rust-deep);
  border-radius: var(--radius);
}
.rank__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rank__badge {
  width: 46px; height: 46px; flex: none; padding: 5px;
  display: grid; place-items: center;
  background: radial-gradient(70% 70% at 50% 35%, rgba(255,255,255,.08), transparent 72%), var(--panel);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.rank__badge img { width: 100%; height: 100%; object-fit: contain; }
.rank__titles { min-width: 0; }
.rank__nameline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rank__name {
  margin: 0; font-family: var(--font-head); font-weight: 700;
  font-size: 20px; letter-spacing: .04em; color: var(--text);
}
.rank__tag {
  display: block; margin-top: 1px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px; color: var(--rust-hot); letter-spacing: .06em;
}
.rank__how {
  margin: 0 0 14px; font-size: 12.5px; color: var(--text-faint);
  line-height: 1.45;
}
/* collapsed preview - roughly half a Supporter card, faded at the cut */
.rank__body {
  position: relative;
  max-height: 260px; overflow: hidden;
  mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
}
.ranks.is-open .rank__body {
  max-height: none; overflow: visible;
  mask-image: none; -webkit-mask-image: none;
}
.ranksblock { margin-top: 30px; }
.ranksblock .ranks { margin-top: 0; }
.rank__more {
  display: block; margin: 12px auto 0; padding: 10px 26px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: color .18s, background .18s, border-color .18s;
}
.rank__more:hover {
  color: #fff; background: var(--rust); border-color: var(--rust-hot);
}

.rank__group {
  font-family: var(--font-ui); text-transform: uppercase;
  letter-spacing: .18em; font-size: 9.5px; color: var(--rust);
  margin: 14px 0 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.rank__perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
/* "=" lines are perks carried over from the tier below. They were dark enough
   to read as missing, so they sit at normal body grey - present, just quiet. */
.rank__perks li {
  font-size: 12.5px; line-height: 1.4; color: var(--text-dim);
  display: flex; gap: 7px; align-items: baseline;
}
/* "+" lines are what this tier actually adds, called out in green */
.rank__perks li.is-up { color: var(--perk-new); }
.rank__mark {
  flex: none; width: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  color: var(--text-faint);
}
.rank__perks li.is-up .rank__mark { color: var(--perk-new); }

/* =====================================================================
   Era viewer - the screenshot stage
   ===================================================================== */

.viewer { min-width: 0; }

.viewer__tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px;
}
.viewer__tab {
  font-family: var(--font-ui); font-weight: 600;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 7px 12px; cursor: pointer;
  color: var(--text-faint); background: rgba(255,255,255,.025);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
}
.viewer__tab:hover { color: var(--text); background: rgba(255,255,255,.06); }
.viewer__tab.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  border-bottom-color: var(--c);
}
.viewer__tab small {
  display: block; font-size: 9.5px; letter-spacing: .1em;
  color: var(--text-faint); font-weight: 400; margin-top: 1px;
}

/* The stage keeps one constant 16:9 box no matter what goes in it, so the
   page never reflows as frames swap. Small crops sit centred at their own
   native size on a blurred copy of themselves - no upscaling, no blur on
   the actual pixels. */
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  cursor: zoom-in;
}
.stage__frame {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease;
}
.stage__frame.is-active { opacity: 1; visibility: visible; }

/* blurred backdrop derived from the frame itself */
.stage__bg {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  /* the source is already a ~40px thumbnail scaled up, so it arrives soft -
     a small radius finishes the job for a fraction of the GPU cost */
  filter: blur(12px) saturate(.65) brightness(.42);
  transform: scale(1.08);
}
.stage__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 70% at 50% 45%, transparent 30%, rgba(0,0,0,.72));
}

/* scale-down = contain, but never past the image's own pixel size. Big
   screenshots shrink to fit the stage; small crops (some are only 548px
   wide) render 1:1 on the blurred backdrop instead of being stretched. */
.stage__img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: scale-down;
  object-position: center;
}
/* drop-shadow follows the painted pixels, not the element box, so a small
   letterboxed image still gets an edge that hugs it. */
.stage__frame--small .stage__img {
  filter: drop-shadow(0 0 1px rgba(255,255,255,.22))
          drop-shadow(0 16px 40px rgba(0,0,0,.65));
}

/* era badge burned into the corner of every frame */
.stage__badge {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px 7px 11px;
  background: rgba(10,11,11,.84);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-left: 3px solid var(--c);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.stage__badge b {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--c);
}
.stage__badge span {
  font-family: var(--font-ui); font-size: 11px;
  letter-spacing: .1em; color: var(--text-faint);
  padding-left: 9px; border-left: 1px solid var(--line);
}

/* gallery arrows */
.stage__nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 4;
  width: 40px; height: 56px; padding: 0;
  font-size: 26px; line-height: 1; font-family: var(--font-head);
  color: var(--text); cursor: pointer;
  background: rgba(10,11,11,.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s, background .18s, border-color .18s;
}
/* Arrows belong to manual mode - while the sweep runs they would just
   compete with it, so they only appear once auto is switched off. */
.viewer.is-manual .stage__nav { opacity: .75; visibility: visible; }
.viewer.is-manual .stage:hover .stage__nav,
.viewer.is-manual .stage__nav:focus-visible { opacity: 1; }
.stage__nav:hover { background: var(--rust); border-color: var(--rust-hot); }
.stage__nav--prev { left: 10px; }
.stage__nav--next { right: 10px; }

.stage__caption {
  margin: 9px 0 0;
  font-family: var(--font-ui); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim);
}

/* info bubble, top-right of the stage */
.stage__info { position: absolute; top: 10px; right: 10px; z-index: 5; }
.stage__info-btn {
  width: 28px; height: 28px; padding: 0; cursor: help;
  display: grid; place-items: center;
  color: var(--text-dim);
  background: rgba(10,11,11,.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color .18s, border-color .18s, background .18s;
}
.stage__info-btn svg { width: 16px; height: 16px; display: block; }
.stage__info:hover .stage__info-btn,
.stage__info.is-open .stage__info-btn {
  color: #fff; background: var(--rust); border-color: var(--rust-hot);
}
.stage__info-text {
  position: absolute; top: 32px; right: 0;
  width: max-content; max-width: 270px;
  padding: 10px 12px;
  font-family: var(--font-ui); font-size: 12px; line-height: 1.45;
  letter-spacing: .03em; color: var(--text);
  background: rgba(10,11,11,.94);
  border: 1px solid var(--line);
  border-left: 2px solid var(--rust);
  border-radius: var(--radius);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
  pointer-events: none;
}
.stage__info:hover .stage__info-text,
.stage__info-btn:focus-visible + .stage__info-text,
.stage__info.is-open .stage__info-text {
  opacity: 1; visibility: visible; transform: none;
}

.stage__zoom {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  font-family: var(--font-ui); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint);
  background: rgba(10,11,11,.7); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 5px 10px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.stage:hover .stage__zoom { opacity: 1; }

/* auto-advance progress ticks */
.viewer__ticks { display: flex; gap: 4px; margin-top: 8px; align-items: center; }
.tick {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--line-soft); overflow: hidden;
}
.tick i {
  display: block; height: 100%; width: 0;
  background: var(--c);
}
.tick.is-done i { width: 100%; }
.tick.is-running i { width: 100%; transition: width var(--dur) linear; }
/* AUTO / MANUAL toggle sitting at the end of the tick row */
.viewer__auto {
  font-family: var(--font-ui); font-weight: 700; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  margin-left: 10px; white-space: nowrap; cursor: pointer;
  padding: 3px 8px; border-radius: var(--radius);
  color: var(--text-faint);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-soft);
  transition: color .18s, background .18s, border-color .18s;
}
.viewer__auto:hover { color: var(--text); border-color: var(--text-faint); }
.viewer__auto.is-off {
  color: #fff;
  background: var(--rust);
  border-color: var(--rust-hot);
}
.viewer__auto.is-off:hover { background: var(--rust-hot); }

/* extra supporting screenshots below the main stage */
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.extras figure { margin: 0; }
.extras img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  cursor: zoom-in; transition: border-color .18s;
}
.extras img:hover { border-color: var(--rust); }
.extras figcaption {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); margin-top: 6px;
}

/* =====================================================================
   Retexture before/after
   ===================================================================== */

.retexture__hint {
  font-family: var(--font-ui); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-faint); margin: 28px 0 14px;
}
.retexture {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.compare {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background:
    radial-gradient(70% 70% at 50% 35%, rgba(255,255,255,.06), transparent 72%),
    var(--panel);
  touch-action: none; cursor: ew-resize; user-select: none;
}
.compare img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 14%;
  pointer-events: none;
}
/* Both halves are clipped, not just the top one - these are transparent
   PNGs, so an unclipped layer underneath would show through the other. */
.compare__old { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.compare__new { clip-path: inset(0 0 0 var(--split, 50%)); }
.compare__line {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
  width: 2px; background: var(--rust); pointer-events: none;
  box-shadow: 0 0 12px rgba(205,65,43,.7);
}
.compare__line::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  translate: -50% -50%;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rust); border: 2px solid #fff;
}
.compare__tag {
  position: absolute; bottom: 7px; z-index: 2;
  font-family: var(--font-ui); font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--radius);
  background: rgba(10,11,11,.82); pointer-events: none;
  transition: opacity .15s;
}
.compare__tag--old { left: 7px; color: var(--text-faint); }
.compare__tag--new { right: 7px; color: var(--rust-hot); }
/* a label disappears with its half, so the visible version is unambiguous */
.compare__tag.is-hidden { opacity: 0; }

/* =====================================================================
   Smaller updates + wiki bar
   ===================================================================== */

.smaller {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.smaller li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; font-size: 15px; color: var(--text-dim);
  background: rgba(255,255,255,.022);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--rust-deep);
  border-radius: var(--radius);
}
.smaller li::before {
  content: "+"; flex: none;
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  line-height: 1.2; color: var(--rust);
}

.wikibar { margin-top: 36px; max-width: 640px; display: grid; gap: 12px; }
.wikibar__row { display: grid; grid-template-columns: 42px 1fr 48px; align-items: center; gap: 14px; }
.wikibar__label,
.wikibar__val {
  font-family: var(--font-ui); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint);
}
.wikibar__val { text-align: right; font-weight: 700; }
.wikibar__track { height: 12px; background: rgba(255,255,255,.05); border-radius: var(--radius); overflow: hidden; }
.wikibar__track i {
  display: block; height: 100%; width: 0;
  background: var(--line); border-radius: var(--radius);
  transition: width 1.1s cubic-bezier(.2,.7,.3,1);
}
.wikibar.is-shown .wikibar__track i { width: var(--pct); }
.wikibar__row--new .wikibar__track i { background: linear-gradient(90deg, var(--rust-deep), var(--rust-hot)); }
.wikibar__row--new .wikibar__val { color: var(--rust-hot); }

/* =====================================================================
   CTA + footer
   ===================================================================== */

.band--cta {
  text-align: center; padding: 120px 0;
  background:
    radial-gradient(90% 120% at 50% 100%, rgba(205,65,43,.20), transparent 62%),
    var(--bg-deep);
}
.cta__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(34px, 6vw, 68px); line-height: 1.02; margin: 0 0 16px;
}
.cta__lead { color: var(--text-dim); font-size: 18px; margin: 0 0 34px; }
.cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta__note { margin-top: 22px; }

.footer {
  padding: 40px 0; border-top: 1px solid var(--line-soft);
  font-family: var(--font-ui); font-size: 12.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint);
}
.footer p { margin: 0; }
.footer__muted { color: #4E5654; margin-top: 6px; }

/* =====================================================================
   How-to-connect dialog
   ===================================================================== */

.modal {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center; padding: 28px 20px;
  background: rgba(8,9,9,.9); backdrop-filter: blur(6px);
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal__panel {
  position: relative;
  width: min(100%, 880px);
  margin: auto;
  padding: 38px 40px 40px;
  background: var(--bg-band);
  border: 1px solid var(--line);
  border-top: 3px solid var(--rust);
  border-radius: var(--radius);
  box-shadow: 0 40px 90px rgba(0,0,0,.6);
}
.modal__close {
  position: absolute; top: 14px; right: 16px;
  width: 40px; height: 40px; font-size: 28px; line-height: 1;
  color: var(--text-dim); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.modal__close:hover { color: #fff; border-color: var(--rust); }
.modal__title {
  margin: 0 0 10px; font-family: var(--font-head); font-weight: 700;
  font-size: clamp(26px, 3.6vw, 38px); line-height: 1.05;
}
.modal__lead { margin: 0 0 28px; color: var(--text-dim); max-width: 60ch; }

.joinmethods {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.joinmethod {
  padding: 20px 22px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--rust-deep);
  border-radius: var(--radius);
}
.joinmethod__title {
  margin: 0 0 14px; font-family: var(--font-ui); font-weight: 700;
  font-size: 12px; letter-spacing: .18em; color: var(--rust-hot);
}
.joinmethod__steps {
  margin: 0; padding: 0; list-style: none; counter-reset: step;
  display: grid; gap: 11px;
}
.joinmethod__steps li {
  counter-increment: step;
  position: relative; padding-left: 30px;
  font-size: 14.5px; line-height: 1.5; color: var(--text-dim);
}
.joinmethod__steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--font-ui); font-weight: 700; font-size: 11px;
  color: var(--text); background: rgba(255,255,255,.07);
  border: 1px solid var(--line-soft);
}

.joincmd {
  display: flex; align-items: stretch; gap: 6px; margin-top: 8px;
  flex-wrap: wrap;
}
.joincmd code {
  flex: 1 1 auto; min-width: 0;
  padding: 9px 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px; color: #D1FF7E;
  background: rgba(0,0,0,.45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto; white-space: nowrap;
}
.joincmd__copy {
  flex: none; padding: 7px 16px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 10.5px; letter-spacing: .14em;
  color: var(--text-dim);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: color .18s, background .18s, border-color .18s;
}
.joincmd__copy:hover,
.joincmd__copy.is-done {
  color: #fff; background: var(--rust); border-color: var(--rust-hot);
}

@media (max-width: 620px) {
  .modal__panel { padding: 32px 20px 26px; }
}

/* =====================================================================
   Lightbox
   ===================================================================== */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 40px;
  background: rgba(8,9,9,.94); backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox__figure img {
  max-width: 100%; max-height: calc(100vh - 120px);
  width: auto; margin-inline: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.lightbox__figure figcaption {
  margin-top: 14px; font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim);
}
.lightbox__close {
  position: absolute; top: 18px; right: 22px;
  width: 44px; height: 44px; font-size: 30px; line-height: 1;
  color: var(--text-dim); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.lightbox__close:hover { color: #fff; border-color: var(--rust); }

/* =====================================================================
   Reveal on scroll
   ===================================================================== */

.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1);
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1080px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feature__media { order: -1; }
}

@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .band, .chapter { padding: 68px 0; }
  .topbar__menu { display: block; }
  .topbar__nav {
    position: fixed; inset: calc(var(--topbar-h) + 3px) 0 auto 0;
    flex-direction: column; gap: 0; margin: 0;
    padding: 8px 16px 16px;
    background: rgba(23,25,25,.98);
    border-bottom: 1px solid var(--line-soft);
    display: none;
  }
  .topbar__nav.is-open { display: flex; }
  .topbar__nav a { padding: 13px 8px; border-bottom: 1px solid var(--line-soft); }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr; gap: 22px; }
  .timeline::before {
    left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto;
    background: linear-gradient(180deg, var(--era-beginnings), var(--era-historical),
                var(--era-current), var(--rust));
  }
  .timeline li { padding: 0 0 0 30px; }
  .timeline li::before { top: 4px; }
  .extras { grid-template-columns: 1fr; }
  .lightbox { padding: 16px; }
}

@media (max-width: 520px) {
  .hero__stats { grid-template-columns: 1fr; }
  .viewer__tab { font-size: 10px; padding: 6px 9px; letter-spacing: .1em; }
  .iconset__item { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .stage__frame { transition: none; }
  .tick.is-running i { transition: none; }
  .hero__scroll span { animation: none; }
  .wikibar__track i { transition: none; }
}
