/* ==========================================================================
   Big Walk Wiki — visual system
   A game wiki first: dark ground, key art hero, countable stats, tagged cards.
   The dark tones are sampled from the game's own night-campsite scene, so the
   shell reads as Big Walk rather than as generic dark mode.
   ========================================================================== */

:root {
  /* Night camp — sampled from the game */
  --ink: #0b0914;
  --ink-2: #121327;
  --card: #181a33;
  --card-hi: #212349;
  --line: rgba(226, 230, 255, 0.12);
  --line-hi: rgba(226, 230, 255, 0.26);

  --text: #eceaf5;
  --text-soft: #a6a6c2;
  --text-dim: #8484a1;

  /* House House's logo circles, lifted for a dark ground */
  --gold: #f5b52c;
  --cobalt: #5590e0;
  --rust: #e56a44;
  --green: #46b87c;
  --violet: #9a7ae0;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --band-pad: clamp(56px, 8vw, 104px);

  --measure: 72ch;
  --radius: 12px;
  --radius-sm: 8px;
}

/* --------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

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

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

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

a {
  color: var(--gold);
  text-underline-offset: 0.18em;
}

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

/* Utility voice: versions, dates, counts, labels */
.eyebrow,
.stat-label,
.breadcrumb,
.gallery-credit,
.site-nav a,
.footer-grid h4,
.card-badge,
.status-pill {
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 9, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: var(--s3) 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

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

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--s1);
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(226, 230, 255, 0.07);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--text);
  color: var(--ink);
}

/* -------------------------------------------------------------- bands */

.section,
.band {
  padding: var(--band-pad) 0;
  position: relative;
}

.band--ink,
.section {
  background: var(--ink);
}

.band--alt,
.section-alt {
  background: var(--ink-2);
}

.band-head {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto var(--s8);
}

.section h2,
.band h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  margin-bottom: var(--s4);
}

.section-desc {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 66ch;
  margin-bottom: var(--s7);
}

.band-head .section-desc {
  max-width: none;
  margin-bottom: 0;
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(72px, 10vw, 132px) 0 clamp(56px, 7vw, 92px);
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(11, 9, 20, 0.52) 0%, rgba(11, 9, 20, 0.76) 52%, rgba(11, 9, 20, 0.96) 100%),
    url("/img/hero-bg.jpg");
  background-size: cover;
  background-position: center 58%;
}

@supports (background-image: image-set(url("/img/hero-bg.webp") type("image/webp"))) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(11, 9, 20, 0.52) 0%, rgba(11, 9, 20, 0.76) 52%, rgba(11, 9, 20, 0.96) 100%),
      image-set(
        url("/img/hero-bg.webp") type("image/webp"),
        url("/img/hero-bg.jpg") type("image/jpeg"));
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
}

/* Live status: says the wiki is current before anyone reads a word. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(245, 181, 44, 0.4);
  background: rgba(245, 181, 44, 0.12);
  color: var(--gold);
  margin-bottom: var(--s6);
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(70, 184, 124, 0.25);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--s5);
}

.hero h1 .h1-sub {
  display: block;
  color: var(--gold);
}

.hero .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-soft);
  max-width: 60ch;
  margin: 0 auto var(--s7);
}

.cta-row {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease,
    color 140ms ease, box-shadow 200ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-primary:hover {
  background: var(--text);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(245, 181, 44, 0.3);
}

.btn-secondary {
  border-color: rgba(245, 181, 44, 0.55);
  color: var(--gold);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 26px rgba(245, 181, 44, 0.28);
}

.badge {
  display: inline-block;
  padding: var(--s1) var(--s3);
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s5);
}

/* Countable game content — the clearest signal that this is a game wiki. */
.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s4);
  max-width: 800px;
  margin: var(--s8) auto 0;
}

.stat-card {
  background: rgba(24, 26, 51, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5) var(--s3);
  backdrop-filter: blur(6px);
}

.stat-num {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
}

.stat-label {
  display: block;
  margin-top: var(--s2);
  color: var(--text-dim);
}

/* Signature: overheard chatter that only resolves near your pointer —
   the game's proximity voice, rendered as typography. */
.chatter {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.chatter-line {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(0.9rem, 1.15vw, 1.15rem);
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 2px 14px rgba(11, 9, 20, 0.9);
  opacity: 0.13;
  transition: opacity 260ms ease-out;
  will-change: opacity;
}

.chatter-hint {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s7);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.chatter-hint::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

/* --------------------------------------------------------- guide cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: var(--s4);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  transition: border-color 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

.card:hover {
  background: var(--card-hi);
  border-color: var(--line-hi);
  transform: translateY(-3px);
}

.card-emoji {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
  margin-bottom: var(--s4);
}

/* Every badge carries a real fact: a count, a platform scope, a patch. */
.card-badge {
  position: absolute;
  top: var(--s5);
  right: var(--s5);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  background: rgba(226, 230, 255, 0.1);
  color: var(--text-soft);
}

.card-badge--gold { background: rgba(245, 181, 44, 0.18); color: var(--gold); }
.card-badge--cobalt { background: rgba(85, 144, 224, 0.2); color: var(--cobalt); }
.card-badge--rust { background: rgba(229, 106, 68, 0.2); color: var(--rust); }
.card-badge--green { background: rgba(70, 184, 124, 0.2); color: var(--green); }
.card-badge--violet { background: rgba(154, 122, 224, 0.2); color: var(--violet); }

.card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--s3);
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card:hover h3 a {
  color: var(--gold);
}

.card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: var(--s5);
}

