/* Frachtbaron announcement page. The surface is the game screen: dark HUD panels,
   rust as the only action colour, city labels, message toasts and the build panel. */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fonts/barlow-semi-condensed-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fonts/barlow-semi-condensed-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1c1b19;
  --panel: #262522;
  --panel-raised: #302e2a;
  --line: #3f3d38;
  --line-strong: #5a5750;
  --text: #ece8df;
  --muted: #a8a49b;
  --accent: #e08a55;
  --accent-ink: #1c1b19;
  --run: #e0b35a;
  --done: #9ccb72;
  --preview: #40d959;
  --scene: #17191f;
  --label: rgb(16 18 24 / 0.84);
  --label-line: rgb(255 255 255 / 0.28);
  --badge: #face58;
  --badge-ink: #1a1c22;
  --select: #ffd933;
  --store: #4080cc;
  --display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hud-h: 3.25rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hud-h) + 1rem);
  scrollbar-color: #4a4843 var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Only the active language is shown; the switch buttons carry both. */
:root[data-lang="de"] body [lang="en"]:not([data-set-lang]),
:root[data-lang="en"] body [lang="de"]:not([data-set-lang]) {
  display: none;
}

::selection {
  background: rgb(224 138 85 / 0.4);
  color: #fff;
}

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

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

a:hover {
  color: #f0a77a;
}

img {
  max-width: 100%;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 30;
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
}

.skip:focus {
  top: 0.6rem;
}

/* Buttons as in the game: panel fill, 1px line, rust when pressed or primary. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    color 0.15s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-primary,
.btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-primary:hover,
.btn[aria-pressed="true"]:hover {
  background: #eb9a67;
  border-color: #eb9a67;
  color: var(--accent-ink);
}

/* HUD */

.hud {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: var(--hud-h);
  padding: 0.45rem var(--gutter);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.hud-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
}

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

.hud-sub {
  color: var(--muted);
  font-size: 0.875rem;
}

.hud-readout {
  display: flex;
  gap: 1.25rem;
  margin: 0;
}

.hud-readout > div {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.hud-readout dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.hud-readout dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hud-nav {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lang-switch .btn {
  min-width: 2.6rem;
  font-variant-numeric: tabular-nums;
}

/* Stage: map window and messages panel */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 27rem);
  height: clamp(36rem, calc(100svh - var(--hud-h)), 58rem);
  border-bottom: 1px solid var(--line);
}

.map {
  position: relative;
  min-width: 0;
  background: var(--scene);
}

.map-view {
  --focus-x: 0.6;
  --focus-y: 0.36;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--scene);
}

.camera {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.camera-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-live .camera {
  inset: auto;
  left: 0;
  top: 0;
  will-change: transform;
}

.cam-live .camera-img {
  object-fit: fill;
}

.camera.is-moving {
  transition: transform 1.25s var(--ease-out);
}

.marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7%;
  overflow: visible;
  fill: rgb(255 217 51 / 0.14);
  stroke: var(--select);
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition:
    opacity 0.25s,
    transform 0.6s var(--ease-out);
}

.marker path {
  vector-effect: non-scaling-stroke;
}

.marker.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0.7s;
}

.map-chip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  max-width: calc(100% - 1.5rem);
  margin: 0;
  padding: 0.3rem 0.6rem;
  background: var(--label);
  color: #fff;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.chip-tag {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.map-title {
  position: absolute;
  left: clamp(1rem, 3vw, 2.5rem);
  bottom: clamp(1rem, 3vw, 2.5rem);
  display: grid;
  justify-items: start;
  gap: 1rem;
  width: min(38rem, calc(100% - 2rem));
}

/* The name as a city label on the map, as the renderer draws them. */
.city-label {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  margin: 0;
  padding: 0.1em 0.2em 0.12em 0.45em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.75rem, 5.4vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.005em;
  color: #fff;
  background: var(--label);
  border: 2px solid var(--label-line);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.35);
}

.badge {
  padding: 0.16em 0.5em 0.2em;
  border-radius: 999px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 0.4em;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
  padding: 1rem 1.25rem;
}

.lede {
  margin: 0;
  font-size: clamp(1.125rem, 1.55vw, 1.375rem);
  line-height: 1.35;
  font-weight: 500;
  text-wrap: pretty;
}

.lede-note {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-wrap: pretty;
}

.messages {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

.messages-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.messages-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 0.8125rem;
  font-weight: 700;
}

.messages-sub {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.8125rem;
}

