:root {
  --bg: var(--color-page-bg);
  --ink: var(--color-text);
  --soft: var(--color-text-soft);
  --card: var(--color-card);
  --accent: var(--color-accent-pink);
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
}
#stage {
  position: fixed;
  inset: 0;
}
.world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.world-canvas:active {
  cursor: grabbing;
}

/* loading: the opening screen, and the same again the first time she steps through the portal
   (the beach is built then) */
.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: var(--space-18);
  text-align: center;
  padding: var(--space-16);
  background: var(--gradient-loader);
  transition: opacity var(--motion-loader-fade), visibility var(--duration-800);
  z-index: var(--z-loader);
}
.loader.done {
  opacity: 0;
  visibility: hidden;
}
.portal-loader {
  animation: loader-in var(--motion-loader-in) both; /* (over the portal's flash, which it matches) */
}
@keyframes loader-in {
  from {
    opacity: 0;
  }
}
/* the ring drawing round behind it, and the circle that opens onto the room (loading.js) */
.loading-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* the 3D wordmark turning while it loads (intro.js), fading in once it's drawn */
.intro {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--motion-veil);
}
.intro.on {
  opacity: 1;
}
.intro canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#loader p {
  margin: 0;
  max-width: 320px;
  color: var(--soft);
  font-style: italic;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the portal's flash */
#veil {
  position: fixed;
  inset: 0;
  background: var(--gradient-veil);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-veil);
  z-index: var(--z-veil);
}
#veil.on {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  #veil,
  .loader {
    transition-duration: var(--motion-reduced);
  }
}

/* liquid-glass controls (from gallery-app's walk.css): drawn by the 3D view through glass.js;
   until then (or without WebGL) a smoked fallback */
.glass {
  height: var(--size-control);
  min-width: var(--size-control);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-on-glass-rose);
  background: var(--color-glass-fallback-rose);
  cursor: pointer;
  transition: color var(--motion-hover), transform var(--motion-hover);
}
.glass-icon {
  display: grid;
  place-items: center;
  width: var(--size-control);
  padding: 0;
}
.glass .icon {
  width: var(--size-icon);
  height: var(--size-icon);
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: var(--shadow-icon);
}
.glass:active {
  transform: scale(0.96);
}
.glassy .glass {
  background: transparent;
  text-shadow: var(--shadow-text-on-glass);
}
.glassy .glass:hover {
  color: var(--color-on-glass-hover);
}
.glass:focus-visible,
.volume-panel:focus-visible {
  outline: var(--focus-ring-on-glass-rose);
  outline-offset: 3px;
}
.volume {
  position: fixed;
  right: max(var(--inset), env(safe-area-inset-right, 0px));
  bottom: max(var(--edge-controls), env(safe-area-inset-bottom, 0px));
  z-index: var(--z-room-controls);
  display: grid;
  justify-items: center;
  gap: var(--gap-controls);
}
.sound .mute {
  display: none;
}
.sound.off .wave {
  display: none;
}
.sound.off .mute {
  display: inline;
}
.volume-panel {
  display: none;
  position: relative;
  width: var(--size-control);
  height: var(--size-volume-panel-height);
  border-radius: var(--radius-bar);
  background: var(--color-glass-fallback-rose);
  touch-action: none;
  cursor: pointer;
  --v: 0%;
}
.glassy .volume-panel {
  background: transparent;
}
@media (hover: hover) {
  .volume:hover .volume-panel {
    display: block;
  }
}
.volume.open .volume-panel,
.volume:focus-within .volume-panel {
  display: block;
}
.volume-track {
  position: absolute;
  left: 50%;
  top: var(--size-volume-track-inset);
  bottom: var(--size-volume-track-inset);
  width: var(--size-volume-track-width);
  transform: translateX(-50%);
  border-radius: var(--radius-track);
  background: var(--color-volume-track);
}
.volume-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--v);
  border-radius: var(--radius-track);
  background: var(--color-volume-fill);
}
.volume-thumb {
  position: absolute;
  left: 50%;
  bottom: var(--v);
  width: var(--size-volume-thumb);
  height: var(--size-volume-thumb);
  border-radius: var(--radius-round);
  background: var(--color-volume-thumb);
  transform: translate(-50%, 50%);
  box-shadow: var(--shadow-volume-thumb);
}
@media (prefers-reduced-motion: reduce) {
  .glass {
    transition: none;
  }
}

/* the step-back button over a painting's close-up, bottom centre */
.art-close {
  position: fixed;
  left: 50%;
  bottom: max(var(--edge-controls), env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--z-room-controls);
}
.art-close:active {
  transform: translateX(-50%) scale(0.96);
}
/* at the arcade the game fills the view: the X goes to the top right, out of its way */
.art-close.at-game {
  left: auto;
  bottom: auto;
  top: max(var(--edge-top), env(safe-area-inset-top, 0px));
  right: max(var(--inset), env(safe-area-inset-right, 0px));
  transform: none;
}
.art-close.at-game:active {
  transform: scale(0.96);
}
/* holding one of her perfumes: "Choose as daily" and an X to put it back, bottom centre. A
   label on glass as gallery-app's glass buttons have it; they fade and rise in (with 'top', not
   a transform, so the glass drawn behind each keeps up with its label) */
