/* Riot Control sub-pages stylesheet (extends css/site.css tokens & RIOT-64 palette). */
.subpage {
  padding-top: calc(var(--bar) + var(--safe-t));
  background: var(--navy0);
  min-height: 100vh;
}
.subpage .topbar {
  background: rgba(21, 27, 56, 0.96);
  box-shadow: 0 2px 0 var(--ink);
}
@media (min-width: 1024px) and (max-width: 1519px) {
  .subpage .wordmark {
    font-size: 16px;
  }
  .subpage .topbar__nav a {
    font-size: 10px;
    padding: 8px 6px;
  }
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 0 4px;
  font-size: 13px;
  color: var(--gray6);
}
.crumbs a {
  color: var(--stone4);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--hivis2);
  text-decoration: underline;
}
.page-hero {
  padding: 10px 0 22px;
  border-bottom: 2px solid var(--gray2);
  background: radial-gradient(75% 80% at 50% 0%, rgba(47, 68, 136, 0.45), transparent 72%);
}
.page-hero h1 {
  margin-top: 6px;
}
.page-hero .lede {
  max-width: 66ch;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray6);
}
.page-meta strong {
  color: var(--stone5);
}
.page-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.sec {
  padding: 26px 0;
  border-bottom: 1px solid rgba(82, 75, 96, 0.45);
}
.sec:last-of-type {
  border-bottom: 0;
}
.sec h2 {
  font:
    400 28px/1.15 'Dossier Display',
    Lato,
    sans-serif;
  text-transform: uppercase;
  color: var(--stone5);
  margin-bottom: 16px;
}
@media (min-width: 700px) {
  .sec h2 {
    font-size: 36px;
  }
}
.sec h3 {
  font-size: 20px;
  line-height: 1.3;
  color: var(--hivis2);
  margin: 22px 0 8px;
}
.prose {
  max-width: 74ch;
  display: grid;
  gap: 14px;
  color: var(--stone5);
  font-size: 17px;
  line-height: 1.65;
}
.prose ul,
.prose ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  list-style: disc;
  color: var(--gray7);
}
.prose ol {
  list-style: decimal;
}
.prose strong {
  color: var(--white);
}
.prose code {
  padding: 2px 6px;
  background: var(--ink);
  color: var(--hivis2);
  font-size: 0.9em;
}
.callout {
  padding: 18px 20px;
  background: rgba(33, 45, 92, 0.42);
  box-shadow:
    inset 0 0 0 2px var(--gray2),
    inset 4px 0 0 var(--hivis2);
  color: var(--stone5);
  max-width: 74ch;
}
.callout strong {
  color: var(--hivis2);
}

/* Data tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--gray2);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  min-width: 640px;
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray2);
  vertical-align: top;
}
.data-table th {
  background: var(--gray1);
  color: var(--hivis2);
  font:
    400 10px/1.3 'Dossier Small',
    Lato,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (min-width: 900px) {
  .data-table th {
    font-size: 12px;
    font-family: Lato, system-ui, sans-serif;
    font-weight: 700;
  }
}
.data-table tr.is-ours {
  background: rgba(240, 245, 108, 0.08);
}
.data-table tr.is-ours td:first-child {
  color: var(--hivis2);
  font-weight: 700;
}
.badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--hivis2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}

/* Cards & grids */
.card-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
@media (min-width: 700px) {
  .card-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 20px;
  background: var(--gray1);
  box-shadow:
    0 0 0 2px var(--ink),
    inset 0 -3px 0 var(--ink);
}
.card--paper {
  background: var(--stone5);
  color: var(--ink);
  box-shadow:
    0 0 0 3px var(--ink),
    inset 0 -4px 0 var(--stone3);
}
.card--paper p,
.card--paper li {
  color: var(--earth1);
}
.card--paper h3 {
  color: var(--ink);
  margin: 0;
}
.card h3 {
  margin: 0;
  font-size: 19px;
}
.card p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray7);
}
.card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.card__sprite {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 72px;
  padding: 8px;
  background: rgba(21, 27, 56, 0.5);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--stone4);
}
.card__stats b {
  color: var(--hivis2);
}