.msg-list {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.75rem;
  overflow-y: auto;
  list-style: none;
}

.msg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta meta"
    "text show";
  align-items: end;
  gap: 0.4rem 0.9rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

.msg.is-active {
  background: #24221f;
  border-color: rgb(255 217 51 / 0.65);
}

.msg-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.msg-text {
  grid-area: text;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-wrap: pretty;
}

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

.msg-text a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.btn-show {
  grid-area: show;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.state::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.state-done {
  color: var(--done);
}

.state-run {
  color: var(--run);
}

.state-next {
  color: var(--preview);
}

.messages-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

/* Sections */

.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
}

.wrap {
  width: min(100% - 2 * var(--gutter), 78rem);
  margin-inline: auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: end;
  gap: 1rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-intro {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--scene);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.shot figcaption {
  max-width: 70ch;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Build panel */

.build-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  align-items: start;
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.panel {
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.panel-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

:root:not(.js) .tabs {
  display: none;
}

.tab[aria-selected="true"] {
  background: var(--panel-raised);
  border-color: var(--line-strong);
  font-weight: 600;
}

.tab-heading {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.js .tab-heading {
  display: none;
}

.tab-panel + .tab-panel {
  margin-top: 0.5rem;
}

.js .tab-panel + .tab-panel {
  margin-top: 0;
}

.rows {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.row-name {
  margin: 0;
  font-weight: 600;
}

.row-text {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.row-side {
  margin: 0;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-side span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.row-wares {
  display: flex;
  gap: 0.3rem;
}

.tab-note {
  max-width: 65ch;
  margin: 0.9rem 0.25rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Isometric block icons, lit like the renderer: bright top, mid left, dark right. */
.iso {
  --t: color-mix(in oklab, var(--c) 78%, white);
  --l: var(--c);
  --r: color-mix(in oklab, var(--c) 66%, black);
  width: 2.75rem;
  height: auto;
  overflow: visible;
}

.iso-t {
  fill: var(--t);
}

.iso-l {
  fill: var(--l);
}

.iso-r {
  fill: var(--r);
}

.iso-ground {
  fill: var(--g);
}

.iso-water {
  fill: #3373bf;
}

.iso-crate {
  fill: #e0b85c;
  stroke: #8a6a2a;
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.iso-bay {
  fill: #9a9aa2;
}

.iso-seam {
  fill: none;
  stroke: rgb(0 0 0 / 0.28);
  stroke-width: 0.8;
}

.iso-line {
  fill: none;
  stroke: #d8d2b0;
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.iso-furrow {
  fill: none;
  stroke: #3b6a26;
  stroke-width: 1.4;
}

.iso-repair {
  fill: none;
  stroke: #fa8019;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* Product tiles drawn like the dataset's generated icons: rim, diagonal stripes. */
.ware {
  --c: #888;
  display: inline-block;
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid color-mix(in srgb, var(--c) 55%, black);
  border-radius: 5px;
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--c) 80%, white) 0 3px,
    var(--c) 3px 6px
  );
  vertical-align: middle;
}

.w-tonerde {
  --c: #a87040;
}

.w-quarzkies {
  --c: #c8c8be;
}

.w-ziegenmilch {
  --c: #f5f0dc;
}

.w-rohwolle {
  --c: #dccdaa;
}

.w-kaeselaib {
  --c: #ebbe3c;
}

.w-wollgarn {
  --c: #465096;
}

.w-tonziegel {
  --c: #aa4632;
}

.w-glasflasche {
  --c: #5aaaaa;
}

.w-wolldecke {
  --c: #783c6e;
}

.w-milchflasche {
  --c: #c8dcf0;
}

.w-kartoffeln {
  --c: #c4a45c;
}

.facts h3 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
}

.fact-list {
  margin: 0;
}

.fact-list > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.fact-list dt {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.fact-list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Stress test band */

.bench {
  position: relative;
  background: var(--scene);
  border-block: 1px solid var(--line);
}

.bench > img {
  display: block;
  width: 100%;
  height: clamp(26rem, 60vw, 50rem);
  object-fit: cover;
}

.bench-note {
  position: absolute;
  left: var(--gutter);
  bottom: var(--gutter);
  max-width: 34rem;
}

.bench-note h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
}

.bench-note p {
  margin: 0;
  color: var(--muted);
}

/* Messages in detail */

.report {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.report-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.code {
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.report-bar .code {
  margin-left: auto;
}

.report h3 {
  margin: 0.5rem 0 1.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.report-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.report-flip .report-text {
  order: 2;
}

.report-stack .report-body {
  grid-template-columns: minmax(0, 1fr);
}

.report-stack .report-text {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0 clamp(1.5rem, 4vw, 4rem);
}

.report-lede {
  max-width: 60ch;
  margin: 0 0 1.25rem;
  font-size: 1.1875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.points {
  display: grid;
  gap: 0.6rem;
  max-width: 60ch;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding-left: 1.3rem;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--muted);
  transform: scaleY(0.55) rotate(45deg);
}

.proof {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 0.45rem 0.7rem;
  background: var(--scene);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #d9d5cc;
  font-size: 0.8125rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.shot-tall {
  max-width: 30rem;
  justify-self: center;
}

.chains {
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chains-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.chain-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
  font-size: 0.9375rem;
}

.good {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.to,
.plus {
  display: inline-block;
  flex: none;
  width: 1.1rem;
  height: 0.8rem;
  background: no-repeat center / contain;
}

.to {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M1 6h15M11 1.5 16 6l-5 4.5' fill='none' stroke='%23a8a49b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plus {
  width: 0.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.5v9M1.5 6h9' fill='none' stroke='%23a8a49b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.shop {
  padding: 0.05rem 0.5rem;
  background: rgb(64 128 204 / 0.2);
  border: 1px solid rgb(64 128 204 / 0.6);
  border-radius: 3px;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Roadmap as build preview: dashed ghosts, the next one in preview green. */

.preview-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview {
  display: grid;
  grid-template-columns: 4rem minmax(9rem, 13rem) minmax(0, 1fr) 8rem;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 1.25rem;
  background: rgb(255 255 255 / 0.015);
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
}

.preview .code {
  justify-self: start;
}

.preview h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.1;
}

.preview p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

.preview .state {
  justify-self: end;
}

.preview.is-next {
  background: rgb(64 217 89 / 0.06);
  border-color: rgb(64 217 89 / 0.7);
}

/* Close */

.close {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(28rem, 72vh, 46rem);
  padding: var(--gutter);
  overflow: hidden;
  background: var(--scene);
  border-top: 1px solid var(--line);
}

.close > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-toast {
  position: relative;
  max-width: 30rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.close-toast h2 {
  margin: 0.3rem 0 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
}

.close-toast p:not(.msg-meta) {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

/* Footer */

.foot {
  padding-block: 2.5rem 3rem;
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr);
  gap: 1.25rem 3rem;
}

.foot p {
  margin: 0;
  max-width: 65ch;
}

.foot-brand .wordmark {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1.75rem;
}

.foot-small {
  grid-column: 1 / -1;
}

/* Responsive */

@media (max-width: 75rem) {
  .hud-sub,
  .hud-readout .hud-count {
    display: none;
  }
}

@media (max-width: 64rem) {
  .section-head,
  .build-grid,
  .report-body,
  .report-stack .report-text {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-flip .report-text {
    order: 0;
  }

  .shot-tall {
    justify-self: start;
  }

  .preview {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  }

  .preview p {
    grid-column: 2 / -1;
  }

  .preview .state {
    grid-column: 3;
    grid-row: 1;
  }

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

@media (max-width: 56rem) {
  .hud-nav {
    display: none;
  }

  .lang-switch {
    margin-left: auto;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .map {
    display: flex;
    flex-direction: column;
  }

  .map-view {
    --focus-x: 0.5;
    --focus-y: 0.5;
    position: relative;
    inset: auto;
    aspect-ratio: 4 / 3;
    max-height: 70svh;
    width: 100%;
  }

  .map-title {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    margin-top: -1.9rem;
    padding: 0 var(--gutter) var(--gutter);
  }

  .city-label {
    font-size: clamp(2.5rem, 11vw, 4rem);
  }

  .messages {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .msg-list {
    overflow: visible;
  }

  .bench-note {
    position: relative;
    left: auto;
    bottom: auto;
    max-width: none;
    margin: -3rem var(--gutter) var(--gutter);
  }
}

@media (max-width: 36rem) {
  .hud-readout {
    display: none;
  }

  .row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .row-side {
    grid-column: 2;
    text-align: left;
  }

  .fact-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .messages-sub {
    margin-left: 0;
    width: 100%;
  }
}

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

  .camera.is-moving,
  .marker,
  .marker.is-on,
  .btn,
  .msg {
    transition: none;
  }
}
