:root {
  color-scheme: light;
  --ink: #23362d;
  --muted: #4c5849;
  --accent: #a3462d;
  --line: #54594a;
  --divider: #c5c2ad;
  --focus: #854126;
  --canvas: #f6f1e6;
  --surface: #fbf8ef;
  --cover: #eee8d9;
  --selection: #e3e8d8;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --display: Georgia, "Times New Roman", serif;
  --edge: clamp(12px, 2vw, 30px);
  --ease: cubic-bezier(.2,.8,.2,1);
  font: 100%/1.5 system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input { font: inherit; }
button {
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms, color 140ms, border-color 140ms;
}
button:active { background-color: var(--cover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: wait; }
button[aria-disabled="true"] { opacity: .5; cursor: default; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.studio {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
#scene { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.signature {
  position: absolute;
  inset: var(--edge) auto auto var(--edge);
  min-height: 44px;
  padding: 0;
  font: 700 1.15rem/1.2 var(--display);
  text-align: left;
  pointer-events: auto;
}
.signature:hover { text-decoration: underline; text-underline-offset: 3px; }
.paper {
  background: var(--surface);
  border: 1px solid var(--line);
}
.launch {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  gap: 28px;
  width: clamp(292px, 31vw, 450px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 3.9vw, 62px);
  border-right: 1px solid var(--line);
  background: var(--cover);
  transition: opacity 260ms var(--ease), transform 360ms var(--ease), visibility 260ms;
}
.entered .launch { opacity: 0; visibility: hidden; transform: translateX(-30px); }
.course-line, .eyebrow { font: 600 .73rem/1.4 var(--mono); letter-spacing: .04em; color: var(--accent); }
.course-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
#launch-date { color: var(--muted); }
h1 {
  margin: 15px 0 10px;
  font: 700 clamp(2.15rem, 4.15vw, 3.5rem)/1.03 var(--display);
  letter-spacing: -.055em;
}
.subtitle { color: var(--muted); line-height: 1.55; max-width: 27ch; }
.launch-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.primary {
  min-height: 48px;
  padding: 8px 24px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
}
.primary:hover { background: #244c39; }
.primary:active { background: #294636; }
.text-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border-radius: 4px; padding: 6px 9px; color: var(--muted); font-size: .84rem; }
.text-button svg { width: 17px; height: 17px; }
.text-button:hover { background: var(--selection); color: var(--ink); }
.launch .text-button { padding-inline: 0; }
.launch .text-button:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }

.workspace { position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 430ms var(--ease), visibility 430ms; }
.entered .workspace { opacity: 1; visibility: visible; }
.tool-dock, .parameters, .canvas-controls { pointer-events: auto; position: absolute; }
.tool-dock {
  top: var(--edge);
  right: var(--edge);
  display: flex;
  gap: 4px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
}
.icon-button:hover, .icon-button[aria-expanded="true"] {
  background: var(--selection);
  color: var(--ink);
}
.icon-button[aria-expanded="true"] { border-color: var(--divider); }
.parameters {
  width: min(278px, calc(100% - 2 * var(--edge)));
  max-height: calc(100% - var(--edge) * 2 - 153px);
  right: var(--edge);
  top: calc(var(--edge) + 51px);
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  transition: opacity 220ms var(--ease), transform 250ms var(--ease), visibility 220ms;
}
.parameters.collapsed { opacity: 0; visibility: hidden; transform: translateX(14px); }
.panel-head, .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-head { padding: 3px 4px 3px 14px; border-bottom: 1px solid var(--divider); }
h2 { font: 700 1.2rem/1.25 var(--display); letter-spacing: -.025em; }
#collapse svg { transform: rotate(-90deg); }
.panel-body { min-height: 0; padding: 9px 14px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.range-field + .range-field { border-top: 1px solid var(--divider); padding-top: 8px; }
.range-field > div { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: .86rem; }
output {
  flex: none;
  min-width: 3.45em;
  text-align: right;
  color: var(--ink);
  font: .81rem/1.35 var(--mono);
}
input[type="range"] { display: block; width: 100%; min-height: 28px; margin: 0; accent-color: #477757; cursor: pointer; }
.panel-foot { padding: 1px 5px; border-top: 1px solid var(--divider); }
.entered #scene { cursor: grab; touch-action: none; outline-offset: -3px; }
.entered #scene.panning { cursor: grabbing; }

.canvas-controls {
  bottom: var(--edge);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 2 * var(--edge));
  border-radius: 3px;
}
.branch-label {
  padding: 0 12px;
  color: var(--muted);
  font: .76rem/1.4 var(--mono);
  white-space: nowrap;
}
.zoom-dock { display: flex; align-items: stretch; border-left: 1px solid var(--divider); }
.follow {
  min-height: 44px;
  padding: 5px 13px;
  white-space: nowrap;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 700;
}
.follow:hover { background: var(--selection); }
#zoom-fit {
  min-width: 69px;
  padding: 0 8px;
  border-inline: 1px solid var(--divider);
  color: var(--ink);
  font: .81rem/1 var(--mono);
}
#zoom-fit:hover { background: var(--selection); }
.notice { position: absolute; z-index: 3; top: var(--edge); left: 50%; transform: translate(-50%, 6px); width: max-content; max-width: 85%; padding: 10px 15px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity 160ms, transform 160ms; }
.notice.visible, noscript .notice { opacity: 1; transform: translate(-50%, 0); }

.dialog { color: var(--ink); width: min(420px, calc(100% - 24px)); max-height: calc(100% - 32px); overscroll-behavior: contain; padding: 23px; border-radius: 6px; }
.dialog::backdrop { background: #2c342850; }
.dialog[open] { animation: dialog-in 230ms var(--ease); }
.dialog h2 { font-size: 1.34rem; }
.dialog h3 { font-size: 1rem; }
.dialog p:not(.eyebrow) { margin-top: 7px; color: var(--muted); }
.dialog-head { margin-bottom: 13px; }
.credits-name { font-weight: 700; }
#credits h3 { margin-top: 18px; border-top: 1px solid var(--divider); padding-top: 12px; }
.credits-list { list-style: none; padding: 0; margin: 10px 0 0; }
.credits-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 7px 0; overflow-wrap: anywhere; }
.credits-list span { color: var(--muted); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (max-width: 780px) {
  .parameters { z-index: 1; }
}
@media (max-width: 420px) {
  .tool-dock { gap: 0; }
  .tool-dock .icon-button { width: 40px; min-width: 40px; }
  .canvas-controls { flex-wrap: wrap; justify-content: center; }
  .branch-label { padding-inline: 8px; }
  .follow { padding-inline: 8px; }
  #zoom-fit { min-width: 54px; }
}
@media (max-width: 650px) {
  .launch { width: 46%; padding: 16px; }
  .launch-controls { gap: 6px; }
  h1 { font-size: clamp(1.35rem, 5.6vw, 2.8rem); }
  .subtitle { font-size: .875rem; }
}
@media (max-width: 650px) and (min-height: 521px) {
  .launch {
    inset: auto 0 0;
    width: auto;
    max-height: 55%;
    gap: 15px;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .entered .launch { transform: translateY(16px); }
  h1 { margin: 6px 0; font-size: clamp(2.05rem, 10vw, 3.4rem); }
  .subtitle { max-width: 40ch; }
}
@media (max-height: 590px) {
  .signature { top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