.hold {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(var(--edge-controls), env(safe-area-inset-bottom, 0px));
  z-index: var(--z-room-controls);
  display: flex;
  justify-content: center;
  gap: var(--gap-controls);
  pointer-events: none;
}
.hold .glass {
  position: relative;
  top: var(--space-14);
  opacity: 0;
  transition: top var(--motion-rise), opacity var(--motion-overlay), color var(--motion-hover), transform var(--motion-hover);
}
.hold.open .glass {
  top: 0;
  opacity: 1;
  pointer-events: auto;
}
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: 0 var(--space-20);
  font: var(--type-button);
  white-space: nowrap;
}
.glass-pill[hidden] {
  display: none;
}
.glass-pill .check {
  display: none;
  margin-left: calc(-1 * var(--space-4));
}
.glass-pill.chosen {
  cursor: default;
}
.glass-pill.chosen .check {
  display: block;
}
/* a record's sleeve in hand: "Play", with the play triangle (the now-playing bar's), filled; the
   one playing says so with the tick instead */
.glass-pill .play {
  display: none;
  margin-left: calc(-1 * var(--space-4));
}
.glass-pill.is-play:not(.chosen) .play {
  display: block;
  fill: currentColor; /* solid, as the now-playing bar's */
  width: var(--size-icon-small);
  height: var(--size-icon-small);
}
.hold .glass-icon[hidden] {
  display: none;
}
.glass-pill.chosen:active {
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .hold .glass {
    transition: none;
  }
}
/* the record playing: a glass bar like gallery-app's tour bar (the song's title, then pause or
   resume, and stop), bottom centre. It rises and fades in as the record starts and sinks away when
   it stops (the gallery's enter and exit motion), and slides up above whatever else is showing at
   the bottom centre (--above, from main.js) and back down after, moving 'bottom' rather than a
   transform so the glass drawn behind it keeps up with its label */
.now-playing {
  position: fixed;
  left: 0;
  right: 0;
  width: max-content;
  margin: 0 auto;
  bottom: calc(var(--above, max(var(--edge-controls), env(safe-area-inset-bottom, 0px))) - 12px);
  z-index: var(--z-room-controls);
  padding: 0 var(--space-4) 0 var(--space-16);
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transition: bottom var(--motion-exit-duration) var(--motion-exit-curve), opacity var(--motion-exit-duration) var(--motion-exit-curve), visibility 0s linear var(--motion-exit-duration), transform var(--motion-hover);
}
.now-playing.open {
  bottom: var(--above, max(var(--edge-controls), env(safe-area-inset-bottom, 0px)));
  opacity: 1;
  visibility: visible;
  transition: bottom var(--motion-slide), opacity var(--motion-enter-duration) var(--motion-enter-curve), visibility 0s, transform var(--motion-hover);
}
.at-game .now-playing.open {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-exit-duration) var(--motion-exit-curve), visibility 0s linear var(--motion-exit-duration);
}
.now-playing-title {
  margin-right: var(--space-6);
  white-space: nowrap;
}
.now-playing button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.now-playing .icon {
  width: var(--size-icon-small);
  height: var(--size-icon-small);
}
.now-playing .icon.pause,
.now-playing .icon.resume,
.now-playing .icon.stop {
  fill: currentColor; /* solid, as the gallery's: they read better so at this size */
}
.now-playing .icon.stop {
  width: var(--size-icon-stop); /* a solid square reads heavier than pause, so a touch smaller */
  height: var(--size-icon-stop);
}
.now-playing .resume,
.now-playing.paused .pause {
  display: none;
}
.now-playing.paused .resume {
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .now-playing,
  .now-playing.open {
    transition: none;
  }
}
/* the screenshot button, top left */
.corner-left {
  position: fixed;
  top: max(var(--edge-top), env(safe-area-inset-top, 0px));
  left: max(var(--inset), env(safe-area-inset-left, 0px));
  z-index: var(--z-room-controls);
}
.art-close[hidden] {
  display: none;
}

/* the About button ("?"), top right (the screenshot is top left) */
.corner-right {
  position: fixed;
  top: max(var(--edge-top), env(safe-area-inset-top, 0px));
  right: max(var(--inset), env(safe-area-inset-right, 0px));
  z-index: var(--z-room-controls);
}

/* the view outside (scenery.js), bottom left: a glass button, and above it, as the speaker's
   volume bar sits above the speaker, a glass panel of choices. The panel rises and fades in with
   the gallery's enter motion and sinks away with its exit (moving 'top', not a transform, so the
   glass drawn behind it keeps up). Each choice is a row like a bar's buttons: a small round
   picture and its name; the chosen one is solid paper white, as a bar's toggle that's on. */
