@font-face {
  font-family: MenuDisplay;
  src: url(fonts/jersey.woff2) format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: MenuText;
  src: url(fonts/pixelify.woff2) format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
/* A small game world inside the existing tube. No changes to the room image. */
.screen {
  background: radial-gradient(ellipse at 50% 48%, #20322ce8, #091412f7 82%);
}
.screen-inner {
  --cream: #d2ddbf;
  --muted: #94ab94;
  --select: #c2da98;
  isolation: isolate;
  font-family: MenuText, Pixel, monospace;
  font-synthesis: none;
  text-shadow: 0 0 2px #bddb9238;
}
.screen-inner::before {
  content: "";
  position: absolute;
  inset: 8% -3%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 63%, #71998b13, transparent 60%);
}
.screen-top {
  height: 7%;
  border: 0;
  padding-bottom: 0;
  gap: 0.55cqw;
}
.home-key {
  font-family: Pixel, monospace;
  font-size: 0.78cqw;
}
.screen-footer {
  height: 8%;
  border-color: #91a88c24;
  padding-top: 1.4%;
  font-family: Pixel, monospace;
  font-size: 0.58cqw;
  gap: 0.6cqw;
}
.screen-footer button,
#sound {
  font-family: Pixel, monospace;
  font-size: 0.58cqw;
}
#content {
  padding: 0.45cqw 0 0.4cqw;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
  justify-content: flex-start;
}
.masthead {
  flex: none;
  position: relative;
  padding: 0.45cqw 0 0.9cqw;
}
.masthead h1 {
  font:
    400 1.35cqw/1.2 MenuDisplay,
    Pixel,
    monospace;
  text-align: center;
  color: #aabb9f;
  letter-spacing: 0.01em;
}
.chapter-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1cqw;
  flex: none;
  min-height: 2.6cqw;
}
.eyebrow {
  font:
    400 0.56cqw/1.2 MenuText,
    Pixel,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #91a289;
  margin-bottom: 0.28cqw;
}
.chapter-top h1 {
  font:
    400 1.85cqw/1.02 MenuDisplay,
    Pixel,
    monospace;
  letter-spacing: 0.005em;
  color: var(--cream);
  text-shadow:
    0 1px 0 #050e0b,
    0 0 4px #bad09e22;
}
.model-stage {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 5.9cqw;
  width: 100%;
  margin: 0;
  overflow: visible;
}
.object-menu {
  --object-layout: horizontal;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.model-stage::before {
  content: "";
  position: absolute;
  inset: 35% 5% 0;
  background: radial-gradient(ellipse at center, #849c6530, transparent 65%);
  opacity: 0.55;
  pointer-events: none;
}
.object-world {
  position: absolute;
  /* Positioned against the screen, outside scrolling layout, by ObjectScene. */
  z-index: 0;
  pointer-events: none;
}
.object-world canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.object-world.lost {
  display: none;
}
.object-targets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: absolute;
  inset: 0;
  z-index: 1;
  gap: 0;
}
.object-hit {
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  outline-offset: -4px;
}

.object-labels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6cqw;
  flex: none;
  padding: 0.3cqw 0 0.5cqw;
}
.object-choice {
  position: relative;
  text-align: center;
  font:
    400 1.12cqw/1.06 MenuDisplay,
    Pixel,
    monospace;
  color: #97a58d;
  min-height: 1.85cqw;
  padding: 0.35cqw 0.12cqw 0.3cqw;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  border: 0;
  background: none;
  transition: color 0.18s;
}
.object-choice::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 40%;
  right: 40%;
  height: 2px;
  background: #b7ce91;
  opacity: 0;
  box-shadow: 0 0 5px #bedc8870;
}
.object-choice.active {
  color: #e0e7c6;
}
.object-choice.active::after {
  opacity: 0.9;
}

