:root {
  --paper: #e8ddc4;
  --paper-light: #f2ead7;
  --paper-shadow: #d2c09b;
  --ink: #29231c;
  --muted: #746b5b;
  --red: #8e2f20;
  --gold: #b88428;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

.artwork {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 253, 238, 0.82), transparent 54%),
    radial-gradient(circle at 48% 115%, rgba(119, 85, 40, 0.11), transparent 48%),
    linear-gradient(115deg, #dfcfad, #f0e8d5 46%, #ddcca8);
}

.artwork::before,
.artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.artwork::before {
  box-shadow: inset 0 0 12vw rgba(83, 59, 27, 0.14);
}

.artwork::after {
  opacity: 0.31;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(93deg, rgba(70, 52, 29, 0.025) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(3deg, rgba(70, 52, 29, 0.018) 0 1px, transparent 1px 7px);
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}

.art-title,
.gesture-hint {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  pointer-events: none;
  user-select: none;
}

.art-title {
  left: clamp(22px, 4vw, 64px);
  bottom: clamp(22px, 5vh, 56px);
  display: grid;
  gap: 7px;
}

.art-title span {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 400;
  letter-spacing: 0.25em;
}

.art-title small {
  font: 500 9px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: 0.34em;
}

.gesture-hint {
  top: clamp(22px, 4vh, 42px);
  right: clamp(22px, 4vw, 60px);
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 11px;
}

.gesture-hint__line {
  width: 42px;
  height: 1px;
  background: currentColor;
  transform-origin: right center;
}

.cursor-ring {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(61, 47, 31, 0.52);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 180ms ease;
  box-shadow: 0 0 0 5px rgba(255, 250, 230, 0.16);
}

.artwork.is-pointing .cursor-ring {
  opacity: 1;
}

noscript {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
}

.sound-toggle {
  position: absolute;
  right: clamp(22px, 4vw, 60px);
  bottom: clamp(22px, 5vh, 56px);
  z-index: 5;
  min-width: 96px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(61, 47, 31, 0.28);
  border-radius: 999px;
  background: rgba(242, 234, 215, 0.58);
  color: var(--muted);
  font: 500 10px/1 Georgia, "Songti SC", serif;
  letter-spacing: 0.16em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.sound-toggle[hidden] { display: none; }
.sound-toggle:hover,
.sound-toggle:focus-visible {
  color: var(--ink);
  border-color: rgba(61, 47, 31, 0.56);
  background: rgba(242, 234, 215, 0.8);
  outline: none;
}

.sound-toggle__mark {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__mark {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(142, 47, 32, 0.1);
}

@media (max-width: 680px) {
  .gesture-hint {
    top: 18px;
    right: 18px;
    gap: 8px;
    font-size: 10px;
  }

  .gesture-hint__line {
    width: 24px;
  }

  .art-title {
    left: 18px;
    bottom: 18px;
  }

  .art-title span {
    font-size: 17px;
  }

  .cursor-ring {
    width: 42px;
    height: 42px;
  }

  .sound-toggle {
    right: 18px;
    bottom: 18px;
    min-width: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-ring,
  .sound-toggle {
    transition: none;
  }
}
