/* © 2026 Joe Chung. All rights reserved.
   This file is published so that the sketch runs in your browser. It is not licensed
   for copying, reuse, modification or redistribution without written permission
   (hello@flamegame.studio). Third-party components keep their own licences. */
html, body {
  margin: 0;
  padding: 0;
}
body {
  background: #ecebe6;
  font-family: system-ui, -apple-system, Helvetica, Arial, sans-serif;
  color: #161514;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease;
}
body.ready #scene { opacity: 1; }

/* lab: the canvas is the whole piece */
body:not(.scroll) { overflow: hidden; }
body:not(.scroll) #mock { display: none; }

/* ?scroll: the canvas is a blurred layer behind translucent sections */
body.scroll #scene {
  filter: blur(var(--blur, 6px)) saturate(0.9);
  transform: scale(1.04); /* the blur's soft rim stays off screen */
  pointer-events: none;
}
/* ?bg: the home page's background (ADR-068). Nothing but the scene; the page
   blurs the iframe itself */
body.bg #scene { pointer-events: none; }
body.bg .panel { display: none; }

#mock { position: relative; z-index: 1; }
#mock section {
  min-height: 100vh;
  box-sizing: border-box;
  padding: 18vh 8vw 12vh;
  background: color-mix(in srgb, var(--band) var(--fill, 55%), transparent);
}
#mock h2 {
  margin: 0 0 24px;
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
#mock p {
  max-width: 36em;
  font-size: 18px;
  line-height: 1.5;
}

/* the visitor's two words (deployed lab): a quiet bar at the bottom, centred */
#visit {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  font-family: monospace;
  font-size: 13px;
  color: #262626;
}
body.edit #visit,
body.scroll #visit,
body.bg #visit { display: none; }
#visit .word {
  box-sizing: border-box;
  width: 12ch;
  min-width: 0;
  flex: 0 1 auto;
  padding: 6px 9px;
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: rgba(236, 235, 230, 0.85);
  border: 1px solid #cfccc4;
  border-radius: 0;
}
#visit .word:focus { outline: none; border-color: #262626; }
#visit .swap { color: #8a8780; }

/* the owner's panel (?edit) */
.panel {
  position: fixed;
  z-index: 2;
  top: 16px;
  left: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  width: 220px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 14px;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #262626;
  background: rgba(236, 235, 230, 0.92);
  border: 1px solid #cfccc4;
}
body:not(.edit) .panel { display: none; }
.panel .sec { display: flex; flex-direction: column; gap: 6px; }
.panel .sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8780;
}
.panel .sec-title::after { content: ''; flex: 1; height: 1px; background: #d6d3cb; }
.panel button {
  box-sizing: border-box;
  width: 100%;
  padding: 5px 9px;
  font-family: monospace;
  font-size: 11px;
  text-align: left;
  background: transparent;
  border: 1px solid #cfccc4;
  color: #262626;
  cursor: pointer;
}
.panel button:hover { border-color: #262626; background: rgba(38, 38, 38, 0.05); }
.panel .text-view {
  padding: 6px 9px;
  border: 1px solid #cfccc4;
  white-space: pre-wrap;
  word-break: break-all;
  font-weight: 700;
}
.panel .text-view { cursor: pointer; min-height: 1.5em; }
.panel .text-view:not(.active) { color: #8a8780; }
.panel .text-view:not(.active)::after { content: none; }
.panel .text-view::after { content: '▍'; color: #e0442b; }
body.scroll .panel .lab-only { display: none; }
.panel .note { color: #8a8780; }
.panel .slider { display: flex; align-items: center; gap: 8px; }
.panel .slider .label { width: 5.5em; color: #8a8780; }
.panel .slider .value { width: 2.6em; text-align: right; }
.panel .slider input[type=range] { flex: 1; min-width: 0; margin: 0; accent-color: #262626; }
