/* Another Shelf website — design system
   Ink and slate metal surfaces from the in-app R3 palette, square edges with crate-stencil corner marks,
   brass labels, one controlled oxide-red accent (primary action + focus). Type: Cabin (OFL), one family,
   condensed width for display headlines. */

@font-face {
  font-family: Cabin;
  src: url('/assets/fonts/cabin-latin-wdth-normal.woff2?v=f7a1210f72') format('woff2-variations');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Cabin;
  src: url('/assets/fonts/cabin-latin-ext-wdth-normal.woff2?v=c431624249') format('woff2-variations');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #14181b;
  --ink-deep: #0f1214;
  --slate: #1e252a;
  --slate-hi: #2a3137;
  --hairline: #333c42;
  --steel: #4a5359;
  --text: #e8eaeb;
  --muted: #a8adb2;
  --brass: #bfa67a;
  --brass-hi: #dcc79f;
  --red: #c4432d;
  --red-hi: #d9563e;
  --violet: #b890e0;
  --charge: #7fd3a4;
  --danger: #e99f9b;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 128px);
  --display: 'Cabin', system-ui, sans-serif;
  --mark: 10px;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--brass-hi);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 3px solid var(--red-hi);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}

h1,
h2 {
  font-stretch: 78%;
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2.5rem, 1.55rem + 3.9vw, 4.75rem);
  line-height: 1;
}

h2 {
  font-size: clamp(1.85rem, 1.3rem + 2.1vw, 3rem);
}

h3 {
  font-size: 1.3rem;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

.lede {
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.55;
  color: var(--text);
  max-width: 38em;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.skip:focus {
  top: 8px;
}

main {
  display: block;
}

main:focus {
  outline: none;
}

/* ---------------------------------------------------------------- icons */

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.i-lg {
  width: 28px;
  height: 28px;
}

.i-xl {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}

.i-trail {
  width: 16px;
  height: 16px;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--steel);
  border-bottom-width: 3px;
  background: var(--slate-hi);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: #343d44;
  color: var(--text);
}

.btn:active {
  border-bottom-width: 1px;
  transform: translateY(2px);
}

.btn-primary {
  background: var(--red);
  border-color: #8f2e1f;
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-hi);
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.btn-compact {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgb(233 159 155 / 0.12);
  color: var(--danger);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--brass-hi);
  text-decoration: none;
  min-height: 44px;
}

.text-link:hover {
  color: var(--text);
  text-decoration: underline;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(20 24 27 / 0.94);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
}

.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px var(--gutter);
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  font-stretch: 82%;
  letter-spacing: 0.01em;
}

.brand img {
  width: 36px;
  height: 36px;
}

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

.nav-main {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.nav-main a,
.menu-panel a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.nav-main a:hover,
.nav-main a[aria-current='page'] {
  color: var(--text);
}

.nav-main a[aria-current='page'] {
  box-shadow: inset 0 -3px 0 var(--red);
}

.bar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu {
  display: none;
  margin-left: auto;
}

.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--steel);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu .i-close,
.menu[open] .i-open {
  display: none;
}

.menu[open] .i-close {
  display: block;
}

.menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  display: grid;
  gap: 2px;
  padding: 12px var(--gutter) 24px;
  background: var(--ink-deep);
  border-bottom: 1px solid var(--steel);
}

.menu-panel a:not(.btn) {
  min-height: 52px;
  padding: 0 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 1.1rem;
  color: var(--text);
}

.menu-panel .btn {
  margin-top: 12px;
}

@media (max-width: 860px) {
  .nav-main,
  .bar-tools {
    display: none;
  }

  .menu {
    display: block;
  }
}

/* ---------------------------------------------------------------- layout helpers */

.hero-inner,
.loop-inner,
.chapter-inner,
.home-faq,
.download-inner,
.page-head,
.wiki-start,
.wiki-catalog,
.wiki-guide,
.wiki-questions,
.faq-layout,
.guide-wrap,
.catalog-wrap,
.legal-wrap,
.state-page,
.wiki-band-inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 32em;
}

/* Crate-stencil corner marks: the one decorative device, used on framed surfaces. */
.marked {
  position: relative;
}

.marked::before,
.marked::after {
  content: '';
  position: absolute;
  width: var(--mark);
  height: var(--mark);
  border: 2px solid var(--brass);
  pointer-events: none;
}

.marked::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.marked::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

/* ---------------------------------------------------------------- store state */

