:root {
  --ink: #241f24;
  --muted: #6f6470;
  --paper: #fffaf5;
  --page: #fffdf9;
  --rose: #a93455;
  --gold: #b9872c;
  --leaf: #536857;
  --line: rgba(36, 31, 36, 0.14);
  --shadow: 0 18px 50px rgba(44, 32, 36, 0.18);
  --reader-width: min(100%, 980px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(83, 104, 87, 0.08), transparent 22%, transparent 78%, rgba(185, 135, 44, 0.07)),
    repeating-linear-gradient(0deg, rgba(36, 31, 36, 0.025), rgba(36, 31, 36, 0.025) 1px, transparent 1px, transparent 5px),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  min-height: 100vh;
}

body.theme-dark {
  --ink: #f4ede7;
  --muted: #c9b8b1;
  --paper: #181313;
  --page: #241c1a;
  --line: rgba(244, 237, 231, 0.16);
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
  background:
    linear-gradient(90deg, rgba(121, 78, 60, 0.18), transparent 20%, transparent 80%, rgba(185, 135, 44, 0.14)),
    repeating-linear-gradient(0deg, rgba(255, 250, 245, 0.04), rgba(255, 250, 245, 0.04) 1px, transparent 1px, transparent 5px),
    var(--paper);
}

body.app-embed {
  background: #fffdfa;
}

body.app-embed .cover,
body.app-embed .topbar,
body.app-embed .progress {
  display: none !important;
}

body.app-embed .reader {
  padding: 14px 10px 86px;
}

body.app-embed .contents {
  min-height: auto;
  padding-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cover {
  position: relative;
  display: grid;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(13, 18, 32, 0.04), rgba(13, 18, 32, 0.12) 56%, rgba(13, 18, 32, 0.36)),
    url("./assets/cover-home.webp") center / cover no-repeat,
    #172036;
  transform-origin: left center;
}

.cover::before,
.cover::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.cover::before {
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 250, 245, 0.18), transparent 7%, transparent 92%, rgba(22, 18, 26, 0.18)),
    radial-gradient(ellipse at center, transparent 44%, rgba(7, 10, 19, 0.28) 100%),
    repeating-linear-gradient(0deg, rgba(255, 250, 245, 0.07), rgba(255, 250, 245, 0.07) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(36, 31, 36, 0.08), rgba(36, 31, 36, 0.08) 1px, transparent 1px, transparent 12px);
  mix-blend-mode: soft-light;
  opacity: 0.62;
}

.cover::after {
  z-index: 0;
  inset: clamp(10px, 2.6vw, 22px);
  border: 1px solid rgba(255, 250, 245, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(36, 31, 36, 0.16),
    inset 0 -92px 120px rgba(7, 10, 19, 0.24),
    0 0 0 1px rgba(24, 20, 24, 0.24);
}

.cover.is-dismissed {
  display: none;
  height: 0;
  opacity: 0;
}

.cover__content {
  position: absolute;
  z-index: 1;
  inset: 0;
  text-align: center;
  pointer-events: none;
}

.lanyard-entry {
  position: absolute;
  top: 56%;
  left: 50%;
  width: 116px;
  height: 212px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.lanyard-entry.is-dragging {
  cursor: grabbing;
}

.lanyard-entry.is-rebounding {
  pointer-events: none;
}

.lanyard-entry.is-entering .start-button {
  animation: lanyard-enter 640ms cubic-bezier(0.2, 0.88, 0.24, 1) both;
}

.lanyard-entry__pin {
  position: absolute;
  top: -190px;
  left: 50%;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 250, 245, 0.74);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.86), rgba(255, 250, 245, 0.22) 46%, rgba(27, 31, 47, 0.34) 100%);
  box-shadow:
    0 0 18px rgba(255, 250, 245, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.56);
  transform: translateX(-50%);
}

.lanyard-entry__cord {
  position: absolute;
  top: -183px;
  left: 50%;
  width: 180px;
  height: 330px;
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}

