@import url('bay-files.css');

@font-face {
  font-family: 'Courier Prime';
  src: url('../fonts/courier-prime-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('../fonts/courier-prime-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('../fonts/courier-prime-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('../fonts/courier-prime-latin-700-italic.woff2') format('woff2');
  font-weight: 700; font-style: italic; font-display: swap;
}

/* lettering on the robot: marker for signs and tape, a terminal face for his screens */
@font-face {
  font-family: 'Permanent Marker';
  src: url('../fonts/permanent-marker-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'VT323';
  src: url('../fonts/vt323-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
/* his newspaper (2026-11-21, after the owner's sheet): its name in blackletter, its headlines in a serif (and its big
   first letters in that serif's plain weight), its words in a typewriter's even letters, a little heavy as a ribbon
   prints them. All three are open (SIL OFL 1.1): Manufacturing Consent, Source Serif 4, IBM Plex Mono. */
@font-face {
  font-family: 'Manufacturing Consent';
  src: url('../fonts/manufacturing-consent-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --paper: #f3f1ea;
  --ink: #161616;
  --ink-soft: rgba(22, 22, 22, 0.62);
  --gutter: clamp(16px, 2.6vw, 34px);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.top, .bottom {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.top { top: calc(var(--gutter) * 0.8 + env(safe-area-inset-top, 0px)); }
.bottom { bottom: calc(var(--gutter) * 0.8 + env(safe-area-inset-bottom, 0px)); }
.top > *, .bottom > * { pointer-events: auto; }

.name {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.links { display: flex; gap: clamp(14px, 2.2vw, 28px); }
.links a {
  color: var(--ink);
  text-decoration: none;
  padding: 2px 0;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat;
  transition: background-size 180ms ease;
}
.links a:hover, .links a:focus-visible { background-size: 100% 1px; }
a:focus-visible { outline: 1px dashed var(--ink); outline-offset: 4px; }

.line {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-soft);
  text-wrap: balance;
}

/* what the robot says */
.say {
  position: fixed;
  margin: 0;
  max-width: min(30ch, 60vw);
  padding: 10px 14px 9px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 14px 16px 15px 4px;
  transform-origin: 0 100%;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.2, 1.3, 0.4, 1);
  pointer-events: none;
  white-space: pre-wrap;
}
.say.on { opacity: 1; transform: none; }
.say[hidden] { display: block; visibility: hidden; }

.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; }

@media (max-width: 640px) {
  html, body { font-size: 14px; }
  .line { max-width: 26ch; }
}

@media (prefers-reduced-motion: reduce) {
  .say { transition: opacity 120ms ease; transform: none; }
}

/* Shared by the explorer and its generated project and writing pages. (The guide was found by its id, "handle", until
   the settings it opened were taken out on 2026-11-25; the joystick for touch screens is made of the same keys.) */
html:not(:is(.dusk, .inside, .matrix, .mad)) :is(.handle, .stick) {
  --key-top: #f9ebcf;
  --key-base: #f3e4c6;
}
.handle .guide-mouse { border-color: var(--key-edge); }

dialog.desk-case {
  width: min(42rem, 88vw);
  max-height: 82dvh;
  overflow: auto;
  box-sizing: border-box;
}
.desk-case::backdrop { background: rgb(18 14 9 / .7); }
.desk-case button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  padding: .2em .65em;
  cursor: pointer;
}

/* The scene takes focus for walking and the CRT. Its controls draw their own focus rings. */
#view:focus { outline: none; }

/* Daylight sky stock and edge shading from the paper pass, visible before the first frame. */
html.js[data-home]:not(.vivid, .dusk, .mad, .matrix) body {
  background-image:
    radial-gradient(ellipse 100% 113.64% at center,
      transparent 30%, rgb(0 0 0 / 1.6%) 42%, rgb(0 0 0 / 5.1%) 54%,
      rgb(0 0 0 / 8.6%) 66%, rgb(0 0 0 / 10.2%) 78%),
    linear-gradient(#f4e8cd 0%, #f4e9cd 15%, #f6ebd0 50%, #f7ecd1 80%);
}

/* Each rectangle marks a completed step in the 3D scene's first load. */
.scene-loader { display: none; }
html.js:not(.there) .scene-loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  grid-auto-flow: column;           /* (the meter, and its number to its right, on one line) */
  align-items: center;
  column-gap: 10px;
  background: inherit;
  color: #625c50;
  --slot: #e5dbc7;
  --sage: #aeb8a2;
  --wheat: #d7bf94;
  --clay: #cba895;
}
html.dusk:not(.there) .scene-loader {
  color: #cbc4b6;
  --slot: #34322c;
  --sage: #84917a;
  --wheat: #ab9879;
  --clay: #ae8e7e;
}
.scene-meter {
  display: flex;
  gap: 3px;
}
.scene-meter i {
  display: block;
  width: 9px;
  height: 15px;
  border-radius: 1.5px;
  background: var(--slot);
  transition: background-color 120ms ease-out;
}
.scene-meter i.ready { background: var(--wheat); }
.scene-meter i.ready:nth-child(-n+4) { background: var(--sage); }
.scene-meter i.ready:nth-child(n+9) { background: var(--clay); }
/* ... and to their right, how much of the way he is, as a number (the owner, 2026-11-25: "add a percentage counter to
   our loader", "on the right of the progress bar so it all looks neat and tidy"). As wide as "100%" from the start, so
   the meter does not shift as it counts. */
.scene-percent {
  margin: 0;
  width: 4ch;
  text-align: left;
  font: 13px/1 'Courier Prime', monospace;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;   /* (its box is the figures' own height, so centring it centres them on the bar: "the count needs to be middle aligned with the bar") */
}
@supports not (text-box: trim-both cap alphabetic) {
  .scene-percent { position: relative; top: 1px; }     /* (where the box cannot be trimmed: measured, the figures sat 1.25 px high) */
}
.scene-load-error { display: none; }
.scene-loader.failed .scene-meter, .scene-loader.failed .scene-percent { display: none; }
.scene-loader.failed .scene-load-error {
  display: block;
  font: 14px/1.5 'Courier Prime', monospace;
}
.scene-load-error button {
  border: 0;
  padding: .25em;
  font: inherit;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .scene-meter i { transition: none; }
}