.store {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.store-slot {
  display: block;
}

/* Official badges, unmodified. Only the transparent padding inside the Google PNGs is trimmed so both
   badges show their artwork at the same 48 px height. */
.badge {
  display: block;
  height: 48px;
  overflow: hidden;
}

.badge img {
  display: block;
  max-width: none;
}

.badge-play-en {
  width: 161px;
}

.badge-play-en img {
  width: 184.6px;
  height: 71.4px;
  margin: -11.7px 0 0 -11.7px;
}

.badge-play-tr {
  width: 161.5px;
}

.badge-play-tr img {
  width: 161.5px;
  height: 62.5px;
  margin-top: -7.25px;
}

.badge-apple-en img {
  width: 143.6px;
  height: 48px;
}

.badge-apple-tr img {
  width: 181.5px;
  height: 48px;
}

.badge-link {
  display: block;
  border-radius: 8px;
}

.badge-link:hover {
  filter: brightness(1.15);
}

.store-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- phone mockup */

.phone {
  margin: 0;
  width: 100%;
  max-width: 300px;
  padding: 10px;
  background: #0b0d0e;
  border: 1px solid #3a4248;
  border-radius: 34px;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.45), inset 0 0 0 2px #1b2023;
}

.phone-screen {
  overflow: hidden;
  border-radius: 25px;
  background: var(--slate);
  aspect-ratio: 720 / 1522;
}

.phone-screen img {
  width: 100%;
}

/* ---------------------------------------------------------------- home: hero
   The depot at night: one work lamp over the shelf, crates dropping onto it, collection pieces floating out of
   the opened storage. Text is never animated (it is the first paint); motion lives on the stage only. */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-atmo {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(52% 60% at 74% 34%, rgb(220 199 159 / 0.17), transparent 70%),
    radial-gradient(36% 40% at 92% 96%, rgb(196 67 45 / 0.14), transparent 72%),
    radial-gradient(40% 50% at 6% 10%, rgb(74 83 89 / 0.35), transparent 70%),
    linear-gradient(180deg, #1a2024 0%, var(--ink) 92%);
}

.hero-atmo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.03) 0 1px, transparent 1px 96px);
  mask-image: linear-gradient(180deg, #000 10%, transparent 85%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(40px, 6vw, 96px);
  padding-bottom: clamp(56px, 7vw, 112px);
}

.hero h1 {
  margin-bottom: 28px;
  font-size: clamp(2.75rem, 1.4rem + 4.4vw, 5rem);
  font-stretch: 75%;
  line-height: 0.94;
  letter-spacing: -0.01em;
}

.hero h1 span {
  display: block;
}

.hero .lede {
  margin-bottom: 36px;
  max-width: 34em;
  color: #d4d7d9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  align-items: flex-start;
}

.hero-actions .btn {
  min-height: 48px;
}

.hero-stage {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 40px 0 0;
}

/* Work-lamp pool of light over the shelf. */
.hero-stage::before {
  content: '';
  position: absolute;
  inset: -80px -10% 10px;
  background: radial-gradient(48% 62% at 50% 8%, rgb(220 199 159 / 0.2), rgb(220 199 159 / 0.05) 55%, transparent 75%);
  pointer-events: none;
}

.hero-phone {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  justify-items: center;
  transform: translate3d(0, var(--py, 0px), 0);
}