/* City atlas cards */
.city-card {
  display: grid;
  background: var(--stone5);
  color: var(--ink);
  box-shadow:
    0 0 0 3px var(--ink),
    inset 0 -4px 0 var(--stone3);
  overflow: hidden;
}
.city-card__img {
  position: relative;
  background: var(--ink);
}
.city-card__imgbtn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: zoom-in;
  overflow: hidden;
  text-align: left;
}
.city-card__imgbtn img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s var(--ease);
}
.city-card__imgbtn:hover img,
.city-card__imgbtn:focus-visible img {
  transform: scale(1.04);
}
.city-card__zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  background: rgba(26, 20, 36, 0.88);
  color: var(--hivis2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--hivis2);
  pointer-events: none;
}
.city-card__img img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.city-card__num {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 8px;
  background: var(--ink);
  color: var(--hivis2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.city-card__body {
  display: grid;
  gap: 8px;
  padding: 16px 18px 18px;
}
.city-card__body h3 {
  margin: 0;
  color: var(--ink);
  font:
    400 28px/1 'Dossier Display',
    Lato,
    sans-serif;
  text-transform: uppercase;
}
.city-card__body p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--earth1);
}
.city-card__body strong {
  color: var(--crim1);
}

/* Fact sheet & Press assets */
.facts-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
@media (min-width: 700px) {
  .facts-dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.facts-dl div {
  padding: 12px 14px;
  background: var(--gray1);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.facts-dl dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hivis2);
  font-weight: 700;
}
.facts-dl dd {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--stone5);
}

.media-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
@media (min-width: 700px) {
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.media-item {
  background: var(--gray1);
  padding: 10px;
  box-shadow: 0 0 0 2px var(--ink);
  display: grid;
  gap: 8px;
}
.media-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.media-item figcaption {
  font-size: 13px;
  color: var(--gray7);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Standalone Demo player (/play/) — full-width iPhone Pro Max 19.5:9 landscape ratio */
.page-hero--play {
  padding: 6px 0 12px;
}
.page-hero--play .h-pixel {
  font-size: 32px;
}
@media (min-width: 900px) {
  .page-hero--play .h-pixel {
    font-size: 48px;
  }
}
.page-hero--play .lede {
  margin-top: 6px;
  font-size: 15px;
  max-width: none;
}
.demo-sec {
  padding: 12px 0 20px;
  border-bottom: 1px solid rgba(82, 75, 96, 0.45);
}
.demo-sec .wrap {
  max-width: min(1400px, 100%);
}
.demo-stage {
  width: 100%;
  background: var(--ink);
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 0 5px var(--hivis2),
    0 18px 44px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.demo-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 14px;
  background: var(--earth1);
  border-bottom: 2px solid var(--ink);
  font-size: 13px;
  color: var(--stone4);
}
.demo-stage__meta {
  font:
    400 var(--label)/1.2 'Dossier Small',
    Lato,
    sans-serif;
  text-transform: uppercase;
  color: var(--stone5);
}
.demo-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.demo-stage__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  background: var(--ink);
  color: var(--hivis2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px var(--gray3);
}
.demo-stage__btn:hover,
.demo-stage__btn:focus-visible {
  box-shadow: inset 0 0 0 2px var(--hivis2);
}
.demo-stage__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 19.5 / 9;
  background: var(--ink);
}
.demo-stage:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}
.demo-stage:fullscreen .demo-stage__viewport {
  flex: 1;
  aspect-ratio: auto;
}
.demo-stage:fullscreen .demo-stage__hint {
  display: none;
}
.demo-stage__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ink);
}
.demo-stage__hint {
  padding: 8px 14px;
  background: var(--gray1);
  border-top: 1px solid var(--ink);
  font-size: 13px;
  color: var(--gray7);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
}