.lanyard-entry__cord-path {
  fill: none;
  stroke: rgba(255, 250, 245, 0.68);
  stroke-linecap: round;
  stroke-width: 2.3;
  filter: drop-shadow(1px 2px 4px rgba(7, 10, 19, 0.2));
}

.lanyard-entry__cord-loop {
  fill: rgba(7, 10, 19, 0.12);
  stroke: rgba(255, 250, 245, 0.46);
  stroke-width: 1.5;
}

.lanyard-entry__socket {
  position: absolute;
  top: 10.2%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.start-button.lanyard-entry__card {
  transform:
    translate(var(--lanyard-x, 0px), var(--lanyard-y, 0px))
    rotate(var(--lanyard-rotate, -1deg));
  transform-origin: 50% -172px;
  animation: lanyard-sway 4200ms ease-in-out infinite;
  will-change: transform;
}

.lanyard-entry.is-dragging .start-button,
.lanyard-entry.is-rebounding .start-button,
.lanyard-entry.is-entering .start-button {
  animation: none;
}

.lanyard-entry.is-dragging .start-button {
  filter: drop-shadow(0 18px 20px rgba(7, 10, 19, 0.2));
  transition: none;
}

.start-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  width: 116px;
  min-width: 0;
  height: 212px;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: transparent;
  background: url("./assets/ui/lanyard-card.webp") center / contain no-repeat;
  box-shadow: none;
  text-shadow: none;
  transition: opacity 180ms ease, transform 180ms ease;
  touch-action: none;
}

.start-button::before,
.start-button::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.start-button::before {
  display: none;
}

.start-button::after {
  display: none;
}

.lanyard-entry__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.start-button:hover {
  opacity: 0.92;
  transform: translateY(2px);
}

.start-button:disabled {
  cursor: default;
  pointer-events: none;
}

.start-button:focus-visible {
  outline: 2px solid rgba(255, 250, 245, 0.62);
  outline-offset: 8px;
}

.start-button__arrow {
  display: none;
}

.start-button__arrow::before,
.start-button__arrow::after {
  position: absolute;
  content: "";
}

.start-button__arrow::before {
  top: 7px;
  left: 0;
  width: 64px;
  border-top: 1px solid rgba(255, 250, 245, 0.72);
}

.start-button__arrow::after {
  top: 3px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(255, 250, 245, 0.72);
  border-right: 1px solid rgba(255, 250, 245, 0.72);
  transform: rotate(45deg);
}

@keyframes arrow-drift {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(5px);
  }
}

@keyframes lanyard-sway {
  0% {
    transform: translate(var(--lanyard-x, 0px), var(--lanyard-y, 0px)) rotate(-1.8deg);
  }

  50% {
    transform: translate(var(--lanyard-x, 0px), var(--lanyard-y, 0px)) rotate(1.8deg);
  }

  100% {
    transform: translate(var(--lanyard-x, 0px), var(--lanyard-y, 0px)) rotate(-1.8deg);
  }
}

@keyframes lanyard-enter {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(var(--lanyard-rotate, -1deg)) scale(1);
  }

  44% {
    opacity: 0.92;
    transform: translate(0, 10px) rotate(5deg) scale(0.98);
  }

  100% {
    opacity: 0;
    transform: translate(0, -32px) rotate(-8deg) scale(0.9);
  }
}

.progress {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.progress__bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(169, 52, 85, 0.58), rgba(185, 135, 44, 0.64), rgba(83, 104, 87, 0.58));
  transform-origin: left center;
}

body.is-past-cover.is-reading-scroll .progress {
  opacity: 1;
  transform: translateY(0);
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(calc(100% - 28px), 760px);
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.78);
  box-shadow: 0 12px 36px rgba(36, 31, 36, 0.13);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 220ms ease;
}