.hero-phone .phone {
  max-width: 320px;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.hero-art li {
  position: absolute;
  width: clamp(64px, 8.5vw, 112px);
  transform: translate3d(0, var(--py, 0px), 0);
}

.hero-art span {
  display: block;
  padding: 5px;
  background: var(--slate);
  border: 1px solid var(--steel);
  box-shadow: 0 18px 30px rgb(0 0 0 / 0.5);
}

.hero-art-1 {
  top: 14%;
  left: 2%;
}

.hero-art-1 span {
  rotate: -8deg;
}

.hero-art-2 {
  top: 4%;
  right: 4%;
}

.hero-art-2 span {
  rotate: 6deg;
}

.hero-art-3 {
  top: 50%;
  right: 0;
}

.hero-art-3 span {
  rotate: -4deg;
}

.shelf {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(2px, 0.8vw, 8px);
  width: 100%;
  margin: -64px 0 0;
  padding: 0 4%;
  list-style: none;
}

.shelf::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  background: linear-gradient(#5b656c, #3a4248 30%, #252b2f);
  border-top: 1px solid #7a858c;
  box-shadow: 0 14px 24px rgb(0 0 0 / 0.5);
}

.shelf li {
  flex: 0 1 74px;
  min-width: 0;
}

.shelf img {
  width: 100%;
  filter: drop-shadow(0 6px 4px rgb(0 0 0 / 0.55));
}

@media (prefers-reduced-motion: no-preference) {
  .hero .shelf li {
    animation: crate-drop 560ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
  }

  .hero .shelf li:nth-child(2) { animation-delay: 70ms; }
  .hero .shelf li:nth-child(3) { animation-delay: 140ms; }
  .hero .shelf li:nth-child(4) { animation-delay: 210ms; }
  .hero .shelf li:nth-child(5) { animation-delay: 280ms; }
  .hero .shelf li:nth-child(6) { animation-delay: 350ms; }
  .hero .shelf li:nth-child(7) { animation-delay: 420ms; }

  /* Collection pieces lift out after the crates land, then drift slowly. */
  .hero-art span {
    animation:
      piece-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both,
      piece-drift 7s ease-in-out 1.4s infinite alternate;
  }

  .hero-art-1 span { animation-delay: 520ms, 1.4s; }
  .hero-art-2 span { animation-delay: 640ms, 2.2s; }
  .hero-art-3 span { animation-delay: 760ms, 3s; }
}

@keyframes crate-drop {
  from {
    opacity: 0;
    transform: translateY(-28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes piece-in {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.85);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes piece-drift {
  to {
    transform: translateY(-10px);
  }
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-phone .phone {
    max-width: 250px;
  }

  .hero-art-1 {
    top: 18%;
    left: 0;
  }

  .hero-art-3 {
    right: 2%;
  }

  @media (prefers-reduced-motion: no-preference) {
    .hero-art span {
      animation: piece-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
    }
  }
}

/* ---------------------------------------------------------------- home: loop */

.loop {
  position: relative;
  padding: var(--section) 0;
  background:
    linear-gradient(180deg, var(--ink), transparent 22%, transparent 78%, var(--ink)),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 48px),
    #181e22;
  border-top: 1px solid var(--hairline);
}

.loop-steps {
  position: relative;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 3px solid var(--steel);
}

/* Brass rail that draws across the steps when they come into view. */
.loop-steps::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--brass) 30%, var(--brass-hi));
  transform-origin: left;
}

.loop-steps li {
  counter-increment: step;
  position: relative;
  padding: 30px 24px 0 0;
}

.loop-steps li::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  width: 13px;
  height: 13px;
  background: var(--ink);
  border: 3px solid var(--brass);
}

.loop-steps li:first-child::after {
  background: var(--red);
  border-color: var(--red);
}

.loop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  background: var(--slate);
  border: 1px solid var(--steel);
  color: var(--brass-hi);
  transition: transform 220ms ease, border-color 220ms ease;
}

.loop-icon .i {
  width: 26px;
  height: 26px;
}

.loop-steps li:hover .loop-icon {
  transform: translateY(-3px);
  border-color: var(--brass);
}

.loop-steps h3 {
  margin-bottom: 8px;
  font-size: 1.45rem;
  font-stretch: 80%;
}

.loop-steps h3::before {
  content: counter(step) ' ';
  color: var(--brass);
}

.loop-steps p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .loop-steps {
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
    border-left: 3px solid var(--steel);
  }

  .loop-steps::before {
    top: 0;
    left: -3px;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--red), var(--brass) 30%, var(--brass-hi));
    transform-origin: top;
  }

  .loop-steps li {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 16px;
    padding: 0 0 28px 22px;
  }

  .loop-icon {
    grid-row: span 2;
    margin: 0;
  }

  .loop-steps li::after {
    top: 18px;
    left: -8px;
  }
}

/* ---------------------------------------------------------------- home: chapters
   One chapter per game system, each with its own light and surface (--tone, --atmo) on the shared ink base.
   Chapters fade into ink at both edges, so the page reads as walking from one room of the depot to the next. */

.chapters {
  position: relative;
}

.chapter {
  --tone: 168 173 178;
  --atmo: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(64px, 8vw, 120px) 0;
}

.chapter-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 70% at var(--light-x, 28%) 50%, rgb(var(--tone) / 0.13), transparent 70%),
    var(--ink);
}

.chapter-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--atmo);
  mask-image: radial-gradient(75% 80% at var(--light-x, 28%) 50%, #000 20%, transparent 78%);
}

.chapter-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--ink), transparent 20%, transparent 80%, var(--ink));
}

.chapter-flip .chapter-bg {
  --light-x: 72%;
}

