:root {
  color-scheme: light;
  --page: #f1f2eb;
  --ink: #272e23;
  --muted: #596354;
  --accent: #345d45;
  --line: #cfd5c8;
  --button: #e7eadf;
  --active-ink: #f8fff7;
  --photo-frame: #f8f7ee;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  transition: background-color .28s ease, color .28s ease;
}
body.night {
  color-scheme: dark;
  --page: #181f24;
  --ink: #f1efe5;
  --muted: #b6bfba;
  --accent: #b4cbb9;
  --line: #47524f;
  --button: #293337;
  --active-ink: #202b26;
  --photo-frame: #a5aaa3;
}
.room {
  width: min(1120px, calc(100% - 3.75rem));
  margin: clamp(1.5rem, 5vh, 3.5rem) auto 1.5rem;
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
h1 {
  margin: 0;
  font-family: "AppleMyungjo", "Batang", "Noto Serif KR", serif;
  font-size: clamp(2.2rem, 4.7vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.intro p { margin: .55rem 0 0; }
#hint { color: var(--muted); font-size: .95rem; }
.maker {
  display: inline-flex;
  align-items: baseline;
  gap: .48rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .29rem;
  color: var(--accent);
  white-space: nowrap;
}
.maker-name {
  font: italic 600 clamp(1.48rem, 3vw, 2.05rem)/.95 Georgia, serif;
  letter-spacing: -.065em;
}
.maker-role {
  font-size: .68rem;
  letter-spacing: .12em;
}
.scene {
  --photo-x: 50%;
  --photo-y: 54%;
  position: relative;
  display: flex;
  height: clamp(360px, min(67svh, calc(100svh - 190px)), 695px);
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #879179;
  border-radius: 20px;
  border: 1px solid #35443122;
  box-shadow: 0 14px 30px #29362620, 0 2px 6px #29362618;
}
.scene-background, .scene::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}
.scene-background {
  width: 100%;
  height: 100%;
  z-index: -2;
  object-fit: cover;
  object-position: var(--photo-x) var(--photo-y);
  transition: filter .4s ease;
}
.scene::after {
  z-index: -1;
  background: linear-gradient(130deg, #6989ba45, #1516388a 90%);
  opacity: 0;
  transition: opacity .4s ease;
}
.night .scene-background { filter: brightness(.61) saturate(.46); }
.night .scene::after { opacity: 1; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.night canvas { filter: brightness(.72) saturate(.73); }
canvas[data-touching] { cursor: none; }
.controls, .keyboard, .switches { display: flex; align-items: center; flex-wrap: wrap; }
.controls { justify-content: space-between; gap: .55rem; margin-top: .85rem; }
.keyboard, .switches { gap: .4rem; }
button { font: inherit; cursor: pointer; color: inherit; }
.pill, .key, .scene-button {
  min-height: 44px;
  padding: .4rem .8rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .88rem;
  white-space: nowrap;
}
.pill { border-color: var(--line); background: var(--button); }
.key { background: transparent; }
.key kbd {
  display: inline-block;
  margin-inline-start: .3rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1rem .28rem;
  color: var(--muted);
  font: .69rem ui-monospace, monospace;
}
.pill:hover, .key:hover:not(:disabled) { border-color: var(--accent); }
.key:disabled { opacity: .42; cursor: default; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--active-ink); }
.scene-button {
  position: absolute;
  inset: 1rem 1rem auto auto;
  background: var(--photo-frame);
  color: #313b2b;
  box-shadow: 0 3px 9px #1b241f2a;
}
.scene-button:disabled { opacity: .7; cursor: default; }
.scene-button:hover:not(:disabled) { background: #fffdf6; }
.notice { margin: .65rem 0 0; color: var(--muted); font-size: .875rem; }
.notice:empty { display: none; }
.experience:is(:fullscreen, .expanded) {
  display: flex;
  flex-direction: column;
  background: var(--page);
  padding: .75rem;
}
.experience.expanded { position: fixed; inset: 0; z-index: 5; }
.experience:is(:fullscreen, .expanded) .scene { height: auto; flex: 1; }
.details {
  border-top: 1px solid var(--line);
  margin-top: clamp(2rem, 6vw, 4.5rem);
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 1.25rem;
  word-break: keep-all;
}
.details h2 {
  margin: 0;
  font-family: "AppleMyungjo", "Batang", "Noto Serif KR", serif;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -.035em;
}
.details-intro, .feature-list dd { color: var(--muted); line-height: 1.7; }
.details-intro { margin: .6rem 0 1.4rem; }
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 1.75rem;
  margin: 0;
}
.feature-list > div { border-top: 1px solid var(--line); padding-top: .8rem; }
.feature-list dt { font-weight: 650; }
.feature-list dd { margin: .35rem 0 0; font-size: .91rem; }
.feature-list kbd { color: var(--ink); font: 600 .8rem ui-monospace, monospace; white-space: nowrap; }
@media (max-width: 770px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .feature-list { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 560px) {
  .room { width: calc(100% - 1.5rem); margin-top: 1.65rem; }
  .intro { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .4rem .65rem; }
  .intro > div { display: contents; }
  .intro .maker { grid-column: 2; grid-row: 1; margin: 0; }
  h1 { font-size: clamp(1.65rem, 7.5vw, 2.2rem); word-break: keep-all; }
  #hint { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: .85rem; word-break: keep-all; }
  .scene { height: clamp(275px, 48svh, 470px); border-radius: 15px; }
  .scene { --photo-x: 41%; --photo-y: 51%; }
  .scene-button { inset: .65rem .65rem auto auto; }
  .controls { justify-content: center; }
  .controls button { padding-inline: .57rem; }
  .switches { min-width: 0; }
  .keyboard, .switches { justify-content: center; }
}
@media (hover: none), (max-width: 380px) { .key kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  body, .scene-background, .scene::after { transition: none; }
}