body.theme-dark .topbar {
  border-color: rgba(255, 250, 245, 0.2);
  background: rgba(33, 25, 24, 0.82);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

body.is-past-cover .topbar {
  opacity: 1;
  pointer-events: auto;
}

.topbar__mark {
  color: #5b2934;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
}

body.theme-dark .topbar__mark {
  color: #f7e9dc;
}

.topbar__actions {
  display: flex;
  gap: 8px;
}

.icon-button.is-active {
  color: #fffaf5;
  background: #5b2934;
}

.icon-button,
.lightbox__close {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(36, 31, 36, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

body.theme-dark .icon-button,
body.theme-dark .lightbox__close {
  border-color: rgba(255, 250, 245, 0.18);
  color: #f7e9dc;
  background: rgba(255, 250, 245, 0.1);
}

body.theme-dark .icon-button:hover,
body.theme-dark .lightbox__close:hover {
  border-color: rgba(240, 161, 173, 0.4);
  background: rgba(255, 250, 245, 0.18);
}

.theme-toggle__moon {
  display: none;
}

body.theme-dark .theme-toggle__sun {
  display: none;
}

body.theme-dark .theme-toggle__moon {
  display: block;
}

.icon-button.is-active::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 250, 245, 0.86);
  border-radius: 50%;
  background: #b9872c;
  box-shadow: 0 0 10px rgba(185, 135, 44, 0.42);
  content: "";
}

.icon-button:hover,
.lightbox__close:hover {
  border-color: rgba(169, 52, 85, 0.36);
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.icon-button:focus-visible,
.lightbox__close:focus-visible {
  outline: 3px solid rgba(185, 135, 44, 0.36);
  outline-offset: 3px;
}

.icon-button svg,
.lightbox__close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reader {
  width: var(--reader-width);
  margin: 0 auto;
  padding: 96px clamp(12px, 3vw, 28px) 72px;
}

.contents,
.chapter,
.profile-page,
.comic-page,
.closing {
  scroll-margin-top: 84px;
}

.contents {
  position: relative;
  padding: clamp(16px, 3vw, 28px) 0 clamp(22px, 4vw, 38px);
}

.contents-page {
  position: relative;
  width: min(100%, 860px);
  margin: 0 auto;
}

.contents-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(36, 31, 36, 0.12);
  border-radius: 8px;
  background: var(--page);
  box-shadow: var(--shadow);
}

.contents-hotspots {
  position: absolute;
  inset: 0;
}

.contents-hotspot {
  position: absolute;
  left: 8%;
  width: 78%;
  height: 4.3%;
  overflow: hidden;
  border-radius: 8px;
  color: transparent;
  text-decoration: none;
}

.contents-hotspot:focus-visible {
  outline: 2px solid rgba(169, 52, 85, 0.44);
  outline-offset: 2px;
  background: rgba(255, 250, 245, 0.12);
}

.contents-hotspot--1 {
  top: 41.7%;
}

.contents-hotspot--2 {
  top: 47.1%;
}

.contents-hotspot--3 {
  top: 52.1%;
}

.contents-hotspot--4 {
  top: 57.1%;
}

.contents-hotspot--5 {
  top: 62.5%;
}

.contents-hotspot--6 {
  top: 67.5%;
}

.contents-hotspot--7 {
  top: 72.8%;
}

.contents-hotspot--8 {
  top: 78%;
}

.closing {
  display: grid;
  place-items: center;
  padding: clamp(42px, 8vw, 76px) 0;
}

.closing {
  position: relative;
  min-height: 52vh;
  align-content: center;
  overflow: hidden;
}

.closing::before {
  position: absolute;
  inset: auto 50% 18% auto;
  width: min(68vw, 520px);
  height: min(68vw, 520px);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 240, 214, 0.72), rgba(217, 106, 131, 0.2) 36%, transparent 68%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 20%) scale(0.6);
}

.closing.is-accepted::before {
  animation: closing-glow 1800ms ease-out forwards;
}

.closing__card {
  position: relative;
  width: min(100%, 577px);
  overflow: hidden;
  border-radius: clamp(20px, 4vw, 28px);
  background: transparent;
  box-shadow: 0 22px 56px rgba(44, 32, 36, 0.16);
  text-align: center;
}