.stencil {
  position: absolute;
  z-index: 0;
  top: clamp(12px, 2.5vw, 36px);
  left: -0.5vw;
  margin: 0;
  font-size: clamp(4.5rem, 2rem + 13vw, 15rem);
  font-weight: 700;
  font-stretch: 75%;
  line-height: 0.8;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(var(--tone) / 0.2);
  transform: translate3d(0, var(--py, 0px), 0);
  pointer-events: none;
  user-select: none;
}

.chapter-flip .stencil {
  left: auto;
  right: -1vw;
}

.chapter-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
}

.chapter-flip .chapter-media {
  order: 2;
}

.chapter-media {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
}

.chapter-light {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(140%, 560px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(var(--tone) / 0.3), transparent 62%);
  transform: translate(-50%, -50%);
}

.chapter-media .phone {
  max-width: 290px;
  border-color: rgb(var(--tone) / 0.45);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 500ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .chapter-media:hover .phone {
    transform: translateY(-8px) rotate(-1.2deg);
    box-shadow: 0 40px 70px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(var(--tone) / 0.5), inset 0 0 0 2px #1b2023;
  }

  .chapter-flip .chapter-media:hover .phone {
    transform: translateY(-8px) rotate(1.2deg);
  }
}

.chapter-copy {
  position: relative;
  z-index: 2;
  max-width: 34em;
}

.chapter-copy h3 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
  font-stretch: 76%;
  line-height: 0.98;
}

.chapter-copy > p:not(.system-tag, .chapter-more) {
  color: #d3d6d8;
  font-size: clamp(1.06rem, 1rem + 0.25vw, 1.18rem);
  line-height: 1.6;
}

.system-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 4px 10px 4px 8px;
  border-left: 3px solid var(--brass);
  background: rgb(191 166 122 / 0.1);
  color: var(--brass-hi);
  font-weight: 700;
  font-size: 0.95rem;
}

.system-tag .i {
  width: 18px;
  height: 18px;
}

.chapter .system-tag {
  border-left-color: rgb(var(--tone));
  background: rgb(var(--tone) / 0.12);
  color: rgb(var(--tone));
}

.chapter-copy h4 {
  margin: 24px 0 4px;
  font-size: 1rem;
  color: var(--muted);
}

.chapter-more {
  margin: 12px 0 0;
}

/* Tones: a light colour and a surface pattern per system. */
.chapter-storage {
  --tone: 150 170 184;
  --atmo: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.05) 0 2px, transparent 2px 16px);
}

.chapter-collections {
  --tone: 220 199 159;
  --atmo:
    linear-gradient(45deg, rgb(220 199 159 / 0.05) 25%, transparent 25% 75%, rgb(220 199 159 / 0.05) 75%) 0 0 / 56px 56px,
    linear-gradient(45deg, rgb(220 199 159 / 0.05) 25%, transparent 25% 75%, rgb(220 199 159 / 0.05) 75%) 28px 28px / 56px 56px;
}

.chapter-market {
  --tone: 127 211 164;
  --atmo: repeating-linear-gradient(0deg, rgb(127 211 164 / 0.07) 0 1px, transparent 1px 34px);
}

.chapter-black-market {
  --tone: 217 86 62;
  --atmo:
    radial-gradient(30% 40% at 20% 70%, rgb(196 67 45 / 0.22), transparent 70%),
    radial-gradient(35% 30% at 60% 20%, rgb(120 30 20 / 0.3), transparent 70%),
    radial-gradient(25% 35% at 85% 80%, rgb(196 67 45 / 0.16), transparent 70%);
}

.chapter-black-market .chapter-bg {
  background:
    radial-gradient(60% 70% at var(--light-x, 28%) 50%, rgb(var(--tone) / 0.12), transparent 70%),
    #0c0e0f;
}

.chapter-trade {
  --tone: 191 166 122;
  --atmo: radial-gradient(circle, rgb(255 255 255 / 0.09) 1.5px, transparent 2.5px) 0 0 / 22px 22px;
}

.chapter-museum {
  --tone: 184 144 224;
  --atmo: repeating-linear-gradient(90deg, rgb(184 144 224 / 0.07) 0 30px, transparent 30px 36px, rgb(0 0 0 / 0.25) 36px 38px, transparent 38px 64px);
}

.chapter-wardrobe {
  --tone: 222 168 196;
  --atmo: repeating-linear-gradient(135deg, rgb(222 168 196 / 0.05) 0 1px, transparent 1px 22px);
}

.art-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}

.art-strip li {
  padding: 4px;
  background: var(--slate);
  border: 1px solid var(--hairline);
  transition: transform 220ms ease, border-color 220ms ease;
}

.art-strip li:hover {
  transform: translateY(-4px) rotate(-1.5deg);
  border-color: var(--brass);
}

