:root {
  color-scheme: dark;
  --paper: #0b0b0b;
  --canvas: #141414;
  --ink: #f3f3f1;
  --muted: #a3a3a0;
  --line: #343434;
  --focus: #f3f3f1;
  --phone-ratio: 375 / 812;
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, figure, fieldset { margin: 0; }
body { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 100svh; }
button, input { font: inherit; }
a { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .34; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1440px, 100%);
  min-height: 56px;
  margin-inline: auto;
  padding: max(6px, env(safe-area-inset-top)) clamp(18px, 3vw, 44px) 6px;
}
.wordmark, .text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.wordmark { color: var(--muted); font-weight: 500; }
.wordmark .icon { width: 17px; height: 17px; }
.text-link { min-height: 44px; text-decoration: none; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 14px; height: 14px; }
.topbar .text-link { color: var(--ink); }

.museum { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1120px, calc(100% - 48px)); min-height: 0; height: 100%; margin-inline: auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.intro { grid-row: 1; text-align: center; margin-block: 0 8px; }
h1 { font-size: clamp(25px, 3vw, 32px); font-weight: 500; line-height: 1.15; letter-spacing: -.055em; }
h1 span { color: #737370; }
.intro > p { color: var(--muted); font-size: 12px; margin-top: 5px; }

.products { grid-row: 1; display: flex; justify-content: center; gap: 8px; min-width: 0; border: 0; padding: 0; margin-bottom: 12px; }
.product {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 44px;
  padding: 8px 17px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .16s, background-color .16s;
}
.product:has(input:checked) { color: var(--ink); background: #252525; }
.product:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.product:hover:has(input:not(:checked)) { color: var(--ink); background: #171717; }
.product input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.app-picker { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; max-width: 100%; padding: 8px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 550; }
.app-picker:hover { background: #ffffff0c; }
.app-picker .icon { width: 15px; height: 15px; color: var(--muted); }
#app-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sheet { height: min(80dvh, 720px); max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
.app-sheet[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.sheet-close { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.sheet-close:hover { background: #ffffff0c; }
#app-search { width: 100%; min-height: 46px; margin-top: 12px; padding: 10px 13px; border: 1px solid #424242; border-radius: 8px; background: #222; color: var(--ink); font-size: 16px; appearance: none; -webkit-appearance: none; }
#app-search::placeholder { color: var(--muted); }
.app-count { padding: 12px 0 7px; color: var(--muted); font-size: 12px; }
.app-list { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.app-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 60px; padding: 10px 4px; border: 0; border-bottom: 1px solid #ffffff0d; border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.app-choice:hover, .app-choice[aria-pressed="true"] { background: #ffffff07; }
.app-choice:focus-visible { outline-offset: -3px; }
.app-choice-info { display: grid; gap: 3px; }
.app-choice-name { font-size: 15px; font-weight: 500; }
.app-choice-detail { color: var(--muted); font-size: 12px; }
.app-check { width: 24px; font-size: 16px; text-align: center; }
.single-version { min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 12px; }
.timeline-wrap[data-single="true"] .timeline, .timeline-wrap[data-single="true"] .timeline-stops, .timeline-wrap[data-single="true"] .timeline-label { display: none; }
.stop-locale { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 400; }

.exhibit { grid-row: 2; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; width: min(780px, 100%); min-width: 0; min-height: 0; margin-inline: auto; }
.stage {
  grid-row: 1;
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}
#prototype {
  position: relative;
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: var(--prototype-ratio, var(--phone-ratio));
  overflow: hidden;
  border-radius: 15px;
  background: var(--canvas);
  outline: 1px solid #ffffff21;
  isolation: isolate;
}
.capture {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.capture-plane { position: relative; width: 100%; height: 100%; }
.capture-action { display: none; }
#controls-home { display: contents; }
.flow-toggle { display: none; }
.controls-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 480px);
  max-height: calc(100dvh - 32px);
  margin: 0 auto;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: #171717;
  color: var(--ink);
}
.controls-sheet::backdrop { background: #0009; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet-heading h2 { font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
#flow-close { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
#flow-close:hover { background: #ffffff0c; }
#sheet-context { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.controls-sheet .prototype-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.controls-sheet .prototype-step { grid-column: 1 / -1; grid-row: 1; width: 100%; max-width: none; min-height: 64px; border: 1px solid var(--line); border-radius: 9px; }
.controls-sheet #prototype-hint { color: var(--ink); font-size: 14px; max-width: none; }
.controls-sheet #prototype-back, .controls-sheet #prototype-reset { min-height: 48px; font-size: 14px; }
.stage > .capture { width: auto; max-width: 100%; }
.stage[aria-busy="true"] .capture { opacity: .15; }
#hotspots, .hotspots { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hotspot {
  position: absolute;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  transition: background-color .14s;
}
.hotspot:hover { background: #ffffff14; }
.hotspot:active { background: #ffffff26; }
.hotspot:focus-visible { outline: 2px solid white; outline-offset: -2px; background: #ffffff21; }
.hotspot:focus-visible { box-shadow: inset 0 0 0 4px #000; }
.stage-message { position: absolute; z-index: 2; max-width: 320px; padding: 9px 14px; text-align: center; font-size: 13px; color: var(--muted); background: var(--paper); }
.retry { position: absolute; top: 58%; z-index: 2; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); color: var(--ink); }

.prototype-controls {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 44px;
  margin-top: 5px;
}
#prototype-back, #prototype-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
#prototype-back:hover:not(:disabled), #prototype-reset:hover:not(:disabled) { color: var(--ink); background: #ffffff0c; }
.prototype-step { display: grid; place-content: center; gap: 2px; min-width: 0; min-height: 44px; max-width: 300px; padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: center; }
.prototype-step:hover:not(:disabled) { background: #ffffff0c; }
.prototype-step:disabled { opacity: 1; }
#screen-label { min-width: 75px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
#prototype-hint { max-width: 34ch; color: var(--muted); font-size: 11px; line-height: 1.3; text-wrap: balance; }

.caption-row { grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; padding-block: 4px 5px; }
.moment { display: flex; align-items: center; gap: 14px; min-width: 0; }
.year { font-size: 31px; font-weight: 450; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.moment-detail { min-width: 0; }
.moment-detail h2 { font-size: 13px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.moment-detail p { margin-top: 3px; font-size: 11px; line-height: 1.3; color: var(--muted); }
.citation { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.caption-row .prototype-controls { margin: 0; }

.timeline-wrap { grid-row: 4; border-top: 1px solid var(--line); padding-top: 8px; }
.capture-notice { margin-bottom: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.capture-notice[data-kind="end"] { display: none; }
.timeline-label { display: block; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.3; }
.timeline {
  --progress: 0%;
  display: block;
  width: calc(100% - 36px);
  height: 28px;
  margin: 0 18px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--ink);
  cursor: ew-resize;
  accent-color: var(--ink);
}
.timeline::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--ink) var(--progress), var(--line) var(--progress)); }
.timeline::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -5.5px; border: 0; border-radius: 50%; background: var(--ink); appearance: none; -webkit-appearance: none; }
.timeline::-moz-range-track { height: 2px; background: var(--line); }
.timeline::-moz-range-progress { height: 2px; background: var(--ink); }
.timeline::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--ink); }
.timeline:disabled { opacity: .35; cursor: default; }
.timeline-stops { display: flex; justify-content: space-between; gap: 8px; }
.stop { min-width: 44px; min-height: 44px; padding: 4px 7px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.stop[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.stop:hover { background: #ffffff0a; }
.archive-note { grid-row: 4; margin-top: 8px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.3; }

@media (min-width: 720px) {
  .products { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 1; }
}

@media (max-width: 600px) {
  .topbar { min-height: 48px; padding: max(2px, env(safe-area-inset-top)) 16px 2px; }
  .wordmark { font-size: 11px; gap: 5px; }
  .wordmark .icon { width: 15px; height: 15px; }
  .topbar .text-link { font-size: 11px; }
  .museum { width: calc(100% - 28px); }
  .intro { margin-block: 1px 6px; }
  h1 { font-size: 26px; }
  .intro > p { display: none; }
  .products { gap: 5px; margin-bottom: 9px; }
  .product { min-width: 78px; padding-inline: 14px; font-size: 12px; }
  #prototype { border-radius: 11px; }
  .prototype-controls { min-height: 44px; margin-top: 2px; }
  .caption-row { min-height: 64px; align-items: flex-start; gap: 0 8px; padding-top: 4px; }
  .moment { align-items: flex-start; gap: 9px; padding-top: 5px; }
  .year { font-size: 28px; }
  .moment-detail h2 { font-size: 12px; }
  .moment-detail p { font-size: 11px; }
  .citation { max-width: 100px; align-items: flex-start; padding-top: 4px; font-size: 11px; line-height: 1.3; }
  .citation .icon { margin-top: 1px; }
  .timeline-wrap { padding-top: 7px; }
  .timeline-stops { gap: 3px; }
  .stop { padding-inline: 2px; font-size: 11px; }
  .archive-note { margin-top: 4px; font-size: 10px; }
}

@media (max-width: 350px) {
  .topbar { padding-inline: 12px; }
  .wordmark { font-size: 10px; }
  .museum { width: calc(100% - 24px); }
  .moment-detail h2 { max-width: 144px; }
  .citation { max-width: 82px; }
}

@media (max-height: 680px) {
  .intro > p, .archive-note { display: none; }
  .intro { margin-block: 0 4px; }
  h1 { font-size: 24px; }
  .products { margin-bottom: 6px; }
  .prototype-controls { margin-top: 0; }
}

@media (max-height: 480px) {
  body { display: block; height: auto; }
  .museum { display: block; height: auto; padding-bottom: 16px; }
  .exhibit { display: block; }
  .stage { height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The phone is the canvas, rather than a phone-shaped thumbnail inside it. */
@media (max-width: 719px) {
  body { display: block; height: 100dvh; min-height: 0; overflow: hidden; }
  .topbar { display: none; }
  .museum {
    position: relative;
    display: grid;
    grid-template-rows: calc(44px + env(safe-area-inset-top)) minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    padding: 0;
  }
  .products {
    position: static;
    grid-row: 1;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    padding: env(safe-area-inset-top) 48px 0 12px;
    transform: none;
    background: var(--paper);
  }
  .product { flex: 1; min-width: 0; max-width: 112px; min-height: 44px; padding: 8px 6px; border-radius: 0; font-size: 13px; }
  .app-picker { justify-content: flex-start; padding: 8px 4px; border-radius: 0; font-size: 15px; }
  .app-picker:focus-visible { outline-offset: -3px; }
  .product:has(input:checked) { background: transparent; box-shadow: inset 0 -2px var(--ink); }
  .product:hover:has(input:not(:checked)) { background: transparent; }
  .product:has(input:focus-visible) { outline-offset: -4px; }
  .flow-toggle:focus-visible, .citation:focus-visible, .stop:focus-visible { outline-offset: -3px; }
  .flow-toggle {
    position: absolute;
    top: env(safe-area-inset-top);
    right: 2px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
  }
  .exhibit { display: grid; grid-row: 2; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; min-height: 0; margin: 0; }
  .stage { grid-row: 1; height: 100%; min-height: 0; overflow: clip; container-type: size; }
  #prototype {
    width: min(100cqw, calc(100cqh * var(--content-aspect, .461538)));
    height: auto;
    max-height: 100%;
    aspect-ratio: var(--content-ratio, 360 / 780);
    overflow: clip;
    border-radius: 0;
    outline: 0;
  }
  .capture-plane { height: var(--plane-height, 100%); position: absolute; inset: var(--plane-top, 0) 0 auto; }
  .capture { object-fit: fill; }
  #prototype:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; box-shadow: inset 0 0 0 4px #000; }
  .caption-row { display: contents; min-height: 0; padding: 0; }
  .moment { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .citation {
    position: absolute;
    right: 8px;
    bottom: env(safe-area-inset-bottom);
    z-index: 2;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 76px;
    max-width: none;
    height: 44px;
    padding: 0;
    color: var(--ink);
    font-size: 12px;
    line-height: 1;
  }
  .citation .icon { margin: 0; }
  .timeline-wrap {
    display: grid;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 76px;
    column-gap: 4px;
    width: 100%;
    margin: 0;
    padding: 0 8px env(safe-area-inset-bottom);
    border: 0;
    background: var(--paper);
  }
  .timeline-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .timeline { grid-column: 1; width: calc(var(--stop-span, 80%) + 13px); height: 28px; margin: 0 auto; }
  .timeline-stops { grid-column: 1; display: flex; gap: 0; width: 100%; }
  .stop { flex: 1; min-width: 44px; min-height: 44px; padding: 4px 0; font-size: 12px; }
  .capture-notice { grid-column: 1 / -1; margin: 0; padding: 7px 8px; font-size: 12px; line-height: 1.4; text-align: left; }
  .capture-notice[data-kind="end"] { display: block; }
  .single-version { grid-column: 1; min-height: 72px; padding: 28px 0 0 8px; }
  .capture-action { display: block; grid-column: 1 / -1; width: 100%; min-height: 44px; padding: 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.4; text-align: left; }
  .capture-action:hover { background: #ffffff0c; }
  #controls-home { display: none; }
}