/* ------------------------------------------------- full-width card */

/* Thirteen cards into four columns leaves one alone on its own row looking like
   a mistake. Spanning the last one turns that remainder into emphasis, and this
   is the card that earns it — it is the page that rewrites itself every day.
   Declared after .card so its flex-direction is the one that wins; both
   selectors carry the same specificity, so order is the whole argument. */

.card--wide {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .card--wide {
    flex-direction: row;
    align-items: center;
    gap: var(--s5);
  }
  .card--wide .card-emoji,
  .card--wide h3,
  .card--wide p,
  .card--wide .card-more {
    margin: 0;
  }
  .card--wide h3 { flex: 0 0 auto; }
  .card--wide p { flex: 1; max-width: 60ch; }
  .card--wide .card-more { margin-left: auto; white-space: nowrap; }
  .card--wide .card-badge { position: static; }
}

.card-more {
  margin-top: auto;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------ chip row */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: center;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-soft);
  font-size: 0.85rem;
  text-decoration: none;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ------------------------------------------------------- article pages */

.breadcrumb {
  padding: var(--s5) 0 0;
  color: var(--text-dim);
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

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

.page-head {
  padding: var(--s7) 0 var(--s6);
}

.page-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: var(--s5);
  max-width: 20ch;
}

.page-head > p {
  font-size: 1.12rem;
  color: var(--text-soft);
  max-width: var(--measure);
}

.page-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.75;
  color: var(--text-dim);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}

.article-body {
  max-width: var(--measure);
  padding: var(--s6) 0 var(--s9);
}

.band .article-body,
.section .article-body {
  padding: 0;
}

.article-body h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin: var(--s9) 0 var(--s4);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.article-body > h2:first-of-type {
  margin-top: var(--s5);
}

.article-body h3 {
  font-size: 1.22rem;
  margin: var(--s7) 0 var(--s3);
}

.article-body p {
  margin: var(--s4) 0;
  color: var(--text-soft);
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body ul,
.article-body ol {
  margin: var(--s5) 0;
  padding-left: var(--s5);
  color: var(--text-soft);
}

.article-body li {
  margin: var(--s3) 0;
  padding-left: var(--s2);
}

.article-body li::marker {
  color: var(--gold);
}

.article-body q {
  font-style: italic;
  color: var(--text);
}

/* ------------------------------------------------------------- tables */

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s6) 0;
  font-size: 0.92rem;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

.article-body th {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: var(--s3) var(--s4);
  background: rgba(226, 230, 255, 0.07);
  color: var(--gold);
  font-weight: 400;
}

.article-body td {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  vertical-align: top;
}

.article-body tbody tr:hover td {
  background: rgba(226, 230, 255, 0.04);
}

/* ----------------------------------------------------------- callouts */

.callout {
  background: rgba(85, 144, 224, 0.1);
  border: 1px solid rgba(85, 144, 224, 0.3);
  border-left: 4px solid var(--cobalt);
  border-radius: var(--radius-sm);
  padding: var(--s5);
  margin: var(--s6) 0;
}

.callout.warn {
  background: rgba(229, 106, 68, 0.1);
  border-color: rgba(229, 106, 68, 0.32);
  border-left-color: var(--rust);
}

.callout p {
  margin: var(--s2) 0;
  color: var(--text-soft);
}

.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- FAQ */

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  margin-bottom: var(--s3);
}

.faq-item h3 {
  font-size: 1.08rem;
  margin-bottom: var(--s2);
}

.faq-item p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* ------------------------------------------------------ images, media */

.article-figure {
  margin: var(--s8) 0;
  width: min(940px, calc(100vw - 96px));
}

.article-figure picture,
.gallery-grid picture {
  display: block;
}

.article-figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.article-figure figcaption,
.gallery-grid figcaption {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: var(--s3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}

.gallery-grid figure {
  margin: 0;
}

.gallery-grid img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: transform 200ms ease, border-color 200ms ease;
}

.gallery-grid figure:hover img {
  transform: scale(1.015);
  border-color: var(--line-hi);
}

.gallery-credit {
  margin-top: var(--s6);
  color: var(--text-dim);
  text-align: center;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  padding: var(--s9) 0 var(--s7);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s7);
  margin-bottom: var(--s8);
}

.footer-grid h4 {
  color: var(--gold);
  margin-bottom: var(--s4);
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin: var(--s2) 0;
}

.footer-grid a {
  color: var(--text-soft);
  text-decoration: none;
}

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

.footer-disclaimer {
  border-top: 1px solid var(--line);
  padding-top: var(--s5);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 88ch;
}

.footer-disclaimer p {
  margin: var(--s2) 0;
}

/* ---------------------------------------------------------------- 404 */

.error-page {
  padding: var(--s9) 0;
  text-align: center;
}

.error-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--s5);
}

.error-page h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin-bottom: var(--s5);
}

.error-page p {
  color: var(--text-soft);
  max-width: 52ch;
  margin: 0 auto var(--s6);
  font-size: 1.1rem;
}

/* --------------------------------------------------------- responsive */

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

  /* No room to keep the chatter clear of the copy — and with it gone, the
     line telling you to move your cursor would be describing nothing. */
  .chatter,
  .chatter-hint {
    display: none;
  }
}

@media (max-width: 820px) {
  .header-inner {
    gap: var(--s3);
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav ul {
    flex-wrap: nowrap;
  }

  .site-nav a {
    white-space: nowrap;
    padding: var(--s2);
  }

  .header-cta {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .card-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chatter-line {
    opacity: 0.16;
  }
}