.object-choice small {
  display: block;
  font:
    400 0.63cqw/1.3 MenuText,
    Pixel,
    monospace;
  color: #8e9d84;
  margin-top: 0.2cqw;
  letter-spacing: 0.03em;
}
.nav-back {
  font:
    400 0.65cqw/1.2 MenuText,
    Pixel,
    monospace;
  color: #a9b89c;
  display: inline-flex;
  gap: 0.3cqw;
  align-items: center;
  min-height: 1.4cqw;
  flex: none;
}
.nav-back svg {
  width: 0.65cqw;
  height: 0.65cqw;
  stroke-width: 1.8;
}
.nav-back.game-selected {
  color: #d7e2bd;
}
.chapter-top .nav-back {
  align-self: center;
}
.game-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .55em;
  font: 400 .98cqw/1.1 MenuDisplay, Pixel, monospace;
  color: #d4dfb4;
  padding: .38cqw .7cqw .4cqw;
  min-height: 1.7cqw;
  background: transparent;
  border: 0;
  text-decoration: none;
}
.game-action::before {
  content: "";
  width: .45em;
  height: .65em;
  flex: none;
  background: currentColor;
  clip-path: polygon(0 0, 30% 0, 30% 15%, 60% 15%, 60% 30%, 100% 50%, 60% 70%, 60% 85%, 30% 85%, 30% 100%, 0 100%);
}
.game-action.game-selected {
  background: #9ab87c18;
  color: #e1ebc6;
  text-shadow: 0 0 5px #b6d79d40;
}
.game-action:active { background: #9ab87c28; }
.contact-scene {
  display: grid;
  grid-template-columns: 33% 1fr;
  gap: 5%;
  flex: 1;
  min-height: 0;
}
.contact-scene .model-stage {
  min-height: 0;
  height: 100%;
}
.service-options {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 0.2cqw;
}
.service-explanation {
  padding: 0.45cqw 0 0.3cqw;
  font:
    400 0.87cqw/1.35 MenuText,
    Pixel,
    monospace;
  color: #b7c6ab;
  min-height: 2.7cqw;
  flex: none;
}
.contact-copy {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55cqw;
}
.contact-name {
  font:
    400 1.95cqw/1 MenuDisplay,
    Pixel,
    monospace;
  letter-spacing: 0;
  color: #d9e0c3;
}
.contact-role {
  display: block;
  font:
    400 0.76cqw/1.35 MenuText,
    Pixel,
    monospace;
  color: #94a48a;
}
.contact-copy p {
  font:
    400 0.94cqw/1.4 MenuText,
    Pixel,
    monospace;
  color: #bbc7ac;
  margin: 0.2cqw 0;
}
.contact-email {
  font:
    400 0.68cqw MenuText,
    Pixel,
    monospace;
  color: #9fb192;
  min-height: 1.3cqw;
  display: flex;
  align-items: center;
}
#film-error {
  font:
    400 0.65cqw/1.2 MenuText,
    Pixel,
    monospace;
  color: #dbba8c;
}
.fallback-objects {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: space-around;
  font:
    400 4cqw MenuText,
    Pixel,
    monospace;
  color: #afc893;
}
.has-webgl:not(.no-webgl) .fallback-objects {
  display: none;
}
.no-webgl .model-stage::before {
  opacity: 0.8;
}
body.powered-off .object-world {
  visibility: hidden;
}
#content h1:focus {
  outline: none;
}


