/* ==========================================================================
   Editorial game catalog — site.css
   Paper surfaces, black ink, vermilion accent, cobalt secondary.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --paper-2: #f3f5f7;
  --paper-3: #e9edf1;
  --ink: #141414;
  --ink-2: #404348;
  --ink-3: #687077;
  --rule: #d9dfe4;
  --rule-strong: #141414;
  --verm: #d63a24;
  --verm-dark: #b02c19;
  --cobalt: #1f3fb8;
  --cobalt-soft: #e6ebfa;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI",
    Arial, sans-serif;
  --font-latin: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", serif;

  --wrap: 1240px;
  --gutter: 20px;
  --radius: 4px;
  --radius-lg: 6px;
  --ease: 160ms ease;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

b,
strong {
  font-weight: 700;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

::selection {
  background: var(--verm);
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  stroke: currentColor;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Shared components
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

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

.btn--primary:hover {
  background: var(--verm-dark);
  border-color: var(--verm-dark);
  color: #fff;
}

.btn--ghost:hover {
  background: var(--ink);
  color: #fff;
}

.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--verm);
  line-height: 1.4;
}

.kicker__link:hover {
  color: var(--verm-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden; /* clips image corners to the frame radius only */
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.taglist__item {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  background: #fff;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.25rem;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  background: #fff;
  transition: background var(--ease), color var(--ease);
}

.chip b {
  font-family: var(--font-latin);
  font-weight: 400;
  color: var(--verm);
}

.chip:hover {
  background: var(--ink);
  color: #fff;
}

.chip:hover b {
  color: #fff;
}

.section {
  padding-block: 2.5rem 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--rule-strong);
  margin-bottom: 1.25rem;
}

.section__title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
}

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
  color: var(--cobalt);
  white-space: nowrap;
}

.section__more:hover {
  color: var(--verm);
}

/* --------------------------------------------------------------------------
   Masthead & navigation
   -------------------------------------------------------------------------- */

.masthead {
  border-top: 5px solid var(--verm);
  background: var(--paper);
}

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

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

.brand__logo {
  width: 160px;
  height: auto;
  flex: none;
  padding: 6px 8px;
  background: var(--ink);
  border-radius: var(--radius);
  object-fit: contain;
}

.brand__name {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.15;
}

@media (max-width: 639px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .brand__logo {
    width: 136px;
    height: auto;
  }

  .brand__name {
    font-size: 1.05rem;
  }
}

.brand--small .brand__logo {
  width: 112px;
  height: auto;
}

.brand--small .brand__name {
  font-size: 1.25rem;
}

.masthead__meta {
  display: none;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-3);
  line-height: 1.4;
}

.masthead__stat b {
  font-family: var(--font-latin);
  font-size: 1.25rem;
  color: var(--ink);
  margin-right: 0.15em;
}

.menu-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.site-nav {
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}

.site-nav__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.25rem 0.8rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.site-nav__link:hover {
  color: var(--verm);
}