.scenery {
  position: fixed;
  left: max(var(--inset), env(safe-area-inset-left, 0px));
  bottom: max(var(--edge-controls), env(safe-area-inset-bottom, 0px));
  z-index: var(--z-room-controls);
  display: grid;
  justify-items: start;
  gap: var(--gap-controls);
}
.scenery[hidden] {
  display: none;
}
/* the box holding the button and its panel is as big as the panel even while it's closed: only
   what's in it takes touches, so the room behind still turns and walks */
.scenery {
  pointer-events: none;
}
.scenery > * {
  pointer-events: auto;
}
.scenery-panel {
  position: relative;
  top: var(--space-12);
  display: grid;
  width: var(--width-panel);
  height: auto;
  max-height: calc(100vh - 74px - max(var(--edge-top), env(safe-area-inset-top, 0px)) - 54px); /* clear of the screenshot button above */
  max-height: calc(100dvh - 74px - max(var(--edge-top), env(safe-area-inset-top, 0px)) - 54px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: var(--space-6);
  border-radius: var(--radius-bar);
  font: var(--type-bar);
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transition: top var(--motion-exit-duration) var(--motion-exit-curve), opacity var(--motion-exit-duration) var(--motion-exit-curve), visibility 0s linear var(--motion-exit-duration);
}
.scenery-panel::-webkit-scrollbar {
  display: none;
}
.scenery.open .scenery-panel {
  top: 0;
  opacity: 1;
  visibility: visible;
  transition: top var(--motion-enter-duration) var(--motion-enter-curve), opacity var(--motion-enter-duration) var(--motion-enter-curve), visibility 0s;
}
.scenery-panel:active {
  transform: none; /* (it's a panel, not a button) */
}
.scenery-head {
  margin: 0;
  padding: var(--space-10) var(--space-12) var(--space-4);
  font: var(--type-bar);
  color: var(--color-on-glass-muted);
}
.scenery-head:first-child,
.scenery-group[hidden] + .scenery-head {
  padding-top: var(--space-6);
}
.scenery-group {
  display: grid;
  gap: var(--space-2);
}
.scenery-group[hidden],
.scenery-head[hidden] {
  display: none; /* (the other place's choices) */
}
.scenery-opt {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  height: var(--size-option);
  padding: 0 var(--space-12) 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--font-size-14);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--motion-hover), color var(--motion-hover);
}
.scenery-opt:hover {
  background: var(--color-glass-wash);
}
.scenery-opt:focus-visible {
  outline: var(--focus-ring-on-glass);
  outline-offset: 1px;
}
.scenery-opt[aria-checked='true'],
.scenery-opt[aria-checked='true']:hover {
  background: var(--color-log-text);
  color: var(--color-log-ink-inverse);
  text-shadow: none;
  cursor: default;
}
/* boyfriend mode: its own on/off switch, not a chosen pill (tapped again to turn it off) */
.scenery-toggle.scenery-opt[aria-checked='true'] {
  background: none;
  color: inherit;
  text-shadow: inherit;
  cursor: pointer;
}
.scenery-toggle.scenery-opt[aria-checked='true']:hover {
  background: var(--color-glass-wash);
}
.scenery-state {
  flex: 1;
}
.scenery-switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: rgb(var(--white-rgb) / 0.22);
  box-shadow: inset 0 0 0 1px rgb(var(--white-rgb) / 0.3);
  transition: background var(--motion-hover);
}
.scenery-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-round);
  background: var(--white);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform var(--motion-hover);
}
[aria-checked='true'] > .scenery-switch {
  background: var(--color-switch-on);
}
[aria-checked='true'] > .scenery-switch::after {
  transform: translateX(16px);
}
.scenery-thumb {
  position: relative;
  flex: none;
  width: var(--size-thumb);
  height: var(--size-thumb);
  border-radius: var(--radius-round);
  overflow: hidden;
  background: var(--color-thumb-bg);
  box-shadow: 0 0 0 1px var(--color-thumb-rim);
}
.scenery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--motion-fade);
}
.scenery-thumb img.loaded {
  opacity: 1;
}
[aria-checked='true'] .scenery-thumb {
  box-shadow: 0 0 0 1px var(--color-thumb-rim-selected);
}
/* the chosen view's picture still on its way: its little picture breathes until it arrives */
.scenery-opt.loading .scenery-thumb {
  animation: scenery-wait var(--motion-wait) infinite alternate;
}
@keyframes scenery-wait {
  to {
    opacity: 0.45;
  }
}
/* where the music's bar would be under the open panel (a phone, a painting close up), it steps
   away while the panel is open, as it does at the arcade */
.scenery-over-bar .now-playing.open {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-exit-duration) var(--motion-exit-curve), visibility 0s linear var(--motion-exit-duration);
}
@media (prefers-reduced-motion: reduce) {
  .scenery-panel,
  .scenery.open .scenery-panel,
  .scenery-opt,
  .scenery-thumb img {
    transition: none;
  }
  .scenery-opt.loading .scenery-thumb {
    animation: none;
  }
}