@media (max-width: 700px), (max-height: 500px) {
  body:not(.zoomed) .masthead h1 {
    font-size: 1.35cqw;
  }
  body:not(.zoomed) .object-choice {
    font-size: 1.15cqw;
    min-height: 2.4cqw;
  }
  body:not(.zoomed) .screen-footer {
    height: 10%;
  }
  body:not(.zoomed) #sound,
  body:not(.zoomed) .screen-footer button {
    font-size: 0.8cqw;
  }

  body.zoomed .screen-inner {
    inset: 4% 5%;
  }
  body.zoomed .screen-top {
    height: 44px;
    flex: none;
  }
  body.zoomed #content {
    padding: 20px 0 12px;
    overflow-y: auto;
  }
  body.zoomed .screen-footer {
    height: 44px;
    font-size: 12px;
    gap: 10px;
    flex: none;
  }
  body.zoomed .screen-footer button,
  body.zoomed #sound {
    font-size: 12px;
    min-height: 44px;
  }
  body.zoomed .masthead {
    padding: 8px 0 20px;
  }
  body.zoomed .masthead h1 {
    font-size: 22px;
    line-height: 1.45;
    max-width: 95%;
    margin: auto;
  }
  body.zoomed .model-stage {
    min-height: 150px;
    flex: 1;
  }
  body.zoomed .object-menu {
    --object-layout: vertical;
    position: relative;
    min-height: 310px;
    max-height: 380px;
    flex: 1;
    margin: 16px 0;
  }
  body.zoomed .object-menu .model-stage {
    position: absolute;
    inset: 0;
    min-height: 0;
    height: 100%;
  }
  body.zoomed .object-targets {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
  }
  body.zoomed .object-labels {
    position: absolute;
    left: 42%;
    right: 0;
    top: 0;
    bottom: 0;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    padding: 0;
    pointer-events: auto;
  }
  body.zoomed .object-choice {
    font-size: 21px;
    line-height: 1.12;
    min-height: 58px;
    padding: 8px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
  body.zoomed .object-choice::after {
    left: 0;
    right: auto;
    bottom: 15%;
    width: 20px;
    height: 1px;
  }
  body.zoomed .object-choice small {
    font-size: 13px;
    margin-top: 6px;
  }
  body.zoomed .chapter-top {
    min-height: 65px;
    gap: 15px;
  }
  body.zoomed .chapter-top h1 {
    font-size: 30px;
    line-height: 1.04;
    margin-bottom: 12px;
  }
  body.zoomed .eyebrow {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  body.zoomed .nav-back {
    font-size: 14px;
    min-height: 44px;
    gap: 6px;
  }
  body.zoomed .nav-back svg {
    width: 12px;
    height: 12px;
  }
  body.zoomed .game-action {
    font-size: 20px;
    min-height: 46px;
    padding: 10px 12px;
    gap: 10px;
  }
  body.zoomed .service-options {
    gap: 10px;
  }
  body.zoomed .service-explanation {
    font-size: 16px;
    line-height: 1.5;
    min-height: 100px;
    padding: 20px 0;
  }
  body.zoomed .contact-scene {
    grid-template-columns: 24% 1fr;
    gap: 7%;
    min-height: 340px;
    flex: 1;
  }
  body.zoomed .contact-scene .model-stage {
    min-height: 0;
    height: 200px;
    align-self: center;
  }
  body.zoomed .contact-name {
    font-size: 36px;
  }
  body.zoomed .contact-role {
    font-size: 14px;
    line-height: 1.4;
  }
  body.zoomed .contact-copy {
    gap: 13px;
  }
  body.zoomed .contact-copy p {
    font-size: 17px;
    line-height: 1.5;
    margin: 8px 0;
  }
  body.zoomed .contact-email {
    font-size: 15px;
    min-height: 44px;
    overflow-wrap: anywhere;
  }
  body.zoomed #film-error {
    font-size: 14px;
  }
  body.zoomed .fallback-objects {
    font-size: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .object-choice {
    transition: none;
  }
}
/* Shared control and evidence components, independent of the room photograph. */
.screen-top button {
  min-width: 26px;
  min-height: 26px;
}
.screen-footer button {
  min-width: 26px;
  min-height: 26px;
}
#sound {
  white-space: nowrap;
}
.screen-footer {
  gap: 0.25cqw;
}
.case-steps {
  margin: 0;
  padding-left: 1.3em;
  font:
    400 0.84cqw/1.4 MenuText,
    monospace;
  color: #becdb1;
}
.case-steps li + li {
  margin-top: 0.2cqw;
}
.contact-role,
.object-choice small {
  color: #acbca1;
}
.object-choice:active,
.game-action:active {
  color: #e6edd0;
}
.object-choice.active::after {
  height: 2px;
  background: #d1e3af;
}
.fallback-objects svg {
  width: 26%;
  height: 70%;
  stroke: #b9c8a4;
  stroke-width: 1.5;
  fill: #43523c22;
}
.fallback-page {
  font:
    16px/1.5 MenuText,
    monospace;
  padding: 10px 0;
}
.fallback-page h1 {
  font:
    30px/1.1 MenuDisplay,
    monospace;
  margin-bottom: 16px;
}
.fallback-page h2 {
  margin: 18px 0 10px;
  font:
    23px MenuDisplay,
    monospace;
}
.fallback-page p {
  margin: 12px 0;
}
.fallback-page a {
  display: inline-flex;
  text-decoration: underline;
  align-items: center;
  min-height: 44px;
}
.fallback-page .game-action { font-size: 20px; text-decoration: none; }
.fallback-page ul {
  padding-left: 20px;
}
.fallback-page details summary {
  min-height: 44px;
}
body:not(.ready) .screen-top button,
body:not(.ready) .screen-footer,
body:not(.ready) .power-switch,
body:not(.ready) .desk-caption button {
  visibility: hidden;
}
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .screen-top button,
  body.zoomed .screen-footer button {
    min-width: 44px;
    min-height: 44px;
  }
  body.zoomed .screen-footer {
    gap: 0;
    font-size: 12px;
  }
  body.zoomed .languages {
    gap: 0;
  }
  body.zoomed #sound {
    font-size: 11px;
  }
  body.zoomed .home-key {
    font-size: 14px;
  }
  body.zoomed .case-steps {
    font-size: 16px;
    line-height: 1.5;
  }
  body.zoomed .case-steps li + li {
    margin-top: 10px;
  }
  body.zoomed .contact-scene {
    min-height: 300px;
  }
  body.zoomed .screen-inner {
    inset: 2% 4%;
  }
  body.zoomed #content {
    padding: 16px 0;
    scroll-padding: 16px;
  }
}
@media (max-height: 500px) and (min-width: 701px) {
  body.zoomed .screen {
    top: 2%;
    height: 84%;
    max-width: 760px;
    left: 50%;
    transform: translateX(-50%);
  }
  body.zoomed .object-menu {
    min-height: 250px;
  }
  body.zoomed .screen-inner {
    inset: 1% 4%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-action,
  .object-choice {
    transition: none;
  }
}

/* System controls use the original bitmap face, separate from game copy. */
.screen-footer .languages {
  align-items: center;
}
.screen-footer .languages button {
  display: grid;
  place-items: center;
  line-height: 1;
}
.language-divider {
  display: grid;
  place-items: center;
  align-self: stretch;
  font: inherit;
  line-height: 1;
  opacity: 0.5;
}
#sound {
  display: grid;
  place-items: center;
  margin-left: auto;
}
#sound .sound-icon {
  width: 1.15cqw;
  height: 1.15cqw;
  fill: currentColor;
  stroke: none;
}
#sound[aria-pressed="true"] .sound-muted,
#sound[aria-pressed="false"] .sound-waves {
  display: none;
}
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .screen-footer,
  body.zoomed .screen-footer button {
    font-size: 10px;
  }
  body.zoomed #sound .sound-icon {
    width: 22px;
    height: 22px;
  }
}

