:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07080c;
  color: #e8eaf0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.panel {
  position: fixed;
  top: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(8px);
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

/* The way back to the main page sits with the title, so it is there even when the
   controls are hidden behind a notice. */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-link {
  display: inline-block;
  padding-block: 12px;
  color: #7fc4ff;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

.hint {
  margin: 2px 0 12px;
  color: #aab0bf;
  font-size: 14px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.controls[hidden] {
  display: none;
}

label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

button,
select {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

button:hover,
select:hover {
  background: rgba(255, 255, 255, 0.14);
}

:focus-visible {
  outline: 2px solid #7fd4ff;
  outline-offset: 2px;
}

/* Signature in the corner away from the panel; strokes pass through it to the canvas. */
.credit {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.78);
  color: #c4c9d4;
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
  pointer-events: none;
}

.credit p,
.credit ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Narrow screens wrap between segments, never inside one. */
.credit li span {
  white-space: nowrap;
}

.credit b {
  color: #e8eaf0;
  font-weight: 600;
}

/* The one live part of the credit: the way into the process note. Inline-block keeps
   "작업과정 보기 →" one run of text; the padding makes a 44px target. */
.credit-process {
  display: inline-block;
  padding-block: 12px;
  line-height: 20px;
  color: #7fc4ff;
  font-size: 14px;
  pointer-events: auto;
  text-decoration: none;
}

.notice {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100% - 32px));
  margin: 0;
  padding: 20px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  background: #151822;
  text-align: center;
}

@media (max-width: 480px) {
  .panel {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .credit {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 12px;
    max-width: none;
    text-align: left;
  }
}

/* The process note: one node. Without JS it is ordinary content under the toy, so the page
   scrolls and the playable parts drop into the flow. */
html:not(.js),
html:not(.js) body {
  height: auto;
  overflow: auto;
}

html:not(.js) canvas,
html:not(.js) .controls,
html:not(.js) .process-close {
  display: none;
}

html:not(.js) .panel,
html:not(.js) .credit,
html:not(.js) .notice {
  position: static;
  width: auto;
  max-width: none;
  margin: 16px;
  transform: none;
}

html:not(.js) .process-bar {
  position: static;
}

.process {
  position: static;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0d1320;
  color: #f5f1ea;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* With JS the same node only shows as the modal reader. */
html.js .process:not(:modal) {
  display: none;
}

.process:modal {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(47.5rem, 100%);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-inline-start: 1px solid rgba(162, 174, 214, 0.27);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.33);
}

.process::backdrop {
  background: rgba(7, 10, 18, 0.5);
}

.process-bar {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 40px;
  border-block-end: 1px solid rgba(162, 174, 214, 0.18);
  background: #0d1320;
  font-size: 14px;
}

.process-crumb {
  margin: 0;
}

.process-close,
.process-end a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid rgba(162, 174, 214, 0.27);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.process-body {
  padding: 38px 48px 70px;
}

.process-body > *,
.process-section > * {
  max-width: 42rem;
}

.process-eyebrow {
  margin: 0;
  color: #66b7ff;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.process h2 {
  margin: 12px 0;
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.process h3 {
  margin: 38px 0 12px;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.process h4 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.5;
}

.process p {
  margin: 0;
}

.process-deck {
  color: #b8c0d2;
  font-size: 15px;
}

.process-axes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0 20px;
}

.process-axes dt {
  color: #a9b1c5;
  font-size: 13px;
}

.process-axes dd {
  margin: 0;
  font-size: 15px;
}

.process-prompt {
  margin: 0 0 20px;
  padding: 16px 20px;
  border-inline-start: 2px solid #66b7ff;
  background: #111a2a;
}

.process-prompt figcaption {
  color: #a9b1c5;
  font-size: 13px;
}

.process-prompt blockquote {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.5;
}

.process-note {
  color: #a9b1c5;
  font-size: 14px;
  line-height: 1.7;
}

.process-credits {
  margin-block-start: 24px;
  padding-block: 18px;
  border-block-start: 1px solid rgba(162, 174, 214, 0.18);
}

.process .process-credits h3 {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
}

.process-credits ul {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.process-credits li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 18px;
  margin: 8px 0;
  font-size: 14px;
}

.process-credits b {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.process-credits li:nth-child(1) b {
  color: #b69bff;
}

.process-credits li:nth-child(2) b {
  color: #66b7ff;
}

.process-credits li:nth-child(3) b {
  color: #e7b769;
}

.process-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 8px;
  padding-block: 8px;
  border-block: 1px solid rgba(162, 174, 214, 0.18);
}

.process-contents a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-inline: 8px;
  color: #7fc4ff;
  font-size: 15px;
}

.process-section {
  scroll-margin-top: 80px;
}

.process-steps {
  margin: 20px 0;
  padding-inline-start: 28px;
}

.process-steps li {
  margin: 18px 0;
  padding-inline-start: 6px;
}

.process-steps li::marker {
  color: #66b7ff;
  font-size: 14px;
}

.process-steps p,
.process-review {
  color: #c4cada;
  font-size: 15px;
}

.process-time {
  color: #a9b1c5;
  font-size: 14px;
}

.process-reconstruction {
  padding: 14px 18px;
  border: 1px solid rgba(162, 174, 214, 0.2);
  border-radius: 6px;
  color: #c4cada;
  font-size: 15px;
}

.process-section article {
  margin: 28px 0;
}

.process-section article p {
  color: #c4cada;
  line-height: 1.9;
}

.process-review {
  margin: 12px 0 0;
  padding-inline-start: 20px;
}

.process-review li {
  margin: 10px 0;
}

.process-end {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 40px;
  padding-block-start: 22px;
  border-block-start: 1px solid rgba(162, 174, 214, 0.18);
}

@media (max-width: 800px) {
  .process-bar {
    padding: 12px 20px;
  }

  .process-body {
    padding: 26px 24px 48px;
  }

  .process h2 {
    font-size: 31px;
  }

  .process h3 {
    font-size: 24px;
  }

  .process-prompt blockquote {
    font-size: 17px;
  }

  .process-credits li {
    grid-template-columns: 76px 1fr;
    gap: 10px;
  }
}