.site-nav__link[aria-current="page"] {
  color: var(--verm);
  border-bottom-color: var(--verm);
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.5rem;
  padding: 0.3rem 0.9rem;
  margin-block: 0.25rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav__cta:hover {
  background: var(--verm);
  color: #fff;
}

/* Mobile: JS collapses the nav; without JS it simply stacks. */
@media (max-width: 899px) {
  .site-nav__row {
    flex-direction: column;
    align-items: stretch;
    padding-block: 0.5rem;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0;
  }

  .site-nav__link {
    width: 100%;
    min-height: 2.9rem;
    border-bottom: 1px solid var(--rule);
    margin: 0;
  }

  .site-nav__link[aria-current="page"] {
    border-bottom-color: var(--rule);
    box-shadow: inset 4px 0 0 var(--verm);
    padding-left: 1rem;
  }

  .site-nav__cta {
    justify-content: center;
    margin-top: 0.75rem;
  }

  .js .site-nav:not(.is-open) {
    display: none;
  }
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .masthead__meta {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   Home: lead composition
   -------------------------------------------------------------------------- */

.lead {
  padding-top: 1.5rem;
}

.lead__head {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

.lead__title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.2;
}

.lead__dek {
  max-width: 62ch;
  color: var(--ink-2);
}

.lead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lead__grid {
  display: grid;
  gap: 1.75rem;
}

.feature {
  display: grid;
  gap: 1rem;
}

.feature__media {
  display: block;
}

.feature__body {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.feature__title {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.feature__en {
  font-family: var(--font-latin);
  font-size: 1.05rem;
  color: var(--ink-3);
}

.feature__desc {
  color: var(--ink-2);
}

.feature__actions {
  padding-top: 0.25rem;
}

.side-stack {
  border-top: 2px solid var(--rule-strong);
}

.side-stack__title {
  font-size: 1rem;
  font-weight: 800;
  padding: 0.6rem 0 0.25rem;
}

.side-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.side-item__media {
  display: block;
}

.side-item__body {
  display: grid;
  gap: 0.2rem;
  align-content: start;
  min-width: 0;
}

.side-item__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.side-item__en {
  font-family: var(--font-latin);
  font-size: 0.9rem;
  color: var(--ink-3);
}

.side-item__dl {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cobalt);
}

.side-item__dl:hover {
  color: var(--verm);
}

@media (min-width: 640px) {
  .lead__title {
    font-size: 2.25rem;
  }
}

@media (min-width: 900px) {
  .lead {
    padding-top: 2rem;
  }

  .lead__head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .lead__title {
    grid-column: 1;
  }

  .lead__dek {
    grid-column: 1;
  }

  .lead__actions {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: end;
    justify-content: flex-end;
  }

  .lead__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2.5rem;
  }

  .feature__title {
    font-size: 2rem;
  }
}

@media (min-width: 1180px) {
  .lead__title {
    font-size: 2.6rem;
  }
}

/* --------------------------------------------------------------------------
   Home: category index & quick roll
   -------------------------------------------------------------------------- */

.index-list {
  display: grid;
  gap: 0 2rem;
}

.index-list__item {
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0 0.9rem;
}

.index-list__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.75rem;
}

.index-list__n {
  font-family: var(--font-latin);
  font-size: 0.95rem;
  color: var(--verm);
}

.index-list__label {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
}

.index-list__count {
  font-family: var(--font-latin);
  color: var(--ink-3);
  white-space: nowrap;
}

.index-list__link:hover .index-list__label {
  color: var(--verm);
}

.index-list__sample {
  font-size: 0.88rem;
  color: var(--ink-3);
  padding-left: calc(0.75rem + 1.4em);
  line-height: 1.6;
}

.index-list__sample a:hover {
  color: var(--verm);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.roll {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}

.roll__item {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.roll__media {
  display: block;
  margin-bottom: 0.25rem;
}

.roll__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.roll__en {
  font-family: var(--font-latin);
  font-size: 0.85rem;
  color: var(--ink-3);
}

.section--band {
  padding-block: 1.5rem;
  background: var(--paper-2);
  border-block: 1px solid var(--rule);
}

.band {
  display: grid;
  gap: 1rem;
}

.band__title {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.25;
}

.band__meta {
  color: var(--ink-3);
  font-size: 0.92rem;
}

.band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .index-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roll {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .index-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .roll {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.75rem 1.5rem;
  }

  .band {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 1.75rem 2rem;
  }
}

/* --------------------------------------------------------------------------
   Catalog (games.html) & category page heads
   -------------------------------------------------------------------------- */

.catalog-page,
.category-page {
  padding-block: 1.5rem 3rem;
}

.catalog-head {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--rule-strong);
}

.catalog-head__title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.2;
}

.catalog-head__dek {
  max-width: 62ch;
  color: var(--ink-2);
  margin-top: 0.5rem;
}

.finder {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.finder__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}

.finder__control {
  position: relative;
}

.finder__icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.finder__icon--end {
  left: auto;
  right: 0.8rem;
}

.finder__input,
.finder__select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.45rem 0.9rem 0.45rem 2.5rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  line-height: 1.4;
}

.finder__input::-webkit-search-decoration,
.finder__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.finder__select {
  padding-left: 0.9rem;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.finder__reset {
  width: 100%;
  justify-content: center;
  min-height: 2.9rem;
}

.catalog-status {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--ink-3);
  font-size: 0.92rem;
}

.catalog-status__num {
  font-family: var(--font-latin);
  font-size: 1.5rem;
  color: var(--verm);
  line-height: 1;
}

.catalog-empty {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  background: #fff;
  font-weight: 600;
}

.catalog {
  counter-reset: entry;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

.entry:target {
  box-shadow: inset 5px 0 0 var(--verm);
  padding-left: 1rem;
  background: #fff;
}

.entry__media {
  min-width: 0;
}

.entry__body {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  min-width: 0;
}

.entry__kicker {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.entry__cat {
  color: var(--verm);
}

.entry__cat:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.entry__title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
}

.entry__en {
  display: inline-block;
  font-family: var(--font-latin);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--ink-3);
  margin-left: 0.25em;
}

.entry__desc {
  color: var(--ink-2);
}

.entry__actions {
  display: flex;
  align-items: flex-start;
}

.entry__actions .btn {
  width: 100%;
  justify-content: center;
}

.catalog-foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--rule-strong);
}

.catalog-foot__title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .finder {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .finder__field--search {
    grid-column: 1 / -1;
  }

  .entry {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
  }

  .entry__actions {
    grid-column: 2;
  }

  .entry__actions .btn {
    width: auto;
  }
}