.link-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--hairline);
}

.link-list .text-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 0;
  line-height: 1.3;
}

.link-list-cols {
  columns: 2 220px;
  column-gap: 24px;
}

.link-list-cols li {
  break-inside: avoid;
}

@media (max-width: 860px) {
  .chapter {
    padding: 64px 0 72px;
  }

  .chapter-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .chapter-flip .chapter-media {
    order: 0;
  }

  .chapter-media .phone {
    max-width: 230px;
  }

  .chapter-bg,
  .chapter-flip .chapter-bg {
    --light-x: 50%;
  }

  .stencil,
  .chapter-flip .stencil {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    font-size: clamp(3.25rem, 17vw, 6rem);
  }
}

/* ---------------------------------------------------------------- motion (motion.js; never hides content without JS) */

.text-link .i-trail,
.question .i-trail {
  transition: transform 180ms ease;
}

.text-link:hover .i-trail,
.question:hover .i-trail {
  transform: translateX(4px);
}

.btn {
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.chip,
.badge-link {
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.chip:hover,
.badge-link:hover {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: no-preference) {
  .motion .rv-wait {
    opacity: 0;
    transform: translate3d(var(--rx, 0px), var(--ry, 32px), 0);
  }

  .motion .rv-in {
    transition:
      opacity 800ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms),
      transform 1000ms cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms);
  }

  /* The loop list stays put; its rail draws and its steps arrive one by one. */
  .motion .loop-steps.rv-wait {
    opacity: 1;
    transform: none;
  }

  .motion .loop-steps.rv-wait::before {
    transform: scaleX(0);
  }

  .motion .loop-steps.rv-in::before {
    transition: transform 1400ms cubic-bezier(0.65, 0, 0.35, 1) 100ms;
  }

  .motion .loop-steps.rv-wait li {
    opacity: 0;
    transform: translateY(24px);
  }

  .motion .loop-steps.rv-in li {
    transition:
      opacity 600ms ease var(--d, 0ms),
      transform 800ms cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms);
  }

  @media (max-width: 860px) {
    .motion .rv-wait {
      transform: translate3d(0, 20px, 0);
    }

    .motion .loop-steps.rv-wait::before {
      transform: scaleY(0);
    }
  }
}

/* ---------------------------------------------------------------- home: wiki band, faq, download */

.wiki-band {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto var(--section);
  padding: clamp(32px, 5vw, 64px) var(--gutter);
  background:
    radial-gradient(60% 80% at 85% 50%, rgb(191 166 122 / 0.12), transparent 70%),
    var(--slate);
  border-top: 3px solid var(--red);
}

@media (min-width: 1280px) {
  .wiki-band {
    padding-inline: 64px;
  }
}

.wiki-band h2 {
  margin-bottom: 16px;
}

.wiki-band p {
  color: #cfd3d5;
  max-width: 34em;
}

.wiki-band-media {
  display: grid;
  justify-items: center;
}

.wiki-band-media .phone {
  max-width: 240px;
}

@media (max-width: 860px) {
  .wiki-band {
    grid-template-columns: minmax(0, 1fr);
    margin-inline: var(--gutter);
    width: auto;
  }

  .wiki-band-media {
    display: none;
  }
}

.search {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 560px;
  margin: 24px 0;
  background: var(--ink-deep);
  border: 1px solid var(--steel);
}

.search > .i {
  margin-left: 14px;
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.search input::placeholder {
  color: #8a9096;
}

.search input:focus-visible {
  outline: none;
}

.search:focus-within {
  border-color: var(--red-hi);
  box-shadow: 0 0 0 2px var(--red-hi);
}

.search .btn {
  min-height: 52px;
  border-width: 0 0 0 1px;
}

.search-compact {
  margin-inline: auto;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--steel);
  background: var(--ink-deep);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

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

.chip .i {
  width: 18px;
  height: 18px;
  color: var(--brass);
}

.chip-on {
  background: var(--brass);
  border-color: var(--brass);
  color: #1a1610;
}

.chip-on:hover {
  color: #1a1610;
}

.swatch {
  width: 12px;
  height: 12px;
  background: var(--tier);
}

.home-faq {
  padding-bottom: var(--section);
}

.question-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.question {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  text-decoration: none;
}

.question:hover {
  background: var(--slate);
  color: var(--text);
}

.question > .i:first-child {
  color: var(--brass);
}

.question strong {
  display: block;
  font-size: 1.08rem;
}

.question small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.92rem;
}