.closing__art {
  display: block;
  width: 100%;
  height: auto;
}

.closing__overlay {
  position: absolute;
  inset: 40.5% 27% 22.5%;
  padding: 0;
}

.closing__eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(185, 135, 44, 0.88);
  font-size: 13px;
  font-weight: 650;
}

.closing__eyebrow::before,
.closing__eyebrow::after {
  width: 34px;
  height: 1px;
  background: rgba(185, 135, 44, 0.34);
  content: "";
}

.closing p {
  position: relative;
  z-index: 1;
  max-width: 18em;
  margin: 0;
  color: #5b2934;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 650;
  line-height: 1.65;
  text-align: center;
}

.choice {
  --choice-offset: clamp(48px, 8vw, 66px);
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  isolation: isolate;
}

.heart-burst {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.heart-glow {
  position: absolute;
  left: var(--origin-x, 50%);
  top: var(--origin-y, 50%);
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 250, 245, 0.95), rgba(240, 161, 173, 0.36) 36%, transparent 68%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  animation: glow-pop 1200ms ease-out forwards;
}

.heart-ring {
  position: absolute;
  left: var(--origin-x, 50%);
  top: var(--origin-y, 50%);
  width: 24px;
  height: 24px;
  border: 1px solid rgba(169, 52, 85, 0.48);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(217, 106, 131, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  animation: ring-pop 980ms ease-out forwards;
}

.heart-ring--slow {
  border-color: rgba(185, 135, 44, 0.42);
  animation-delay: 120ms;
  animation-duration: 1250ms;
}

.heart-particle {
  position: absolute;
  left: var(--origin-x, 50%);
  top: var(--origin-y, 50%);
  width: var(--size, 14px);
  height: var(--size, 14px);
  background: var(--heart-color, #a93455);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.2);
  animation: heart-pop var(--duration, 1400ms) cubic-bezier(0.16, 0.9, 0.18, 1) forwards;
  animation-delay: var(--delay, 0ms);
  filter: drop-shadow(0 10px 16px rgba(91, 41, 52, 0.2));
}

.heart-particle::before,
.heart-particle::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.heart-particle::before {
  left: -50%;
}

.heart-particle::after {
  top: -50%;
}

.spark-particle {
  position: absolute;
  left: var(--origin-x, 50%);
  top: var(--origin-y, 50%);
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 999px;
  background: var(--spark-color, rgba(185, 135, 44, 0.82));
  box-shadow: 0 0 14px var(--spark-color, rgba(185, 135, 44, 0.82));
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  animation: spark-pop var(--duration, 1100ms) cubic-bezier(0.16, 0.9, 0.18, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.choice__button {
  position: absolute;
  top: 50%;
  min-width: clamp(84px, 18vw, 112px);
  min-height: clamp(44px, 8vw, 50px);
  padding: 0 clamp(14px, 2vw, 22px);
  border: 1px solid rgba(91, 41, 52, 0.18);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: clamp(14px, 2.8vw, 16px);
  font-weight: 650;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.choice__button--yes {
  left: calc(50% + var(--choice-offset));
  z-index: 2;
  color: #fffaf5;
  border-color: rgba(91, 41, 52, 0.72);
  background:
    linear-gradient(180deg, rgba(121, 54, 70, 0.98), #5b2934);
  box-shadow: 0 16px 34px rgba(91, 41, 52, 0.24);
}

.choice__button--yes:hover {
  transform: translate(-50%, calc(-50% - 2px));
}

.choice.is-accepted .choice__button--yes {
  left: 50%;
  top: 34%;
  animation: yes-confirm 620ms cubic-bezier(0.2, 1.25, 0.34, 1) both;
}

.choice.is-accepted {
  height: 100%;
  min-height: 0;
  margin-top: 0;
}

.choice__button--no {
  left: calc(50% - var(--choice-offset));
  color: #5b2934;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 26px rgba(44, 32, 36, 0.08);
}

.choice__button--no.is-running {
  position: absolute;
  z-index: 1;
  left: var(--run-left, 50%);
  top: var(--run-top, 50%);
  transform: translate(-50%, -50%);
}

.choice__button:focus-visible {
  outline: 3px solid rgba(185, 135, 44, 0.36);
  outline-offset: 4px;
}

.closing .choice__reply {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 100%;
  max-width: none;
  margin: 0;
  color: #5b2934;
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px));
}

.closing .choice__reply.is-visible {
  animation: reply-rise 760ms ease-out 180ms forwards;
}

.closing .choice.is-accepted + .choice__reply {
  margin-top: 0;
}

.promise-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  min-height: 92px;
  margin-top: 0;
  padding: clamp(14px, 2.8vw, 18px) clamp(14px, 2.8vw, 18px) clamp(16px, 3.2vw, 20px);
  border: 1px solid rgba(91, 41, 52, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 245, 0.9)),
    repeating-linear-gradient(0deg, rgba(36, 31, 36, 0.03), rgba(36, 31, 36, 0.03) 1px, transparent 1px, transparent 6px);
  box-shadow: 0 18px 46px rgba(91, 41, 52, 0.14);
  opacity: 0;
  text-align: center;
  transform: translateY(12px) scale(0.98);
}

.promise-card[hidden] {
  display: none;
}

.promise-card::before {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(185, 135, 44, 0.16);
  border-radius: 6px;
  content: "";
  pointer-events: none;
}

.promise-card span {
  display: block;
  margin-bottom: 8px;
  color: rgba(185, 135, 44, 0.86);
  font-size: 12px;
  font-weight: 650;
}

.promise-card p {
  position: relative;
  z-index: 1;
  max-width: none;
  font-size: clamp(13px, 2.4vw, 16px);
  line-height: 1.7;
}

.promise-card p + p {
  margin-top: 4px;
  color: rgba(91, 41, 52, 0.76);
  font-size: clamp(12px, 2.2vw, 14px);
}

.promise-card.is-visible {
  animation: promise-rise 820ms cubic-bezier(0.16, 0.9, 0.18, 1) 260ms forwards;
}

@keyframes heart-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.2);
  }

  16% {
    opacity: 1;
  }

  72% {
    opacity: 0.94;
    transform: translate(calc(-50% + var(--mid-x)), calc(-50% + var(--mid-y))) rotate(calc(45deg + var(--spin))) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(calc(45deg + var(--spin))) scale(0.18);
  }
}