.screen-top .home-key {
  display: flex;
  align-items: center;
  margin-right: auto;
}
.screen-top .crt-wordmark {
  width: 7.2cqw;
  background: #c3d9aa;
  opacity: 0.92;
  filter: none;
}
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .screen-top .crt-wordmark {
    width: 136px;
    max-width: 45vw;
  }
}

/* Home hierarchy: heading and object selection, with room above the controls. */
@media (min-width: 701px) and (min-height: 501px) {
  #content:has(.masthead) {
    gap: 0.4cqw;
  }
  .masthead {
    padding: 0.65cqw 0 0.55cqw;
  }
  .masthead + .object-menu .object-labels {
    padding-bottom: 0.65cqw;
  }
  .masthead + .object-menu {
    margin: 0.65cqw 0 1.6cqw;
  }
}

@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .masthead + .object-menu {
    margin-block: auto;
  }
}

/* Project objects can cross the layout gutter; the CRT glass is their boundary. */
body[data-page="projects"] #content {
  overflow: visible;
}
body[data-page="projects"] .chapter-top h1 {
  font-size: 1.5cqw;
}
body[data-page="projects"] .object-menu {
  margin-top: 0.55cqw;
}
body[data-page="projects"] .object-choice {
  font-size: 0.98cqw;
  line-height: 1.14;
}
body[data-page="projects"] .object-choice small {
  color: #94a58c;
  margin-top: 0.3cqw;
  font-size: 0.58cqw;
}
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed[data-page="projects"] .chapter-top h1 {
    font-size: 26px;
  }
  body.zoomed[data-page="projects"] .object-menu {
    margin-top: 20px;
  }
  body.zoomed[data-page="projects"] .object-choice {
    font-size: 21px;
  }
  body.zoomed[data-page="projects"] .object-choice small {
    font-size: 12px;
    margin-top: 8px;
  }
}
body[data-page="services"] #content {
  overflow: visible;
}
/* Small-height layouts keep scrolling. Extend its horizontal viewport to the
   glass edge, retaining the same content alignment with matching padding. */