@media (min-width: 900px) {
  .catalog-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
  }

  .catalog-head__text {
    grid-column: 1 / -1;
  }

  .catalog-head__title {
    font-size: 2.4rem;
  }

  .finder {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  }

  .finder__field--search {
    grid-column: auto;
  }

  .finder__reset {
    width: auto;
  }

  .catalog-status {
    grid-column: 1 / -1;
  }

  .entry {
    grid-template-columns: 260px minmax(0, 1fr) auto;
    gap: 1.75rem;
    padding: 1.75rem 0;
  }

  .entry__actions {
    grid-column: 3;
  }
}

/* --------------------------------------------------------------------------
   Category page
   -------------------------------------------------------------------------- */

.jump__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.group {
  padding-top: 2rem;
  scroll-margin-top: 1rem;
}

.group__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--rule-strong);
  margin-bottom: 1.25rem;
}

.group__n {
  font-family: var(--font-latin);
  color: var(--verm);
  font-size: 1rem;
}

.group__title {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.25;
}

.group__count {
  grid-column: 2;
  font-family: var(--font-latin);
  color: var(--ink-3);
}

.group__more {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
  color: var(--cobalt);
}

.group__more:hover {
  color: var(--verm);
}

.group__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}

.group__empty {
  color: var(--ink-3);
}

.tile {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.tile__media {
  display: block;
  margin-bottom: 0.3rem;
}

.tile__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.tile__en {
  font-family: var(--font-latin);
  font-size: 0.85rem;
  color: var(--ink-3);
}

.tile__dl {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cobalt);
  margin-top: 0.2rem;
}

.tile__dl:hover {
  color: var(--verm);
}

@media (min-width: 640px) {
  .group__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .group__head {
    grid-template-columns: auto auto 1fr auto;
  }

  .group__count,
  .group__more {
    grid-column: auto;
  }

  .group__more {
    justify-self: end;
  }

  .group__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.75rem 1.5rem;
  }
}

@media (min-width: 1180px) {
  .group__list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Supporting pages (article layout)
   -------------------------------------------------------------------------- */

.article-page {
  padding-block: 1.5rem 3rem;
}

.article-head {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--rule-strong);
  margin-bottom: 1.75rem;
}

.article-head__title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.2;
}

.article-head__dek {
  max-width: 62ch;
  color: var(--ink-2);
}

.article-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.toc {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1rem 1.1rem;
}

.toc__title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}

.toc__list {
  display: grid;
  gap: 0.15rem;
}

.toc__item--sub {
  padding-left: 1rem;
}

.toc__link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  margin-left: -0.6rem;
}

.toc__link:hover,
.toc__link.is-active {
  color: var(--verm);
  border-left-color: var(--verm);
}

.article {
  max-width: 72ch;
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.85;
}

.article > * + * {
  margin-top: 1rem;
}

.article__h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

.article__h2:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.article__h3 {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 1.75rem;
  scroll-margin-top: 1.5rem;
}

.article__h3::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.5em;
  background: var(--verm);
  vertical-align: 0.15em;
}

.article__p {
  color: var(--ink-2);
}

.article__list {
  padding-left: 1.5rem;
  color: var(--ink-2);
}

.article__list li {
  list-style: disc;
  margin-top: 0.35rem;
}

.article__list--ordered li {
  list-style: decimal;
}

.article__list li::marker {
  color: var(--verm);
  font-weight: 700;
}

.article a {
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.article a:hover {
  color: var(--verm);
}

.article code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
}

.article strong {
  color: var(--ink);
}

@media (min-width: 900px) {
  .article-page {
    padding-top: 2rem;
  }

  .article-head__title {
    font-size: 2.4rem;
  }

  .article-layout--toc {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 3rem;
  }

  .article-layout--toc .toc {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto; /* long TOCs scroll inside the sticky rail */
  }
}

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

.colophon {
  margin-top: 3rem;
  border-top: 2px solid var(--rule-strong);
  background: var(--paper-2);
}

.colophon__grid {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem;
}

.colophon__brand {
  display: grid;
  gap: 0.5rem;
}

.colophon__stats {
  color: var(--ink-3);
  font-size: 0.92rem;
}

.colophon__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.colophon__list a {
  display: inline-block;
  padding-block: 0.25rem;
  font-weight: 600;
}

.colophon__list a[aria-current="page"] {
  color: var(--verm);
}

.colophon__action {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.colophon__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-3);
}

.colophon__top {
  font-weight: 600;
  color: var(--cobalt);
}

.colophon__top:hover {
  color: var(--verm);
}

@media (min-width: 900px) {
  .colophon__grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
    align-items: start;
  }

  .colophon__action {
    justify-content: flex-end;
  }
}

/* --------------------------------------------------------------------------
   Motion & print
   -------------------------------------------------------------------------- */

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

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

@media print {
  .masthead,
  .colophon,
  .finder,
  .menu-toggle,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
  }
}