/* =================================================================================
   About (from gallery-app's walk.css .about): a dark scrim over the room, and in white in the
   middle, a letter from Lance to Emily, with a way on to the design log. It fades in and out;
   the room doesn't walk while it's open. With the log open, About's words fade out and its scrim
   deepens to the log's; the log brings its own close button, in the same place.
   ================================================================================= */
@font-face { font-family: 'Caveat'; src: url('assets/fonts/caveat-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Pinyon Script'; src: url('assets/fonts/pinyon-script-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; } /* (Google Fonts, OFL: the loading screen's wordmark) */
.about { position: fixed; inset: 0; z-index: var(--z-about); display: grid; place-items: center; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(72px + env(safe-area-inset-top, 0px)) var(--space-28) calc(48px + env(safe-area-inset-bottom, 0px));
  font: var(--type-body); -webkit-font-smoothing: antialiased;
  background: var(--color-scrim); color: var(--color-on-dark); opacity: 0; transition: opacity var(--motion-overlay), background-color var(--motion-overlay); }
.about[hidden] { display: none; }
.about.open { opacity: 1; }
.about-body { max-width: 34rem; transform: translateY(6px); transition: transform var(--motion-overlay), opacity var(--motion-overlay); }
.about.behind { background-color: var(--color-scrim-log); }
.about.behind .about-body { opacity: 0; }
.about.behind #about-close { visibility: hidden; }
.about.open .about-body { transform: none; }
.about h2 { margin: 0 0 var(--space-18); font: var(--type-letter-title); letter-spacing: 0; }
.about h2:focus { outline: none; } /* (it takes focus on opening, so a screen reader starts there) */
.about p { margin: 0 0 var(--space-14); font-size: var(--font-size-17); line-height: 1.6; color: var(--color-on-dark-body); }
/* the closing: "Your man," and under it his name, in his hand */
.about-signoff { margin-top: var(--space-20); }
.about-signature { display: block; margin-top: var(--space-6); font: var(--type-signature); color: var(--color-on-dark); }
:where(.about) button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.about :focus-visible { outline: 2px solid var(--color-on-dark); outline-offset: 2px; }
.about .frost:focus-visible { outline-offset: 3px; }
.about .icon { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.about-actions { display: flex; flex-wrap: wrap; gap: var(--gap-actions); margin-top: var(--space-28); }
/* Buttons (gallery-app's .btn): a pill with a label. .btn-primary: solid paper. .btn-tertiary:
   transparent until hovered. */
.btn-primary { color: var(--color-button-primary-ink); background: var(--color-button-primary); box-shadow: var(--shadow-raised); }
.btn-primary:hover { background: var(--color-button-primary-hover); } /* a colour change on hover; no lift */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-10); padding: 13px var(--space-20); border-radius: var(--radius-pill); white-space: nowrap; font: var(--type-button); transition: background var(--motion-hover), color var(--motion-hover), transform var(--motion-hover); }
.btn:active { transform: scale(0.98); }
.btn-tertiary { margin-left: calc(-1 * var(--space-20)); color: var(--color-on-dark-body); background: transparent; } /* (its label lines up with the letter) */
.btn-tertiary:hover { color: var(--color-on-dark); background: var(--color-on-dark-wash); }
@media (max-width: 560px) {
  .about { padding-left: var(--space-28); padding-right: var(--space-28); }
  .about-actions > * { flex: 1 1 100%; }
  .btn-tertiary { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .about, .about-body, .btn { transition: none; } }

/* =================================================================================
   The design log (from gallery-app's walk.css, its rules kept as they were), with the gallery's
   own tokens (tokens.css): pale type on the log's near-black scrim, smoked-glass filter and
   buttons. Only what the gallery set elsewhere is filled in here: the scrim (in the gallery it's
   About's, deepened), the chip strip's fade on a phone, and its place above the room's buttons.
   ================================================================================= */
.log {
  --color-log-backdrop: var(--color-scrim-log);
  --color-log-strip: var(--gradient-log-strip); /* behind the chips on a phone */
  --z-overlay-top: var(--z-log); /* over the room's buttons (6), under the portal's flash (8) and the loader */
  font: var(--type-body); /* the gallery's body type, not the page's serif */
  -webkit-font-smoothing: antialiased;
}
/* the gallery's resets, for the log only (:where keeps them weaker than the components') */
:where(.log) button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.log :focus-visible { outline: 2px solid var(--color-log-text); outline-offset: 2px; }
.log:focus { outline: none; }
.log[hidden], .log [hidden] { display: none !important; }
.log .icon { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fade { from { opacity: 0; } }

/* Frosted button: the same glass in CSS, for buttons over a dark overlay (where the WebGL
   glass sits underneath): frosted, a faint rim, and a lip of light across the top edge. */
.frost { display: grid; place-items: center; width: var(--size-control); height: var(--size-control); border-radius: var(--radius-round); color: var(--color-on-glass);
  background: radial-gradient(120% 120% at 50% 0%, rgb(var(--white-rgb) / 0.14), rgb(var(--white-rgb) / 0.04) 60%);
  backdrop-filter: blur(6px) saturate(1.3); -webkit-backdrop-filter: blur(6px) saturate(1.3);
  box-shadow: var(--shadow-frost);
  transition: color var(--motion-hover), transform var(--motion-hover); }
.frost:hover { color: var(--color-on-glass-hover); }
.frost:active { transform: scale(0.96); }
.frost:disabled, .frost[aria-disabled='true'] { opacity: 0.35; cursor: default; color: var(--color-on-glass); transform: none; } /* e.g. previous on the first change */
.frost .icon { width: var(--size-icon); height: var(--size-icon); filter: var(--shadow-icon); }
/* in a corner of the screen */
.frost-corner { position: absolute; top: calc(var(--inset) + env(safe-area-inset-top, 0px)); right: max(var(--inset), env(safe-area-inset-right, 0px)); } /* where the "?" button is, so a close lands where you tapped */
.frost-corner-left { right: auto; left: max(var(--inset), env(safe-area-inset-left, 0px)); }


/* Bar: a pill of controls, as tall as a glass button, with smaller buttons inside it. The audio
   tour bar (on the room's WebGL glass) and the design log's filter (.bar-smoke: CSS glass, over a
   dark overlay) are both bars.
   .bar-btn: a button in a bar, round for an icon, a pill with .bar-label for a word.
   .bar-btn[aria-pressed=true]: a toggle that's on, solid paper white. */
.bar { display: flex; align-items: center; height: var(--size-control); border-radius: var(--radius-pill); font: var(--type-bar); color: var(--color-on-glass); }
/* smoked rather than clear, so its labels stay readable (4.5:1 or better) even over a white image */
.bar-smoke { background: radial-gradient(120% 120% at 50% 0%, var(--color-glass-smoke-top), var(--color-glass-smoke) 60%);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); box-shadow: var(--shadow-frost); }
.bar-btn { display: grid; place-items: center; height: var(--size-bar-button); min-width: var(--size-bar-button); padding: 0; border-radius: var(--radius-pill); color: inherit; transition: background var(--motion-hover), color var(--motion-hover); }
.bar-btn:hover { background: var(--color-glass-wash); }
.bar-btn:focus-visible { outline: var(--focus-ring-on-glass); outline-offset: 1px; }
.bar-btn.bar-label { padding: 0 var(--space-12); font: inherit; white-space: nowrap; color: var(--color-on-glass-muted); }
.bar-btn.bar-label:hover { color: var(--color-on-glass); }
.bar-btn[aria-pressed='true'], .bar-btn[aria-pressed='true']:hover { background: var(--color-log-text); color: var(--color-log-ink-inverse); }
.bar-btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bar-btn { transition: none; } }


/* A quiet scrollbar: a thin thumb with no track, there only while you're over it. */
.quiet-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.quiet-scroll:hover { scrollbar-color: var(--scroll-thumb, var(--color-log-scrollbar)) transparent; }
.quiet-scroll::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
.quiet-scroll::-webkit-scrollbar-track { background: transparent; }
.quiet-scroll::-webkit-scrollbar-thumb { border-radius: var(--radius-sm); background: transparent; }
.quiet-scroll:hover::-webkit-scrollbar-thumb { background: var(--scroll-thumb, var(--color-log-scrollbar)); }


/* The design log: an overlay like About. The feed is images only, loosely placed and
   overlapping; tapping one opens it large, with what it is and the prompt behind it. Neutral
   greys. Everything is sized from the viewport (vw, vh, clamp), so it fits any window. */
/* In Emily's world it opens from About (the letter) and brings its own near-black backdrop over
   About's deepened scrim, so the whole overlay fades in and out with its content. Its back
   button, top left, returns to About (or, from a change, to the feed). */
.log { position: fixed; inset: 0; z-index: var(--z-overlay-top); color: var(--color-log-text); background: var(--color-log-backdrop); opacity: 0; transition: opacity var(--motion-overlay); }
.log.open { opacity: 1; }
.log-scroll, .log-back { opacity: 0; }
.log-scroll { transition: opacity var(--motion-overlay); }
.log-back, .log:not(.open) .log-close { transition: opacity var(--motion-overlay), color var(--motion-hover), transform var(--motion-hover); }
.log.open .log-scroll, .log.open .log-back { opacity: 1; }
.log:not(.open) .log-close { opacity: 0; }
.log-chips { display: contents; }
.log-scroll { position: absolute; inset: 0; z-index: 0; isolation: isolate; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.log-grid { display: grid; grid-template-columns: clamp(150px, 16vw, 230px) minmax(0, min(46vw, 640px)); justify-content: center; column-gap: clamp(28px, 6vw, 96px); padding: clamp(56px, 10vh, 110px) clamp(16px, 4vw, 48px) 40vh; }
.log-versions { position: sticky; top: 30vh; align-self: start; display: grid; gap: 1px; }
.log-label { margin: 0 0 var(--space-8); font-size: var(--font-size-13); color: var(--color-log-label); }
.log-version { padding: var(--space-4) 0; text-align: left; font-size: var(--font-size-14); line-height: 1.35; color: var(--color-log-tertiary); transition: color var(--motion-hover); }
.log-version:hover { color: var(--color-log-hover); }
.log-version.active { color: var(--color-log-text); }
.log-section { margin-bottom: clamp(64px, 14vh, 140px); }
/* the day dividers: a small centred date, as between days in a chat */
.log-day { margin: clamp(40px, 8vh, 80px) 0 var(--space-18); text-align: center; font-size: var(--font-size-13); color: var(--color-log-label); }
.log-day.top { margin-top: 0; }
.log-change { width: var(--w, 100%); margin: calc(var(--lap, 0) * 1vw + var(--lap, 0) * 0.6vh) 0 0 var(--x, 0%); }
.log-pile { display: flex; align-items: center; width: 100%; padding: 0; cursor: zoom-in; }
.log-img { position: relative; z-index: 0; display: block; flex: 1 1 0; min-width: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--color-log-media); box-shadow: var(--shadow-log-card); transform: translateY(var(--y, 0%)) rotate(var(--tilt, 0deg)); transition: transform var(--motion-move), box-shadow var(--motion-overlay); }
.log-pile.many .log-img + .log-img { margin-left: -9%; }
.log-img img, .log-img video { display: block; width: 100%; height: auto; }
/* loading: a skeleton in the image's own shape (its size is known ahead), a soft light passing
   over it; the image fades in when it arrives */
.log-img img { opacity: 0; transition: opacity var(--motion-overlay); }
.log-img.loaded img { opacity: 1; }
.log-img:not(.loaded) { background: var(--color-log-skeleton); }
.log-img:not(.loaded)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--color-log-skeleton-shine) 50%, transparent 70%) 0 0 / 250% 100%; animation: skeleton var(--motion-skeleton); }
@keyframes skeleton { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .log-img:not(.loaded)::after { animation: none; } .log-img img { transition: none; } }
/* hovered: it straightens, grows a little and lifts above everything near it */
.log-img:hover { z-index: 5; transform: translateY(var(--y, 0%)) rotate(0deg) scale(1.06); box-shadow: var(--shadow-log-card-hover); }
.log-change.selected .log-img { box-shadow: var(--shadow-log-card-selected); }
.log-close, .log-back { z-index: 4; } /* above the lightbox too */
/* filtered out: it fades, then leaves the feed (hidden); a chapter with nothing left stays in the
   list, dimmed and out of reach */