.download {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--section) 0 calc(var(--section) * 0.6);
  text-align: center;
  background:
    radial-gradient(45% 60% at 50% 30%, rgb(220 199 159 / 0.14), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgb(196 67 45 / 0.12), transparent 70%),
    var(--ink);
  border-top: 1px solid var(--hairline);
}

.download-inner {
  display: grid;
  justify-items: center;
  max-width: 860px;
}

.download-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 24px;
  box-shadow: 0 0 0 1px var(--steel), 0 24px 60px rgb(220 199 159 / 0.18);
}

.download h2 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4rem);
  font-stretch: 76%;
}

.download p {
  color: #cfd3d5;
  max-width: 30em;
}

.store-center {
  justify-items: center;
}

.store-center .store-badges {
  justify-content: center;
}

.shelf-final {
  max-width: 640px;
  margin: 64px auto 14px;
}

.shelf-final li {
  flex-basis: 64px;
}

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

.site-footer {
  background: var(--ink-deep);
  border-top: 1px solid var(--hairline);
  padding: 56px var(--gutter) 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--wrap);
  margin: 0 auto;
}

.site-footer h2 {
  margin-bottom: 12px;
  font-size: 1rem;
  font-stretch: 100%;
  color: var(--brass);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
}

.site-footer li a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-brand p {
  margin: 12px 0 0;
  color: var(--muted);
}

.footer-legal {
  max-width: var(--wrap);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: #8a9096;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------- page heads, wiki home */

.page-head {
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(24px, 4vw, 48px);
}

.page-head h1 {
  margin-bottom: 16px;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.wiki-start {
  margin-bottom: clamp(48px, 6vw, 80px);
}

.start-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--red);
  color: var(--text);
  text-decoration: none;
}

.start-card:hover {
  background: var(--slate-hi);
  color: var(--text);
}

.start-card > .i {
  color: var(--brass);
}

.start-card small {
  display: block;
  color: var(--brass-hi);
  font-weight: 700;
  font-size: 0.95rem;
}

.start-card strong {
  display: block;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-stretch: 80%;
  line-height: 1.1;
  margin: 4px 0 6px;
}

.start-card span > span {
  color: #cfd3d5;
}

@media (max-width: 640px) {
  .start-card {
    grid-template-columns: 1fr;
  }
}

.wiki-catalog,
.wiki-guide,
.wiki-questions {
  margin-bottom: clamp(56px, 7vw, 96px);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 20px;
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-bottom: 3px solid var(--steel);
  color: var(--text);
  text-decoration: none;
}

.tile:hover {
  border-bottom-color: var(--brass);
  background: var(--slate-hi);
  color: var(--text);
}

.tile .i {
  color: var(--brass);
  margin-bottom: 6px;
}

.tile strong {
  font-size: 1.2rem;
}

.tile span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.tile-row {
  grid-template-columns: auto 1fr;
  column-gap: 14px;
}

.tile-row .i {
  grid-row: span 2;
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0 32px;
}

.category {
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
}

.category h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.category h3 .i {
  color: var(--brass);
}

.category p {
  color: var(--muted);
  font-size: 0.97rem;
}

.category ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-weight: 600;
  text-decoration: none;
}

.category li a:hover {
  text-decoration: underline;
}

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

.faq-layout {
  display: grid;
  gap: clamp(40px, 5vw, 64px);
  padding-bottom: var(--section);
}

.faq-layout h2 {
  margin-bottom: 20px;
}

.faq-site {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin: 0;
}

.faq-site > div {
  padding: 24px;
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--brass);
}

.faq-site dt {
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 1.15rem;
}

.faq-site dd {
  margin: 0;
  color: #cfd3d5;
}

.faq-site dd p:last-child {
  margin: 0;
}

.faq-group {
  margin-bottom: 32px;
}

.faq-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--brass-hi);
}

/* ---------------------------------------------------------------- guide topic */

.guide-wrap {
  padding-top: 24px;
  padding-bottom: var(--section);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--muted);
}

.crumbs li + li::before {
  content: '/';
  margin: 0 10px;
  color: var(--steel);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
}

.crumbs a,
.crumbs span {
  display: inline-block;
  padding: 6px 0;
  line-height: 1.4;
}

.crumbs a {
  color: var(--muted);
}

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

.crumbs [aria-current] {
  color: var(--text);
}

.guide-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.guide-head > .i {
  color: var(--brass);
  margin-top: 8px;
}

.guide-head h1 {
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.8rem);
}

.guide-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  padding: 20px;
  background: var(--slate);
  border: 1px solid var(--hairline);
}