@keyframes spark-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.05);
  }
}

@keyframes ring-pop {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.35);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(6.5);
  }
}

@keyframes glow-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45);
  }
}

@keyframes closing-glow {
  0% {
    opacity: 0;
    transform: translate(50%, 20%) scale(0.6);
  }

  32% {
    opacity: 1;
  }

  100% {
    opacity: 0.22;
    transform: translate(50%, 20%) scale(1);
  }
}

@keyframes yes-confirm {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  46% {
    box-shadow: 0 22px 48px rgba(169, 52, 85, 0.34);
    transform: translate(-50%, calc(-50% - 2px)) scale(1.08);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes reply-rise {
  100% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes promise-rise {
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pages {
  display: grid;
  gap: clamp(18px, 3vw, 34px);
}

.profiles {
  display: grid;
  gap: clamp(18px, 3vw, 34px);
  margin: 0 0 clamp(18px, 3vw, 34px);
}

.profile-page {
  position: relative;
  margin: 0 auto;
  width: min(100%, 860px);
  padding: 8px;
  isolation: isolate;
}

.profile-page::before,
.profile-page::after {
  position: absolute;
  border: 1px solid rgba(36, 31, 36, 0.08);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.72);
  content: "";
  pointer-events: none;
}

.profile-page::before {
  z-index: -2;
  inset: 18px 2px 2px 18px;
  transform: rotate(0.8deg);
}

.profile-page::after {
  z-index: -1;
  inset: 10px 10px 10px 2px;
  transform: rotate(-0.5deg);
}

.profile-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(36, 31, 36, 0.12);
  border-radius: 6px;
  background: var(--page);
  box-shadow: 0 20px 48px rgba(44, 32, 36, 0.16);
  cursor: zoom-in;
}

.chapter {
  position: relative;
  display: grid;
  min-height: clamp(104px, 16vh, 158px);
  place-items: center;
  overflow: hidden;
  margin: clamp(8px, 2vw, 18px) auto;
  padding: 24px 18px;
  text-align: center;
}

.chapter::before,
.chapter::after {
  position: absolute;
  left: 50%;
  content: "";
}

.chapter::before {
  top: 50%;
  width: min(72%, 520px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 135, 44, 0.3), transparent);
  transform: translate(-50%, -50%);
}

.chapter::after {
  inset: 14px max(8px, calc((100% - 640px) / 2));
  border-top: 1px solid rgba(185, 135, 44, 0.13);
  border-bottom: 1px solid rgba(185, 135, 44, 0.13);
}

.chapter__inner {
  position: relative;
  z-index: 1;
  display: inline-grid;
  min-width: min(100%, 260px);
  place-items: center;
  padding: 0 18px;
  background: var(--paper);
}

.chapter h2 {
  margin: 0;
  color: #5b2934;
  font-size: clamp(20px, 3.8vw, 32px);
  font-weight: 600;
  line-height: 1.35;
}

.chapter h2::before,
.chapter h2::after {
  color: rgba(185, 135, 44, 0.78);
  content: "·";
  font-weight: 700;
  padding: 0 0.65em;
}

.comic-page {
  position: relative;
  margin: 0 auto;
  width: min(100%, 860px);
  opacity: 1;
  transform: none;
}

.comic-page.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.comic-page__number {
  display: block;
  margin-top: 12px;
  color: rgba(91, 41, 52, 0.58);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
}

.comic-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(36, 31, 36, 0.12);
  border-radius: 8px;
  background: var(--page);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 18px 22px;
  background: rgba(24, 20, 24, 0.88);
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  display: block;
  width: auto;
  max-width: min(100%, 1120px);
  max-height: calc(100vh - 104px);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  color: #fffaf5;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
  .cover {
    padding: 0;
  }

  .topbar {
    top: 12px;
    min-height: 48px;
    padding-left: 14px;
  }

  .topbar__mark {
    font-size: 14px;
  }

  .topbar__actions {
    gap: 6px;
  }

  .icon-button,
  .lightbox__close {
    width: 42px;
    height: 42px;
  }

  .reader {
    padding: 82px 10px 56px;
  }

  .chapter {
    min-height: 104px;
    margin: 6px auto;
  }

  .chapter__inner {
    min-width: min(100%, 220px);
  }

  .choice {
    --choice-offset: 44px;
  }

  .choice__button {
    min-width: 72px;
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .closing {
    min-height: 46vh;
    padding: 34px 0 48px;
  }

  .closing__card {
    border-radius: 18px;
  }

  .closing__overlay {
    inset: 40.5% 27% 22.5%;
    padding: 0;
  }

  .closing .choice__reply {
    font-size: 14px;
  }

  .promise-card {
    min-height: 82px;
    padding: 12px 12px 14px;
  }

  .pages {
    gap: 16px;
  }

  .comic-page__number {
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .progress,
  .cover,
  .contents,
  .closing,
  .comic-page__number,
  .lightbox {
    display: none !important;
  }

  .reader {
    width: 100%;
    padding: 0;
  }

  .pages {
    display: block;
  }

  .comic-page {
    width: 100%;
    break-after: page;
    opacity: 1;
    transform: none;
  }

  .comic-page img {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .comic-page,
  .promise-card,
  .icon-button,
  .lightbox__close {
    transition: none;
    animation: none;
  }

  .promise-card.is-visible {
    opacity: 1;
    transform: none;
  }

  .lanyard-entry,
  .start-button__arrow {
    animation: none;
  }
}