.log-change, .log-day, .log-section { transition: opacity var(--duration-200) var(--curve-ease); }
.log-version { transition: opacity var(--motion-overlay), color var(--motion-hover); }
.log-change.fading, .log-day.fading, .log-section.fading { opacity: 0; }
.log-change[hidden], .log-day[hidden], .log-section[hidden] { display: none; }
.log-change.lead { margin-top: 0; }
.log-version.off { opacity: 0.35; pointer-events: none; }
.log-version.off.active { color: var(--color-log-tertiary); }

/* the filter: a frosted pill like the tour bar, at the bottom centre of the feed; three toggles,
   and a clear once any is on. With a change open it rises above previous and next. */
.log-filter { position: absolute; z-index: 4; left: var(--feed-mid, 50%); bottom: calc(var(--inset) + env(safe-area-inset-bottom, 0px)); gap: var(--space-2); padding: 0 var(--space-4); /* a .bar .bar-smoke */
  opacity: 0; transform: translateX(-50%); transition: opacity var(--motion-overlay); }
.log.open .log-filter { opacity: 1; }
.log.boxed .log-filter { left: 50%; top: calc(var(--inset) + env(safe-area-inset-top, 0px)); bottom: auto; } /* at the top, between back and close: previous and next keep the bottom to themselves (and room for their tooltips) */
/* with a change open: it only says what's applied, its tags locked (those not on, dimmed), no
   clear; with nothing applied it has nothing to say, so it hides */