.toc h2 {
  margin-bottom: 8px;
  font-size: 1rem;
  font-stretch: 100%;
  color: var(--brass);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 24px 1fr;
  padding: 7px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.97rem;
  line-height: 1.35;
}

.toc a::before {
  content: counter(toc);
  color: var(--steel);
  font-weight: 700;
}

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

.toc-caution a::after {
  content: '';
}

.toc-caution a {
  color: var(--danger);
}

.guide-body {
  max-width: 44em;
}

.g-section {
  padding: 0 0 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--hairline);
}

.g-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.g-section h2 .anchor {
  color: var(--text);
  text-decoration: none;
}

.g-section h2 .anchor:hover {
  text-decoration: underline;
}

.g-section p,
.g-section li {
  color: #d4d7d9;
  font-size: 1.08rem;
  line-height: 1.7;
}

.g-caution {
  padding: 24px;
  border: 1px solid rgb(233 159 155 / 0.35);
  border-left: 4px solid var(--danger);
  background: rgb(233 159 155 / 0.05);
}

.caution-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  font-weight: 700;
}

.steps {
  counter-reset: s;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 14px 48px;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--slate-hi);
  border: 1px solid var(--steel);
  color: var(--brass-hi);
  font-weight: 700;
  line-height: 1;
}

.in-app {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0 0;
  padding: 12px 14px;
  background: rgb(127 211 164 / 0.07);
  border-left: 3px solid var(--charge);
  font-size: 1rem !important;
}

.in-app .i {
  color: var(--charge);
  margin-top: 2px;
}

.g-questions,
.g-related {
  margin-bottom: 40px;
}

.g-questions h2,
.g-related h2,
.related h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 560px) {
  .guide-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ---------------------------------------------------------------- catalog */

.catalog-wrap {
  padding-top: 24px;
  padding-bottom: var(--section);
}

.tabs ul {
  display: flex;
  gap: 4px;
  margin: 0 0 32px;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: thin;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

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

.tabs a[aria-current] {
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--red);
}

.tabs .i {
  width: 18px;
  height: 18px;
  color: var(--brass);
}

.record-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.record-head > .i {
  color: var(--brass);
}

.record-head h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
}

.record-head .lede {
  margin: 10px 0 0;
  color: var(--muted);
}

.record-head .art {
  width: clamp(96px, 14vw, 160px);
  padding: 8px;
  background: var(--slate);
  border: 1px solid var(--hairline);
}

.art {
  flex: none;
}

.art-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--slate-hi);
  border: 1px solid var(--hairline);
  color: var(--brass);
}

.record-head .art-icon {
  width: 96px;
  height: 96px;
}

.tier {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 1px 7px 1px 6px;
  border-left: 3px solid var(--tier);
  background: rgb(255 255 255 / 0.07);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
}

.record-head .tier {
  font-size: 1rem;
  font-stretch: 100%;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 24px;
  padding: 12px 16px;
  background: rgb(191 166 122 / 0.1);
  border-left: 3px solid var(--brass);
}

.notice-warn {
  background: rgb(233 159 155 / 0.08);
  border-left-color: var(--danger);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--slate);
  border: 1px solid var(--hairline);
}

