:root {
  --bg: #f1ecec;
  --bg2: #e7dee0;
  --ink: #2a2130;
  --ink2: #6a5c6e;
  --line: #d8cacd;
  --accent: #7b3f5e;
  --accent2: #5e2e48;
  --accent-soft: #ebd8e1;
  --stage: #1b1520;
  --stage2: #2b2030;
  --epidermis: #f2c6aa;
  --dermis: #e68c98;
  --fat: #f4d06f;
  --fascia: #efe6f3;
  --muscle: #b2404f;
  --bone: #f1e8d8;
  --serif:
    "Fraunces", ui-serif, "New York", "Iowan Old Style", "Palatino Linotype",
    Georgia, serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header: 56px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
}
button {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 40px;
  line-height: 1.02;
}
h2 {
  font-size: 28px;
  line-height: 1.1;
}
h3 {
  font-size: 20px;
  line-height: 1.2;
}
p {
  margin: 0 0 1em;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Stage */
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  background: radial-gradient(
    120% 90% at 30% 20%,
    var(--stage2) 0%,
    var(--stage) 60%
  );
}
.stage.dragging {
  cursor: grabbing;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.stage-head {
  position: absolute;
  left: 16px;
  top: 14px;
  right: 16px;
  color: #f7eef1;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.stage-head .name {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.15;
  max-width: 70%;
}
.stage-head .name {
  font-size: 16px;
}
.tabs {
  display: flex;
  gap: 4px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid #4a3c4b;
  border-radius: 999px;
  padding: 3px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: #c9b6c4;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button.on {
  background: #f7eef1;
  color: #2a2130;
}
.tabs button[hidden] {
  display: none;
}
.tabs button:disabled {
  opacity: 0.4;
  cursor: default;
}
.facemap {
  position: absolute;
  inset: 0;
  display: none;
  padding: 46px 4px 86px;
}
@media (min-width: 1024px) {
  .facemap {
    padding: 64px 24px 110px;
  }
}
.stage.face-mode.nowebgl .facemap {
  display: block;
}
.stage.face-mode .legend {
  display: none;
}
.stage.face-mode .caption .play {
  display: none;
}
.stage.face-mode .play {
  display: none;
}
.facemap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.facemap .area {
  cursor: pointer;
  outline: none;
}
.facemap .area ellipse {
  fill: rgba(123, 63, 94, 0);
  stroke: rgba(251, 243, 245, 0);
  stroke-width: 1.5;
  transition:
    fill 0.3s,
    stroke 0.3s;
}
.facemap .area .ring {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.55;
  stroke-width: 1;
  transition: opacity 0.3s;
}
.facemap .area .pin {
  fill: #fff;
  fill-opacity: 0.9;
  stroke: #2a2130;
  stroke-width: 0.6;
}
.facemap .area:hover ellipse,
.facemap .area:focus-visible ellipse {
  fill: rgba(123, 63, 94, 0.22);
  stroke: rgba(251, 243, 245, 0.7);
}
.facemap .area.on ellipse {
  fill: rgba(123, 63, 94, 0.2);
  stroke: rgba(251, 243, 245, 0.7);
}
.stage.face-mode .play {
  display: none;
}
.facemap .area.on .ring {
  opacity: 0;
}
.facemap .area.dim {
  opacity: 0.22;
}
.facemap .area.treat .ring,
.facemap .area.treat .pin {
  opacity: 0;
}
.facemap .area.pulse .ring {
  animation: ringpulse 2.6s ease-in-out infinite;
}
@keyframes ringpulse {
  0%,
  100% {
    r: 8;
    stroke-opacity: 0.55;
  }
  50% {
    r: 12;
    stroke-opacity: 0.15;
  }
}
.facemap .dot {
  fill: #ffd6e2;
  stroke: #2a2130;
  stroke-width: 1;
  animation: dotin 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes dotin {
  from {
    opacity: 0;
    r: 0;
  }
  to {
    opacity: 1;
    r: 3.6;
  }
}
.facemap .facelabel {
  fill: #c9b6c4;
  font-size: 13px;
  font-family: var(--sans);
}
@media (prefers-reduced-motion: reduce) {
  .facemap .area.pulse .ring {
    animation: none;
  }
  .facemap .dot {
    animation: none;
  }
}
.face-access {
  position: absolute;
  z-index: 8;
  right: 16px;
  top: 54px;
  color: #fbf3f5;
  font-size: 12px;
}
.face-access summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid #5e4d5d;
  background: rgba(27, 21, 32, 0.88);
  border-radius: 999px;
  padding: 7px 11px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}
.face-access summary::-webkit-details-marker {
  display: none;
}
.face-access[open] summary {
  border-radius: 12px 12px 0 0;
  background: #2b2030;
}
.face-access .face-buttons {
  width: min(310px, calc(100vw - 32px));
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  background: #2b2030;
  border: 1px solid #5e4d5d;
  border-radius: 12px 0 12px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
}
.face-access button {
  border: 1px solid #5e4d5d;
  background: transparent;
  color: #eadde5;
  border-radius: 8px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}
.face-access button:hover,
.face-access button[aria-pressed="true"] {
  background: #f7eef1;
  color: #2a2130;
  border-color: #f7eef1;
}
.stage:not(.face-mode) .face-access {
  display: none;
}
.legend {
  position: absolute;
  left: 14px;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
.legend div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #b9a6b5;
  transition: color 0.3s;
}
.legend i {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  display: block;
  opacity: 0.55;
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.legend div.on {
  color: #fff6f0;
}
.legend div.on i {
  opacity: 1;
  transform: scaleX(1.3);
  transform-origin: left;
}
.caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 16px 14px;
  background: linear-gradient(
    180deg,
    rgba(27, 21, 32, 0) 0%,
    rgba(27, 21, 32, 0.85) 55%
  );
  color: #fbf3f5;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.caption .text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  min-height: 2.8em;
}
.caption .text b {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: #c9b6c4;
  margin-bottom: 2px;
}
.caption .dots {
  display: flex;
  gap: 6px;
  padding-bottom: 4px;
}
.caption .dots button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #8c7a88;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.caption .dots button i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8c7a88;
  display: block;
}
.caption .dots button.on {
  border-color: #fbf3f5;
}
.caption .dots button.on i {
  background: #fbf3f5;
}
.play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #8c7a88;
  background: rgba(255, 255, 255, 0.06);
  color: #fbf3f5;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.stage-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #c9b6c4;
  padding: 24px;
  text-align: center;
  font-size: 14px;
}
.stage.nowebgl:not(.face-mode) .stage-fallback {
  display: grid;
}