@media (max-width: 700px) and (max-height: 760px), (max-height: 500px) {
  body.zoomed:is([data-page="projects"], [data-page="services"]) #content {
    overflow: auto;
    margin-inline: -4.348%;
    padding-inline: 4.348%;
  }
}

/* Centre only the object-and-options group; preserve heading alignment. */

/* All descriptions share a grid cell. Invisible copies reserve the longest
   translated text at the current width, keeping the object stage stationary. */
.service-explanations {
  display: grid;
  flex: none;
}
.service-explanations > .service-explanation {
  grid-area: 1 / 1;
}
.service-measure {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
.monitor-hint {
  position: fixed;
  z-index: 20;
  display: flex;
  align-items: center;
  width: min(280px, calc(100vw - 32px));
  min-height: 48px;
  padding: 6px;
  gap: 8px;
  background: #0b160ff2;
  border: 1px solid #68775a;
  box-shadow: 3px 3px 0 #0008;
  color: #c2cda8;
  font: 400 14px/1.35 MenuText, Pixel, monospace;
}
.monitor-hint p { flex: 1; }
#monitor-hint-text {
  min-height: 44px;
  text-align: left;
  font-family: MenuDisplay, Pixel, monospace;
  font-size: 19px;
  line-height: 1.05;
}
.monitor-hint .hint-face {
  width: 54px;
  height: 54px;
  flex: none;
  stroke: none;
  color: #929567;
}
.hint-eyes {
  transform-box: fill-box;
  transform-origin: center;
}
.monitor-hint:not([hidden]) .hint-eyes {
  animation: hint-blink 4s ease-in-out 1;
}
@keyframes hint-blink {
  0%, 65%, 83%, 100% { transform: scaleY(1); }
  73% { transform: scaleY(.08); }
}
#zoom .zoom-glasses {
  width: 1.15cqw;
  height: auto;
  aspect-ratio: 48 / 28;
  stroke: none;
}
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed #zoom .zoom-glasses { width: 3.15cqw; }
}
@media (prefers-reduced-motion: reduce) {
  .monitor-hint:not([hidden]) .hint-eyes { animation: none; }
}
#dismiss-monitor-hint {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
}
#dismiss-monitor-hint svg { width: 16px; height: 16px; }
.monitor-hint .hint-pointer {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 #000);
}

.monitor-hint .hint-pointer.points-up { top: auto; bottom: 100%; transform: scaleY(-1); }

/* Services inventory: one stage, four labelled objects, explanation below. */
.service-inventory {
  position: relative;
  flex: 1;
  min-height: 8.5cqw;
  width: 100%;
}
.service-inventory .model-stage { height: 100%; min-height: 0; touch-action: pan-y; }