.filters label {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.filters input,
.filters select {
  min-height: 48px;
  min-width: 160px;
  padding: 0 12px;
  background: var(--ink-deep);
  border: 1px solid var(--steel);
  color: var(--text);
  font: inherit;
}

.count {
  color: var(--muted);
  font-size: 0.95rem;
}

.rows {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  text-decoration: none;
}

.row:hover {
  background: var(--slate);
  color: var(--text);
}

.row .art {
  width: 56px;
  height: 56px;
  background: var(--slate);
}

.row-main {
  display: grid;
  flex: 1;
  min-width: 0;
}

.row-main strong {
  font-size: 1.05rem;
}

.row-main small {
  color: var(--muted);
  font-size: 0.92rem;
}

.row-main .title-grant {
  color: var(--violet);
}

.row-code {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.rows-compact .row {
  min-height: 52px;
}

.type-tag {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--steel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.rp {
  flex: none;
  color: var(--brass-hi);
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.card-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  display: grid;
  gap: 6px;
  justify-items: start;
  height: 100%;
  padding: 14px;
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-bottom: 3px solid var(--steel);
  color: var(--text);
  text-decoration: none;
}

.card:hover {
  background: var(--slate-hi);
  border-bottom-color: var(--brass);
  color: var(--text);
}

.card .art {
  width: 100%;
  max-width: 140px;
  justify-self: center;
  margin-bottom: 6px;
}

.card strong {
  font-size: 1.08rem;
  line-height: 1.25;
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat {
  display: grid;
  font-size: 1.4rem;
  font-weight: 700;
  font-stretch: 80%;
  color: var(--brass-hi);
}

.stat small {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-stretch: 100%;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.facts > div {
  padding: 16px;
  background: var(--slate);
}

.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.facts dd {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.fact-brass dd {
  color: var(--brass-hi);
}

.fact-violet dd {
  color: var(--violet);
}

.fact-muted dd {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.record-sections {
  display: grid;
  gap: 32px;
  margin-bottom: 24px;
}

.record-sections h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.record-sections h3 {
  margin: 20px 0 10px;
  font-size: 1.1rem;
}

.bars {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.bars li {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 12px;
  align-items: center;
}

.meter {
  height: 12px;
  background: var(--ink-deep);
  border: 1px solid var(--hairline);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--tier);
}

.meter-value {
  text-align: right;
  font-weight: 700;
}

.guide-link {
  margin: 0 0 32px;
}

.related {
  margin-top: 40px;
}

.prose-lg {
  font-size: 1.2rem;
  max-width: 36em;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
  color: var(--muted);
}

.pager a:last-child {
  justify-self: end;
}

.empty {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 32px;
  background: var(--slate);
  border: 1px dashed var(--steel);
}

.empty p {
  margin: 0;
}

.empty .i {
  color: var(--brass);
  margin-bottom: 8px;
}

.fineprint {
  color: #8a9096;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .record-head {
    grid-template-columns: 1fr;
  }

  .filters input,
  .filters select {
    min-width: 0;
    width: 100%;
  }

  .filters label {
    flex: 1 1 140px;
  }

  .row-code {
    display: none;
  }
}

/* ---------------------------------------------------------------- updates */

.notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note {
  max-width: 44em;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
}

.note header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
}

.version {
  padding: 2px 8px;
  border-left: 3px solid var(--red);
  background: rgb(255 255 255 / 0.06);
  color: var(--text);
  font-weight: 700;
}

.note h2 {
  margin-bottom: 12px;
  font-size: 1.7rem;
}

.note p {
  color: #d4d7d9;
}

/* ---------------------------------------------------------------- state pages (404, 503) */

.state-page {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: clamp(56px, 10vw, 120px);
  padding-bottom: var(--section);
  text-align: center;
}

.state-page > .i {
  color: var(--brass);
  margin-bottom: 12px;
}

.state-page .lede {
  margin-inline: auto;
  color: var(--muted);
}

.state-code {
  margin: 0;
  font-size: clamp(5rem, 3rem + 10vw, 10rem);
  font-weight: 700;
  font-stretch: 75%;
  line-height: 0.9;
  color: var(--slate-hi);
  -webkit-text-stroke: 2px var(--steel);
}

.state-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------------------------------------------------------------- legal + account deletion */

.legal-wrap {
  max-width: 860px;
  padding-bottom: var(--section);
}

.prose {
  color: #d4d7d9;
  line-height: 1.7;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 1.6em 0 0.5em;
  font-stretch: 100%;
  color: var(--text);
}

.prose h1 {
  font-size: 1.8rem;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.15rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  text-align: left;
}

.loading {
  color: var(--muted);
}

.legal-error,
.ios-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 24px 0;
  padding: 20px;
  background: var(--slate);
  border-left: 4px solid var(--danger);
}

.legal-error[hidden] {
  display: none;
}

.legal-error .i {
  color: var(--danger);
}

.ios-note {
  border-left-color: var(--steel);
}

.ios-note p {
  margin: 0;
  color: #cfd3d5;
}

.delete-panel {
  margin-top: 40px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--danger);
}

.delete-panel h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
  color: var(--danger);
}

.auth-stack {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.session-card {
  margin: 16px 0;
  padding: 16px;
  background: var(--ink-deep);
  border: 1px solid var(--steel);
}

.session-card[hidden],
.confirm-box[hidden] {
  display: none;
}

.session-title {
  font-weight: 700;
}

.session-meta {
  color: var(--muted);
}

.delete-status {
  min-height: 1.6em;
}

.delete-status.ok,
.ok {
  color: var(--charge);
}

.delete-status.error,
.error {
  color: var(--danger);
}

.confirm-box {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.confirm-box input {
  min-height: 48px;
  padding: 0 12px;
  background: var(--ink-deep);
  border: 1px solid var(--steel);
  color: var(--text);
  font: inherit;
}

.coming-soon {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
