:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  color: #272739;
  background: #f7f7fa;
  --ink: #272739;
  --text-muted: #59596e;
  --border: #d3d2df;
  --surface: #fdfcff;
  --paper: #f1f0f6;
  --accent: #009CFF;
  --link-ink: var(--accent);
}
@media (prefers-contrast: more) { :root { --link-ink: #0066ad; } }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button, input { font: inherit; }
.wall-note:focus-visible, .wall-note :focus-visible, .switch-row:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.studio { --inset: clamp(8px, 1.4vw, 18px); }
.stage { position: fixed; inset: 0; overflow: clip; background: var(--paper); }
.stage-input {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.stage-input:focus-visible { outline: none; }
.stage:has(.stage-input:focus-visible)::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 2px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.wall-note {
  --wall-edge: clamp(24px, 6.5vw, 112px);
  --wall-content-width: min(24rem, calc(100% - 2 * var(--wall-edge)));
  --wall-width: var(--wall-content-width);
  --wall-position: var(--wall-edge);
  --wall-home-title-size: clamp(2.25rem, 4.2vw, 3.65rem);
  --wall-start: clamp(62px, 11vh, 112px);
  --wall-top: var(--wall-start);
  --wall-bottom: calc(var(--wall-floor, 66vh) - 24px);
  --wall-fade-top: 0px;
  --wall-fade-bottom: 0px;
  position: absolute;
  z-index: 1;
  inset: var(--wall-top) auto auto var(--wall-position);
  transform: translate(var(--wall-shift, 0px), var(--wall-rise, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: var(--wall-width);
  max-height: max(0px, calc(var(--wall-bottom) - var(--wall-top)));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 4px 12px 16px 0;
  mask-image: linear-gradient(to bottom, transparent, black var(--wall-fade-top),
    black calc(100% - var(--wall-fade-bottom)), transparent);
}
.wall-note[data-scroll-above] { --wall-fade-top: 16px; }
.wall-note[data-scroll-below] { --wall-fade-bottom: 22px; }
.wall-note:focus-visible, .wall-note:has(:focus-visible) { mask-image: none; }
.wall-note > * { flex: none; }
.wall-note h1, .wall-note h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}
.wall-note h1 { font-size: var(--wall-home-title-size); }
.wall-note .pane-title {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: pointer;
}
.faq-pane h2 { font-size: clamp(1.35rem, 2.1vw, 1.9rem); line-height: 1.1; }
.faq-pane h2::before {
  /* Match the intro line's font metrics without changing the visible heading size. */
  content: "\200b";
  font-size: var(--wall-home-title-size);
  letter-spacing: 0;
  line-height: 1;
}
.wall-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.45;
  text-wrap: pretty;
}
.wall-note a {
  color: var(--link-ink);
  font-weight: 600;
  text-underline-offset: 0.2em;
}
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-links a, #faq-answer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  font-size: .875rem;
  text-decoration: none;
}
.profile-links a:is(:hover, :focus-visible), #faq-answer a:is(:hover, :focus-visible) {
  background: var(--surface);
  text-decoration: underline;
}
.profile-links img { display: block; flex: none; object-fit: contain; }
.faq-pane {
  --wall-position: max(56%, calc(var(--wall-edge) + var(--wall-width) + 128px));
  padding-bottom: 8px;
  animation: faq-arrive 620ms 2.6s cubic-bezier(.2, .65, .3, 1) both;
}
@keyframes faq-arrive {
  0% { visibility: hidden; opacity: 0; translate: var(--faq-drift, 16px) 0; }
  1% { visibility: visible; }
  100% { visibility: visible; opacity: 1; translate: 0 0; }
}
.faq-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}
.faq-view[data-entered]:not([hidden]) { animation: faq-view-in 190ms ease-out both; }
@keyframes faq-view-in {
  from { opacity: 0; translate: var(--faq-view-drift, 7px) 0; }
  to { opacity: 1; translate: 0 0; }
}
#faq-list { --faq-view-drift: -7px; }
#faq-answer { display: grid; gap: 12px; }
.faq-date { margin-inline-start: auto; color: var(--text-muted); font-size: .8rem; text-align: end; }
.faq-heading { display: flex; align-items: center; gap: 12px; width: 100%; }
.faq-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; width: 100%; }
.faq-view button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
.faq-list button, .faq-open, .faq-chevron { display: flex; }
.faq-list button, .faq-open, .faq-heading .faq-chevron {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  font-weight: 600;
}
.faq-list button { width: 100%; }
.faq-open { min-height: 44px; color: var(--link-ink); cursor: pointer; }
.faq-heading .faq-chevron {
  flex: none;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
}
.faq-list button::after, .faq-open::after, .offscreen-indicator::before, .faq-chevron::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border: solid var(--accent);
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.faq-chevron::before { transform: rotate(-135deg); }
.faq-list button:hover, .faq-open:hover, .faq-open:active,
.faq-heading .faq-chevron:hover, .faq-heading .faq-chevron:active {
  background: var(--surface);
  color: var(--link-ink);
}
.mobile-faq-nav { display: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 980px) {
  .faq-pane { --wall-position: 56%; --wall-width: calc(100% - var(--wall-position) - var(--wall-edge)); }
}
@media (prefers-reduced-motion: reduce) {
  .faq-pane { --faq-drift: 0px; animation-duration: 180ms; }
  .faq-view[data-entered]:not([hidden]) { animation: none; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .wall-note {
    --wall-home-title-size: clamp(2rem, 9vw, 2.8rem);
    --wall-start: max(28px, calc(env(safe-area-inset-top, 0px) + 20px));
    gap: 8px;
  }
}
@media (max-width: 860px) and (orientation: portrait), (max-height: 540px) and (pointer: coarse) {
  .wall-note {
    --wall-safe-edge: max(20px, calc(max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) + 12px));
    --wall-edge: var(--wall-safe-edge);
    --wall-content-width: calc(100% - 2 * var(--wall-edge));
    padding-inline: 0;
  }
  .faq-pane {
    --wall-position: calc(var(--wall-edge) + 100%);
    --wall-width: var(--wall-content-width);
    animation: none;
  }
  .mobile-faq-nav { display: flex; align-items: center; }
  .faq-pane h2::before { content: none; }
  .faq-view:not([hidden]) { gap: 8px; }
  .faq-list button { gap: 8px; padding: 5px 9px; font-size: .9rem; }
  .faq-list button:focus-visible { outline-offset: -2px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .wall-note {
    --wall-start: 32px;
    --wall-home-title-size: clamp(1.75rem, 5vw, 3rem);
    max-width: min(38%, 20rem);
    gap: 8px;
  }
  .faq-view:not([hidden]) { gap: 8px; }
  .faq-pane h2 { font-size: 1.35rem; }
  .faq-list button { gap: 8px; padding: 5px 9px; font-size: .9rem; }
}
@media (max-height: 540px) and (orientation: landscape) and (pointer: coarse) {
  .wall-note {
    --wall-edge: max(var(--wall-safe-edge), calc((100% - 32rem) / 2));
    max-width: none;
  }
}
.offscreen-indicator {
  position: absolute;
  z-index: 4;
  left: var(--indicator-x);
  top: var(--indicator-y);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--link-ink);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.offscreen-indicator[hidden] { display: none; }
.offscreen-indicator::before { transform: rotate(calc(45deg + var(--indicator-angle))); }
.offscreen-indicator[data-direction="right"] { flex-direction: row-reverse; text-align: end; }
.offscreen-indicator:hover .indicator-copy > span { text-decoration: underline; }
.offscreen-indicator:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.indicator-copy { display: grid; gap: 2px; }
.indicator-copy small { color: var(--text-muted); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.speed {
  position: absolute;
  z-index: 3;
  top: calc(var(--inset) + 12px);
  left: var(--inset);
  pointer-events: none;
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.error {
  position: absolute;
  z-index: 3;
  inset: 30% 20px auto;
  margin: 0;
  border: 1px solid var(--border);
  padding: 16px;
  background: var(--surface);
  border-radius: 7px;
}
.controls {
  position: fixed;
  z-index: 4;
  top: var(--inset);
  right: var(--inset);
}
.control-card summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.control-card summary::-webkit-details-marker { display: none; }
.control-card summary:hover, .control-card[open] summary { color: var(--accent); }
.control-card summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.control-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(236px, calc(100vw - 2 * var(--inset)));
  max-height: calc(100dvh - 2 * var(--inset) - 44px);
  overflow: auto;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px #38304818;
}
@media (max-width: 600px), (max-height: 540px) and (pointer: coarse) {
  .controls {
    top: auto;
    right: max(14px, calc(env(safe-area-inset-right, 0px) + 12px));
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  }
  .control-body {
    position: absolute;
    right: 0;
    bottom: calc(100% + 4px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 78px);
  }
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-radius: 6px;
  position: relative;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
}
.switch-row input { position: absolute; opacity: 0; inset: 0; width: 100%; margin: 0; cursor: inherit; }
.switch {
  width: 37px;
  height: 21px;
  border-radius: 15px;
  background: #ebeaf1;
  border: 1px solid #9f9bb1;
  pointer-events: none;
}
.switch::after {
  content: "";
  width: 13px;
  height: 13px;
  margin: 3px;
  display: block;
  background: #706980;
  border-radius: 50%;
  transition: transform .18s ease-out;
}
input:checked + .switch {
  border-color: color-mix(in srgb, var(--accent) 75%, var(--ink));
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
}
input:checked + .switch::after { transform: translateX(16px); background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .switch::after { transition: none; }
}
