@font-face {
  font-family: "Martian Mono";
  src: url("./assets/martian-mono.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: "Martian Mono", ui-monospace, monospace;
  --edge: clamp(18px, 2.6vw, 48px);
  --bottom: max(var(--edge), env(safe-area-inset-bottom));
  --crop-x: 46%;
  --crop-y: 70%;
  --ink: #f8f8f5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #111; color: var(--ink); font-size: .84375rem; line-height: 1.65; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-weight: 400; }
[hidden] { display: none !important; }
.plate, .media { position: fixed; inset: 0; }
.plate { z-index: 0; }
.media { isolation: isolate; overflow: hidden; background: #000; }
#poster, .scene-still, .media canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#poster, .scene-still { object-fit: cover; object-position: var(--crop-x) var(--crop-y); }
.scene-still { pointer-events: none; object-position: center; }
.media::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--photo-contrast, 1);
  background: linear-gradient(to left, rgb(9 13 18 / .74), rgb(9 13 18 / .61) 19%, transparent 49%),
              linear-gradient(to bottom, rgb(0 0 0 / .62), transparent 23%),
              linear-gradient(to top, rgb(0 0 0 / .52), transparent 18%); }
.media.orbit-ready { cursor: grab; touch-action: pan-y pinch-zoom; }
.media.inspecting { touch-action: none; }
.media.over-slice { cursor: pointer; }
.media.dragging { cursor: grabbing; }
.rim-letters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.rim-letter { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0; border: 0;
  background: transparent; font: 400 .7rem/1 "Martian Mono", monospace; color: #efefe9; text-shadow: 0 1px 3px #000; }
.rim-letter.is-muted { color: #767672; }
.rim-letter.is-active { background: #efefe9; color: #111; text-shadow: none; }
.media canvas:focus-visible { outline: 1px solid #ccc; outline-offset: -4px; }
.masthead { position: fixed; z-index: 3; top: max(var(--edge), env(safe-area-inset-top)); left: var(--edge); pointer-events: none; }
h1 { font-size: 1.0625rem; letter-spacing: -.045em; line-height: 1.36; }
.masthead p { font-size: .725rem; margin-top: 6px; }
article { position: relative; pointer-events: none; }
article section { min-height: 100vh; min-height: 100svh; }
.story {
  position: relative; top: max(96px, 15svh); width: min(34ch, 29vw); margin-left: auto; margin-right: var(--edge);
  isolation: isolate; text-shadow: 0 1px 3px rgb(0 0 0 / .65); pointer-events: auto;
}
body.enhanced .story { position: fixed; right: var(--edge); margin: 0; visibility: hidden; opacity: 0; }
body.enhanced section.current .story { visibility: visible; opacity: 1; z-index: 2; }
h2 { font-size: .94rem; letter-spacing: -.035em; line-height: 1.45; }
.story p { margin-top: .9em; }
.field-photo { margin-top: 1rem; width: min(100%, 21svh, 194px); }
.field-photo img { display: block; width: 100%; height: auto; }
.field-photo figcaption { margin-top: 4px; font-size: .62rem; line-height: 1.4; }
.enlarge-photo, .close-photo { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.enlarge-photo { display: block; width: 100%; cursor: zoom-in; }
.photo-dialog { padding: 0; border: 0; max-width: 100%; max-height: 100%; background: #000; color: var(--ink); }
.photo-dialog[open] { position: fixed; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.photo-dialog::backdrop { background: #000; }
.photo-dialog img { width: auto; height: auto; max-width: calc(100% - 2 * var(--edge)); max-height: calc(100% - 2 * var(--edge) - 44px); }
.close-photo { position: absolute; right: var(--edge); top: var(--edge); padding: 6px 2px; font-size: .72rem; cursor: pointer; }
html:has(dialog[open]) { overflow: hidden; }
body:not(.enhanced) :is(#cover, section[data-progress="4"]) { position: relative; background: #000; }
.static-cover, .static-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; }
.masthead .demo-line { margin-top: 2px; font-size: .66rem; }
.opening { width: min(46ch, 35vw); padding: 14px 16px; background: rgb(8 10 12 / .8); font-size: .79rem; line-height: 1.6; }
.chapter-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: .8em; }
.chapter-links a, .return-project { font-size: .69rem; text-underline-offset: 3px; }
.read-statement { display: none; }
.statement-dialog { width: min(40ch, calc(100% - 24px)); max-height: calc(100% - 24px); margin: auto; padding: 18px; border: 1px solid #555; background: #101010; color: var(--ink); overflow: auto; font-size: .79rem; line-height: 1.6; }
.statement-dialog::backdrop { background: rgb(0 0 0 / .92); }
.close-statement, .read-statement { font: inherit; color: inherit; background: none; padding: 0; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.close-statement { margin-bottom: 1.4em; }
.statement-dialog p { margin-top: .9em; }
@media (max-width: 700px) and (max-height: 740px), (orientation: landscape) and (max-height: 480px) {
  body.enhanced .opening > p { display: none; }
  body.enhanced .read-statement { display: inline; font-size: .69rem; }
}
.piece-browser { margin-top: 9px; }
.piece-overview p { margin: 0; font-size: .72rem; }
.piece-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 10px 0; }
.piece-browser button, .view-controls button { font: inherit; cursor: pointer; }
.piece-index button { display: flex; justify-content: space-between; padding: 8px; min-height: 44px; align-items: center; border: 0; color: var(--ink); background: #1b1b1b; font-size: .92rem; }
.piece-number { font-size: .59rem; color: #aaa; }
.piece-index button.is-active { background: #e7e7e2; color: #111; }
.piece-index button.is-active .piece-number { color: #42423e; }
.piece-index button:focus-visible, .rim-letter:focus-visible { outline: 1px solid white; outline-offset: 1px; }
.piece-detail { margin-top: 10px; font-size: .72rem; }
.piece-detail button { color: var(--ink); background: transparent; border: 1px solid #555; padding: 6px 10px; min-height: 40px; }
.piece-detail .all-pieces { background: #e6e6e1; color: #131313; border-color: #e6e6e1; }
.piece-steps { display: flex; gap: 6px; margin-top: 8px; }
.piece-detail p { max-width: 29ch; color: #c4c4be; }
.single-piece { object-fit: contain; }

.media-caption { position: fixed; z-index: 2; bottom: var(--bottom); left: var(--edge); display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 17px; max-width: calc(100vw - 340px); font-size: .72rem; text-shadow: 0 1px 3px #222; }
.media-caption { pointer-events: none; }
.media-caption button { pointer-events: auto; }
.scroll-cue, .gesture { color: #ecece9; }
.scroll-cue.end { display: none; }
.view-controls { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.view-controls button { color: var(--ink); border: 0; padding: 4px 2px; background: transparent; text-decoration: underline; text-underline-offset: 3px; text-shadow: inherit; }
.landmark { position: absolute; z-index: 1; transform: translate(0, calc(-100% - 20px)); color: #20242b; font-size: .65rem; line-height: 1.35; padding-left: 7px; pointer-events: none; white-space: nowrap; text-shadow: 0 0 5px #e6ebef; }
.landmark::after { content: ""; position: absolute; top: 50%; left: 0; width: 4px; height: calc(50% + 17px); border-left: 1px solid #343a41; border-top: 1px solid #343a41; }
.landmark.below { transform: translateY(var(--leader)); }
.landmark.below::after { top: auto; bottom: 50%; height: calc(50% + var(--leader) - 2px); border-top: 0; border-bottom: 1px solid #343a41; }
.locator { position: fixed; z-index: 4; bottom: var(--bottom); right: var(--edge); width: clamp(210px, 18vw, 286px); background: #121315; border: 1px solid #444648; }
.location-panel { position: relative; isolation: isolate; }
.map-view { width: 100%; aspect-ratio: 1.82; }
.map-fallback { position: absolute; inset: 0; display: block; }
.map-fallback img { display: block; width: 100%; height: 100%; object-fit: cover; }
.location-panel.ready .map-fallback { display: none; }
.map-credit { padding: 3px 5px; font: 10px/1.3 Arial,sans-serif; color: #b8b8ba; }
.map-credit a { color: inherit; text-decoration: none; }
.map-credit a:hover, .map-credit a:focus-visible { text-decoration: underline; }
.place-marker { display: flex; align-items: center; gap: 4px; color: #f3f3ed; font: 10px/1.2 "Martian Mono", monospace; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 4px #000; pointer-events: none; }
.place-marker::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; background: #151719; }
.place-marker.park { flex-direction: row-reverse; }
@media (max-width: 700px) {
  :root { --edge: 15px; }
  body { font-size: .8125rem; }
  .masthead { right: var(--edge); }
  h1 { font-size: .97rem; max-width: 31ch; }
  .masthead p { margin-top: 3px; font-size: .625rem; }
  .story, body.enhanced .story { top: max(99px, 13svh); right: auto; left: var(--edge); margin: 0; width: min(36ch, calc(100vw - 2 * var(--edge))); font-size: .76rem; line-height: 1.52; }
  .story p { margin-top: 5px; }
  .story.opening, body.enhanced .story.opening { width: min(49ch, calc(100% - 2 * var(--edge))); padding: 10px 12px; font-size: .72rem; line-height: 1.47; }
  .masthead .demo-line { font-size: .59rem; }
  .piece-index { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 6px 0; }
  #pieces .story { width: min(400px, calc(100vw - 2 * var(--edge))); }
  .piece-index button { padding: 5px; min-height: 42px; }
  .piece-steps { display: inline-flex; margin: 0 0 0 5px; gap: 3px; }
  .piece-detail button { padding: 6px; }
  .opening .chapter-links { gap: 0 12px; }
  #harbor .story { display: grid; grid-template-columns: minmax(0, 1fr) clamp(66px, 20vw, 96px); column-gap: 12px; align-items: start; }
  #harbor .story h2 { grid-column: 1 / -1; }
  .field-photo { margin-top: 5px; width: 100%; }
  .field-photo figcaption { font-size: .53rem; }
  h2 { font-size: .8rem; }
  .media::after { background: linear-gradient(to bottom, rgb(9 13 18 / .72) 0, rgb(9 13 18 / .64) 180px, transparent min(42svh, 320px)),
                              linear-gradient(to top, rgb(0 0 0 / .6), transparent 17%); }
  .media-caption { max-width: calc(100vw - 180px); font-size: .62rem; gap: 1px 8px; }
  .view-controls { gap: 1px 8px; }
  .gesture { display: none; }
  .locator { width: 145px; }
  .map-credit { font-size: 8px; }
  .place-marker { font-size: 8px; gap: 2px; }
  .landmark { font-size: .57rem; }
}
@media (max-width: 360px) and (max-height: 640px) and (orientation: portrait) {
  .return-project { position: absolute; top: 0; right: 0; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .opening, body.enhanced .story.opening { max-height: calc(100svh - 100px); overflow: auto; overscroll-behavior: contain; width: min(47ch, 41vw); }
  body.enhanced #pieces .story { top: 54px; left: auto; right: var(--edge); width: min(42vw, 340px); }
  .piece-index { grid-template-columns: repeat(6, 1fr); }
  .piece-index button { min-height: 32px; }
  :root { --edge: 12px; }
  .locator { width: 140px; }
  .story, body.enhanced .story { top: 62px; width: min(34ch, 35vw); font-size: .71rem; }
  .map-credit { font-size: 8px; }
  .place-marker { font-size: 8px; }
  .field-photo { width: 11svh; margin-top: 5px; }
}

.media.cloud .landmark { color: #fff; text-shadow: 0 1px 3px #000; }
.media.cloud .landmark::after { border-color: currentColor; }