.service-inventory .service-options {
  position: absolute;
  inset: 0;
  display: block;
  align-self: stretch;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.inventory-option {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
  font: 400 0.8cqw/1.05 MenuDisplay, Pixel, monospace;
  color: #8eaa92;
  text-align: center;
  padding: 0 0 0.35cqw;
  transition: color 160ms;
}
.inventory-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1em;
  text-wrap: balance;
}
.inventory-option[aria-pressed="true"] { color: #dce6b9; }
.inventory-option[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(50% - 0.65cqw);
  width: 1.3cqw;
  height: 1px;
  background: #c5d8a0;
  box-shadow: 0 0 5px #c5d8a044;
}
.inventory-option.game-selected { color: #e2ebc7; }
.inventory-arrows {
  position: absolute;
  inset: 48% 0 auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 20;
}
.inventory-arrows button {
  pointer-events: auto;
  color: #c3c093;
  font: 400 2cqw/1 MenuText, Pixel, monospace;
  width: 1.6cqw;
  height: 2cqw;
}
.inventory-arrows button.game-selected { color: #e4ebbc; }
.inventory-description { flex: none; text-align: center; padding-top: 0.7cqw; }
.inventory-description .service-explanation {
  font-size: 0.79cqw;
  line-height: 1.3;
  padding: 0;
  min-height: 2.1cqw;
}
.no-webgl .service-inventory .service-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7cqw;
  position: relative;
}
.no-webgl .inventory-option {
  position: relative;
  min-height: 2.7cqw;
  border: 1px solid #96ac6e44;
}
.no-webgl .inventory-arrows { display: none; }
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed[data-page="services"] #content { overflow-y: auto; overflow-x: hidden; }
  body.zoomed .service-inventory { min-height: 300px; flex: 1; }
  body.zoomed .service-inventory .model-stage { min-height: 300px; }
  body.zoomed .inventory-option { font-size: 18px; padding-bottom: 8px; }
  body.zoomed .inventory-option[aria-pressed="true"]::after {
    left: calc(50% - 14px); width: 28px;
  }
  body.zoomed .inventory-arrows { inset: auto 0 -22px; }
  body.zoomed .inventory-arrows button { font-size: 32px; width: 44px; height: 44px; }
  body.zoomed .inventory-description { padding-top: 36px; }
  body.zoomed .inventory-description .service-explanation { font-size: 17px; line-height: 1.3; min-height: 66px; padding: 0; }
  body.zoomed.no-webgl .inventory-option { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .inventory-option { transition: none; }
}

/* The selected tool leads; headings and system controls stay in the background. */
.inventory-heading { align-items: center; min-height: 1.6cqw; }
.inventory-heading h1 {
  font: 400 .62cqw/1.3 MenuText, Pixel, monospace;
  letter-spacing: .06em;
  color: #8fa18b;
}
.inventory-option { color: #83937f; }
.inventory-option[aria-pressed="true"] { color: #dce6b9; }
.inventory-arrows { inset-inline: -.25cqw; }
.inventory-arrows button {
  display: grid;
  place-items: center;
  font-size: 1.35cqw;
  width: 2.2cqw;
  height: 2.2cqw;
  color: #879879;
}
.inventory-description { padding: .8cqw 5% .6cqw; }
.inventory-description .service-explanation { color: #a3b09a; font-size: .74cqw; }
body:not([data-page="home"]) :is(.screen-top, .screen-footer, .nav-back) { opacity: .72; }
body:not([data-page="home"]) :is(.screen-top, .screen-footer, .nav-back):is(:hover, :focus-within) { opacity: 1; }
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .inventory-heading { min-height: 44px; }
  body.zoomed .inventory-heading h1 { font-size: 14px; line-height: 1.3; }
  body.zoomed .inventory-arrows button { font-size: 25px; }
  body.zoomed .inventory-description { padding: 36px 3% 16px; }
  body.zoomed .inventory-description .service-explanation { font-size: 16px; }
}

/* Secondary screens share the inventory's quiet navigation hierarchy. */
.menu-heading { align-items: center; min-height: 1.6cqw; }
.menu-heading h1, body[data-page="projects"] .menu-heading h1 {
  font: 400 .62cqw/1.3 MenuText, Pixel, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8fa18b;
}
body[data-page="projects"] .object-choice:not(.active) { color: #83937f; }
body[data-page="projects"] .object-choice small { color: #82917d; }
body[data-page="projects"] .object-choice.active small { color: #a5b397; }
.case-steps { font-size: .74cqw; color: #a3b09a; line-height: 1.45; }
.case-steps li::marker { color: #75866d; }
.contact-copy p { font-size: .8cqw; color: #a3b09a; }
.contact-role { color: #8c9d83; }
.contact-email { color: #8c9d83; }
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .menu-heading { min-height: 44px; }
  body.zoomed .menu-heading h1, body.zoomed[data-page="projects"] .menu-heading h1 { font-size: 14px; line-height: 1.3; }
  body.zoomed .case-steps { font-size: 15px; }
  body.zoomed .contact-copy p { font-size: 17px; }
}

/* Keep the three workflow steps visible in the embedded desktop monitor. */

/* Direction glyphs share the stepped silhouette of the menu selection marker. */
.nav-back svg { fill: currentColor; stroke: none; }
.inventory-arrow { width: .45em; height: .65em; background: currentColor; clip-path: polygon(0 0,30% 0,30% 15%,60% 15%,60% 30%,100% 30%,100% 70%,60% 70%,60% 85%,30% 85%,30% 100%,0 100%); }
[data-cycle="-1"] .inventory-arrow { transform: rotate(180deg); }

/* Selection feedback belongs to each game control, not a second focus box. */
html.game-selection .screen-inner :is(a, button, input[type="range"]):focus { outline: none; }
.screen-inner :is(.home-key, #zoom, .languages button, .system-icon, #sound, .nav-back, .contact-email, .inventory-arrows button) {
  transition: color 120ms steps(2, end), text-shadow 120ms steps(2, end);
}
.screen-inner :is(.home-key, #zoom, .languages button, .system-icon, #sound, .nav-back, .contact-email, .inventory-arrows button).game-selected {
  color: #e0edbd;
  opacity: 1;
  text-shadow: 0 0 3px #c4e493a0, 0 0 7px #c4e49350;
}
.home-key.game-selected .crt-wordmark { background: #e0edbd; opacity: 1; }
:is(#zoom, #sound, .system-icon, .nav-back, .inventory-arrows button).game-selected svg,
.inventory-arrows button.game-selected .inventory-arrow {
  filter: drop-shadow(0 0 2px #c4e49390);
}
.nav-back.game-selected svg { translate: -2px 0; }
.game-action::before { opacity: 0; }
.game-action.game-selected::before { opacity: 1; }
.contact-email.game-selected { text-decoration: underline; text-underline-offset: .2em; }
@media (prefers-reduced-motion: reduce) {
  .screen-inner :is(a, button, input) { transition: none; }
}
@media (forced-colors: active) {
  html.game-selection .screen-inner :is(a, button, input):focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* The profile is a secondary choice beside the enquiry, above the email. */
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .2cqw .55cqw; max-width: 100%; }
.contact-actions .game-action { font-size: .85cqw; padding-inline: .35cqw; white-space: nowrap; }

@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .contact-actions { gap: 4px 12px; }
  body.zoomed .contact-actions .game-action { font-size: 18px; min-height: 44px; padding: 8px 4px; }
}

/* Give the three Home objects and their labels the same extra room on tall,
   medium-width portrait displays. The camera derives its framing from this stage. */
@media (min-width: 431px) and (max-width: 700px) and (orientation: portrait) {
  body.zoomed[data-page="home"] .object-menu {
    max-height: clamp(380px, min(93vw, 57svh), 615px);
  }
  body.zoomed[data-page="home"] .object-choice { font-size: clamp(21px, 4.3vw, 29px); }
  body.zoomed[data-page="home"] .object-choice small { font-size: clamp(13px, 2.6vw, 18px); }
}

/* Give the canvas stable tracks independent of wrapping captions. Resizing a
   content-sized stage could clear its last static WebKit frame in reduced motion. */
@media (orientation: portrait) and (max-width: 700px) {
  body.zoomed[data-page="services"] #content {
    display: grid; grid-template-rows: auto minmax(0, 1fr) max(108px, 23%);
    padding-block: 4px; overflow: visible;
  }
  body.zoomed .service-inventory { min-height: 0; }
  body.zoomed .service-inventory .model-stage { min-height: 0; height: calc(100% - 36px); }
  body.zoomed .inventory-description { padding: 6px 3%; overflow: auto; }
  body.zoomed .service-measure { display: none; }
  body.zoomed .inventory-arrows { inset: auto 0 -36px; }
}
@media (orientation: portrait) and (max-width: 700px) and (max-height: 760px) {
  body.zoomed[data-page="services"] #content { grid-template-rows: auto minmax(0, 1fr) 37%; }
  body.zoomed .inventory-option { font-size: 15px; }
}

/* A rotated handset is a wide menu. Its scene uses the same geometry contract
   as the labels and hit targets, through --object-layout. */
@media (orientation: landscape) and (max-height: 500px) {
  body.zoomed:is([data-page="home"], [data-page="services"], [data-page="contact"], [data-page="about"]) #content { padding-block: 0; }
  body.zoomed[data-page="home"] .masthead { padding: 0 0 3px; }
  body.zoomed[data-page="home"] .masthead h1 { font-size: 18px; }
  body.zoomed[data-page="home"] .object-menu {
    --object-layout: horizontal;
    min-height: 0; max-height: none; margin: 0; width: 100%;
  }
  body.zoomed[data-page="home"] .object-menu .model-stage { position: relative; height: auto; }
  body.zoomed[data-page="home"] :is(.object-targets, .object-labels) {
    grid-template: 1fr / repeat(3, minmax(0, 1fr));
  }
  body.zoomed[data-page="home"] .object-labels { position: relative; inset: auto; }
  body.zoomed[data-page="home"] .object-choice {
    align-items: center; text-align: center; padding: 2px 0 5px; min-height: 44px; font-size: 17px;
  }
  body.zoomed[data-page="home"] .object-choice small { font-size: 11px; margin-top: 2px; }
  body.zoomed[data-page="home"] .object-choice::after { left: calc(50% - 10px); bottom: 1px; }

  body.zoomed[data-page="services"] #content {
    display: grid; margin-inline: 0; padding-inline: 0;
    grid-template: auto minmax(0, 1fr) / minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0 10px;
  }
  body.zoomed .inventory-heading { grid-column: 1 / -1; }
  body.zoomed .service-inventory { --inventory-layout: landscape; }
  body.zoomed .service-inventory, body.zoomed .service-inventory .model-stage { min-height: 0; }
  body.zoomed .service-inventory .model-stage { height: calc(100% - 36px); }
  body.zoomed .inventory-option[data-behind] span { opacity: 0; }
  body.zoomed:not(.has-webgl) .inventory-option span { opacity: 1; }
  body.zoomed .inventory-option { font-size: 13px; padding-bottom: 2px; }
  body.zoomed .inventory-arrows { inset: auto 0 -36px; }
  body.zoomed .inventory-description {
    align-self: center; max-height: 100%; overflow: auto; padding: 0 4px;
    text-align: left;
  }
  body.zoomed .inventory-description .service-explanation { font-size: 15px; min-height: 0; }
  body.zoomed .service-measure { display: none; }

  body.zoomed .contact-scene { grid-template-columns: 17% 1fr; min-height: 0; gap: 3%; align-items: start; flex: none; }
  body.zoomed .contact-scene .model-stage { height: clamp(88px, 29svh, 144px); align-self: start; }
  body.zoomed .contact-copy {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  }
  body.zoomed .contact-name { font-size: 25px; }
  body.zoomed .contact-actions { grid-column: 2; grid-row: 1 / 3; flex-direction: column; align-items: start; gap: 0; }
  body.zoomed .contact-copy p { grid-column: 1; font-size: 15px; margin: 0; line-height: 1.32; }
  body.zoomed .contact-email { grid-column: 1 / -1; }
}

@media (orientation: portrait) and (max-width: 700px) and (max-height: 700px) {
  body.zoomed[data-page="home"] #content { padding-block: 4px; }
  body.zoomed[data-page="home"] .object-menu { min-height: 225px; margin-block: 4px; }
  body.zoomed[data-page="contact"] #content { padding-block: 4px; }
  body.zoomed .contact-scene {
    flex: none; min-height: 0; grid-template-columns: 62px minmax(0, 1fr);
    align-content: center; align-items: center; gap: 8px 12px; margin-block: auto;
  }
  body.zoomed .contact-scene .model-stage { height: 76px; }
  body.zoomed .contact-copy { display: contents; }
  body.zoomed .contact-copy :is(p, .contact-actions, .contact-email) { grid-column: 1 / -1; margin-block: 0; }
  body.zoomed .contact-copy p { font-size: 16px; }
}