/* Full-screen zoomable city map viewer (/cities/) */
.map-viewer {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 12, 24, 0.97);
  color: var(--white);
}
.map-viewer::backdrop {
  background: rgba(15, 12, 24, 0.85);
}
.map-viewer[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-viewer__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 12px 10px 16px;
  background: var(--ink);
  border-bottom: 2px solid var(--gray2);
  z-index: 3;
}
.map-viewer__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.map-viewer__title {
  font:
    400 24px/1 'Dossier Display',
    Lato,
    sans-serif;
  text-transform: uppercase;
  color: var(--hivis2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-viewer__sub {
  font-size: 13px;
  color: var(--stone4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-viewer__controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-viewer__btn {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  background: var(--gray1);
  color: var(--stone5);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--gray3);
}
.map-viewer__btn:hover,
.map-viewer__btn:focus-visible {
  color: var(--hivis2);
  box-shadow: inset 0 0 0 2px var(--hivis2);
}
.map-viewer__zoompct {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--stone4);
  font-variant-numeric: tabular-nums;
}
.map-viewer__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  border: 0;
  background: var(--hivis2);
  color: var(--ink);
  font:
    400 32px/1 'Dossier Display',
    Lato,
    sans-serif;
}
.map-viewer__close:hover {
  filter: brightness(1.08);
}
.map-viewer__stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.map-viewer__stage.is-dragging {
  cursor: grabbing;
}
.map-viewer__img {
  max-width: 96vw;
  max-height: calc(100dvh - 110px);
  width: auto;
  height: auto;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  box-shadow:
    0 0 0 3px var(--ink),
    0 18px 50px rgba(0, 0, 0, 0.7);
}
.map-viewer__img.is-pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.map-viewer__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px calc(8px + var(--safe-b));
  background: var(--ink);
  border-top: 1px solid var(--gray2);
  font-size: 12px;
  color: var(--gray6);
}
@media (max-width: 639px) {
  .map-viewer__sub,
  .map-viewer__zoompct {
    display: none;
  }
  .map-viewer__title {
    font-size: 20px;
  }
  .map-viewer__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 7px;
  }
}

/* Comparison highlight helpers */
.pill-yes {
  color: var(--hivis2);
  font-weight: 700;
}
.pill-no {
  color: var(--gray6);
}
.spotlight-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
@media (min-width: 700px) {
  .spotlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.spotlight-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  background: rgba(33, 45, 92, 0.52);
  box-shadow:
    0 0 0 2px var(--ink),
    inset 4px 0 0 var(--hivis2);
}
.spotlight-card h3 {
  margin: 0;
  color: var(--hivis2);
  font-size: 18px;
}
.spotlight-card p {
  color: var(--stone5);
  font-size: 15px;
  line-height: 1.55;
}

/* CTA banner */
.cta-band {
  margin-top: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--navy1), var(--rust0));
  box-shadow:
    0 0 0 3px var(--ink),
    inset 0 0 0 2px var(--hivis2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cta-band h3 {
  margin: 0 0 6px;
  color: var(--stone5);
}
.cta-band p {
  color: var(--gray7);
  font-size: 15px;
  max-width: 54ch;
}

/* CJK sub-page typography */
@media (min-width: 1024px) and (max-width: 1519px) {
  :is(html:lang(zh), html:lang(ja), html:lang(ko)) .subpage .topbar__nav a {
    font-size: 13px;
    padding: 8px 8px;
  }
}
:is(html:lang(zh), html:lang(ja), html:lang(ko)) :is(.sec h2, .city-card__body h3, .map-viewer__title) {
  font-family: 'Dossier Display', var(--font-cjk);
  font-weight: 800;
  line-height: 1.25;
}
:is(html:lang(zh), html:lang(ja), html:lang(ko)) .data-table th {
  font-family: Lato, var(--font-cjk);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
:is(html:lang(zh), html:lang(ja), html:lang(ko)) .demo-stage__meta {
  font-family: 'Dossier Small', var(--font-cjk);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
