:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Malgun Gothic", sans-serif;
  color: #eeeae0;
  background: #191a16;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, a { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #ecad69; outline-offset: 5px; }

.character {
  display: grid;
  grid-template-columns: minmax(16rem, .55fr) minmax(0, 1.45fr);
  min-height: 100svh;
  max-width: 112rem;
  margin-inline: auto;
}

.profile {
  align-self: center;
  padding: clamp(1.8rem, 5vw, 7rem);
}

.occupation {
  margin: 0 0 1.25rem;
  color: #d7a773;
  font-size: .84rem;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  font-family: "Noto Serif CJK KR", "Batang", "AppleMyungjo", Georgia, serif;
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 600;
  letter-spacing: -.09em;
  line-height: 1.03;
  white-space: nowrap;
}

.roman-name {
  margin: .85rem 0 0;
  font: italic 400 clamp(1.25rem, 2.65vw, 2.45rem)/1.1 Georgia, serif;
  color: #c8c0b0;
}

.story {
  max-width: 23rem;
  margin: clamp(1.7rem, 4vw, 3.4rem) 0 1.9rem;
  color: #d3cbbc;
  font-size: .98rem;
  line-height: 1.85;
  word-break: keep-all;
}

.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.action {
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  padding: .6rem .9rem;
  border: 1px solid #706856;
  background: #242820;
  color: #eeeae0;
  font-size: .82rem;
  text-decoration: none;
}
.action:hover:not(:disabled) { border-color: #e0b181; background: #394031; }
.action:disabled { opacity: .5; }
.action-primary, .action[aria-pressed="true"] { border-color: #d6ab7d; background: #d6ab7d; color: #211b15; }
.action-primary:hover:not(:disabled), .action[aria-pressed="true"]:hover:not(:disabled) { background: #ecc79e; }

.showcase {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
  min-width: 0;
  min-height: 39rem;
  background: radial-gradient(ellipse at 50% 44%, #515346 0, #35392f 49%, #262923 82%);
}

#viewport { overflow: hidden; min-height: 0; }
#viewport canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#viewport canvas:active { cursor: grabbing; }
#status, .noscript {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 28rem;
  width: calc(100% - 3rem);
  text-align: center;
  color: #f0e7d8;
  line-height: 1.6;
  pointer-events: none;
}
.viewer-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding: 1rem clamp(1rem, 3vw, 2.8rem);
  background: #242720;
  border-top: 1px solid #414539;
}
#interaction-hint { margin: 0; color: #d1cbbb; font-size: .81rem; }

.lightbox {
  max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem);
  padding: 0;
  border: 0;
  background: #171814;
}
.lightbox::backdrop { background: #090a08ed; }
.lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 1rem); }
.lightbox form { position: absolute; top: .75rem; right: .75rem; }

@media (max-width: 760px) {
  .character { grid-template-columns: 1fr; }
  .showcase { grid-row: 1; min-height: 0; }
  #viewport { height: clamp(24rem, 68svh, 42rem); }
  .viewer-footer { gap: .75rem; }
  .profile { padding: 2rem 1.4rem 2.5rem; }
  h1 { font-size: clamp(4rem, 17vw, 6rem); }
}