.log.boxed.filtered .log-box { padding-top: max(clamp(56px, 8vh, 88px), calc(var(--inset) + var(--size-control) + var(--space-16) + env(safe-area-inset-top, 0px))); } /* clear of it */
.log.boxed:not(.filtered) .log-filter { opacity: 0; visibility: hidden; transition: opacity var(--motion-overlay), visibility 0s var(--duration-300); }
.log-tag[aria-disabled='true'] { pointer-events: none; }
.log.boxed .log-tag-clear { display: none; } /* (it's changed in the feed) */
.log-tag[aria-disabled='true']:not([aria-pressed='true']) { opacity: 0.35; }
.log-filter-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* heard, not seen */
.log-tag-clear .icon { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .log-filter, .log-change, .log-day, .log-section, .log-version { transition: none; } }
.log-credit { margin: -8px 0 var(--space-18); font-size: var(--font-size-13); line-height: 1.5; color: var(--color-log-secondary); }
.log-credit a { color: var(--color-log-link); text-underline-offset: 2px; }
.log-credit a:hover, .log-intro-text a:hover { color: var(--color-log-text); }
.log-intro-text a { color: var(--color-log-link); text-underline-offset: 2px; }

/* wide screens with a mouse: a third column, where hovering an image shows its words */
.log-peek-col { display: none; }
/* the log's opening: how it was made, and a grid of the tools. In the third column on a wide
   screen with a mouse (fading while a hovered image's prompt has the column); else atop the feed */
.log-intro { display: grid; gap: var(--space-10); }
.log-intro.in-feed { margin-bottom: clamp(48px, 10vh, 96px); }
.log-intro.in-col { position: sticky; top: clamp(56px, 10vh, 110px); /* stays where it starts, clear of the close button */ max-height: calc(100vh - clamp(56px, 10vh, 110px) - 24px); max-height: calc(100dvh - clamp(56px, 10vh, 110px) - 24px); overflow-y: auto; scrollbar-width: none; transition: opacity var(--motion-hover); }
.log.peeking .log-intro.in-col { opacity: 0; pointer-events: none; }
.log-intro-title { margin: 0; font-size: clamp(15px, 1.2vw, 17px); font-weight: var(--weight-semibold); color: var(--color-log-text); }
.log-intro-text { margin: 0; font-size: clamp(14px, 1vw, 15px); line-height: 1.5; color: var(--color-log-secondary); }
.log-intro .log-label { margin: var(--space-8) 0 0; }
.log-intro-text.lead { color: var(--color-log-text); }
/* the tools: small square marks in their own colours, like app icons; each named on hover */
.log-tools { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: 0; padding: 0; list-style: none; }
.log-tool { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; overflow: hidden; background: var(--tool, var(--color-log-surface)); color: var(--white);
  box-shadow: 0 0 0 1px var(--color-log-rim); transition: transform var(--motion-hover), box-shadow var(--motion-hover); }
.log-tool:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--color-log-rim-hover); }
.log-tool:focus-visible { outline: 2px solid var(--color-log-text); outline-offset: 2px; }
.log-tool svg { width: 24px; height: 24px; }
.log-tool img { width: 100%; height: 100%; object-fit: cover; }
.log-tool img[src$=".svg"] { width: 30px; height: 30px; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .log-tool, .log-tool:hover { transition: none; transform: none; } }
.log-peek { position: absolute; top: 0; z-index: 1; max-height: calc(100% - 48px); overflow-y: auto; pointer-events: none; opacity: 0; transform: translateY(var(--at, 96px)); transition: opacity var(--motion-hover), transform var(--duration-300) var(--curve-out-expo); }
.log-peek.on { opacity: 1; }
.log-peek.instant { transition: opacity var(--motion-hover); }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .log-grid { grid-template-columns: clamp(150px, 13vw, 220px) minmax(0, min(40vw, 600px)) clamp(220px, 22vw, 340px); column-gap: clamp(28px, 4.5vw, 80px); }
  .log-peek-col { display: block; }
  .log-intro.in-feed { display: none; }
}

/* the lightbox: the image(s) as large as the window allows, the words beside them (or below) */
.log-box { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 26vw, 380px); gap: clamp(20px, 3vw, 48px); align-items: center; padding: clamp(56px, 8vh, 88px) clamp(32px, 4vw, 72px) calc(var(--inset) + var(--size-control) + var(--space-16) + env(safe-area-inset-bottom, 0px)); opacity: 0; transition: opacity var(--motion-fade); }
.log-box.open { opacity: 1; }
.log-box-media { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1vw, 16px); min-width: 0; height: 100%; max-height: calc(100vh - clamp(88px, 14vh, 160px)); max-height: calc(100dvh - clamp(88px, 14vh, 160px)); }
.log-box-media img, .log-box-media video { display: block; width: auto; height: auto; min-width: 0; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--shadow-log-media); animation: fade var(--motion-fade) both; }
.log-box-media.n2 img { max-width: calc(50% - 8px); }
.log-box-media.n3 img { max-width: calc(33.3% - 8px); }
.log-box-media.n4 img { max-width: calc(25% - 10px); }
.log-box-info { align-self: center; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.log-box-title { margin: 0 0 var(--space-4); font-size: clamp(15px, 1.2vw, 17px); font-weight: var(--weight-semibold); }
.log-box-note { margin: 0 0 var(--space-18); font-size: clamp(14px, 1vw, 15px); line-height: 1.5; color: var(--color-log-secondary); }
.log-prompt-top { display: flex; justify-content: space-between; margin: 0 0 var(--space-8); font-size: var(--font-size-13); color: var(--color-log-label); }
.log-prompt-text { margin: 0 0 var(--space-6); padding: var(--space-12) var(--space-16); border-radius: var(--radius-lg); background: var(--color-log-surface); font-size: clamp(14px, 1vw, 15.5px); line-height: 1.5; color: var(--color-log-prompt); }
.log-box-nav { top: auto; bottom: calc(var(--inset) + env(safe-area-inset-bottom, 0px)); }
/* previous and next side by side at the bottom centre, like the room's arrows */
.log-box-nav.prev { right: auto; left: calc(50% - var(--size-control) - var(--gap-controls) / 2); }
.log-box-nav.next { right: auto; left: calc(50% + var(--gap-controls) / 2); }
/* the lightbox takes the feed's place: the feed fades out, the back and close buttons stay on top */
.log.boxed .log-scroll { opacity: 0; }

/* narrower: the words go under the image */
@media (max-width: 900px), (max-aspect-ratio: 5/4) {
  .log-box { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; padding: clamp(60px, 9vh, 80px) var(--space-16) 0; gap: var(--space-16); }
  .log-box-media { max-height: none; }
  /* three or four images scroll sideways, edge to edge rather than clipped at the margin */
  .log-box-media.n3, .log-box-media.n4 { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-16)); padding: 0 var(--space-16); scroll-padding: 0 var(--space-16); }
  .log-box-media.n3 img, .log-box-media.n4 img { max-width: 72%; flex: none; }
  .log-box-info { max-height: 46vh; max-height: 46dvh; padding-bottom: calc(var(--inset) + var(--size-control) + var(--space-16) + env(safe-area-inset-bottom, 0px)); } /* runs to the bottom edge, under previous and next; the last line can scroll clear of them */
}
@media (max-width: 760px) {
  .log-grid { display: block; padding: calc(var(--inset) + var(--size-control) + var(--space-18) + env(safe-area-inset-top, 0px)) var(--space-16) 40vh; }
  /* the chips sit along the bottom, by the thumb, leaving the top corners to back and close;
     they fade out at each end as they scroll */
  .log-versions { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 6; display: block; padding: var(--space-28) 0 calc(var(--space-14) + env(safe-area-inset-bottom, 0px)); background: var(--color-log-strip); }
  .log-chips { display: flex; align-items: center; gap: var(--space-6); padding: 0 var(--space-16); overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--space-16), #000 calc(100% - var(--space-16)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--space-16), #000 calc(100% - var(--space-16)), transparent); }
  .log-chips::-webkit-scrollbar { display: none; }
  .log-versions .log-label { display: none; } /* (the chips need no heading; the intro's Tools label stays) */
  .log-version { flex: none; padding: 7px var(--space-12); border-radius: var(--radius-pill); font-size: var(--font-size-14); white-space: nowrap; background: var(--color-log-surface); }
  .log-version.active { background: var(--color-log-text); color: var(--color-log-ink-inverse); }
  .log-change { width: max(var(--w, 100%), 78%); margin-left: calc(var(--x, 0%) * 0.5); }
  .log-img { border-radius: var(--radius-md); }
  /* on a phone: at the top, between back and close (the bottom has the chip strip) */
  .log-filter, .log.boxed .log-filter { left: 50%; top: calc(var(--inset) + env(safe-area-inset-top, 0px)); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { .log, .log-scroll, .log-back, .log-close, .log-box, .log-img, .log-box-media img, .log-box-media video { transition: none; animation: none; } }


/* Emily's palette on the frosted buttons and the filter: over blush, a clear frost would vanish,
   so they're smoked rose (as the room's glass buttons are before the glass is drawn) */
.log .frost { background: radial-gradient(120% 120% at 50% 0%, var(--color-glass-smoke-top), var(--color-glass-smoke) 60%); }
.log .bar-btn[aria-pressed='true'], .log .bar-btn[aria-pressed='true']:hover { background: var(--color-log-text); color: var(--color-log-ink-inverse); }
.log .frost:focus-visible { outline-offset: 3px; }
/* on a phone the tags are set a little tighter, centred at the top between the back button (top
   left, back to About) and the close button */
@media (max-width: 760px) {
  .log .bar-btn.bar-label { padding: 0 9px; font-size: var(--font-size-13); }
}

/* Tooltips for the icon buttons (src/tooltip.js, from gallery-app): a light pill with a pointer.
   After a moment's pause it pops in (a quick fade and a slight grow from the pointer) and pops out
   just as quickly. Below a button near the top of the screen, above one lower down. */
.tooltip { position: fixed; z-index: var(--z-tooltip); max-width: 240px; padding: 7px 11px; border-radius: 8px; pointer-events: none;
  background: var(--color-tooltip); color: var(--color-tooltip-ink); font: var(--weight-medium) var(--font-size-14)/1.25 var(--font-sans); box-shadow: var(--shadow-thumb);
  opacity: 0; transform: scale(0.92); transform-origin: var(--point, 50%) 100%;
  transition: opacity var(--motion-tip-out), transform var(--motion-tip-out); }
.tooltip::after { content: ''; position: absolute; left: var(--point, 50%); top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--color-tooltip); border-bottom: 0; }
.tooltip.below { transform-origin: var(--point, 50%) 0; }
.tooltip.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom: 6px solid var(--color-tooltip); border-top: 0; }
.tooltip.on { opacity: 1; transform: none; transition: opacity var(--motion-tip-in) var(--motion-tip-delay), transform var(--motion-tip-in) var(--motion-tip-delay); }
@media (prefers-reduced-motion: reduce) { .tooltip, .tooltip.on { transform: none; } }
