/* Independent, static chapter; the existing scroll and book owners are untouched. */
.safety-scene {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: max(480px, min(88vh, 960px));
  padding: clamp(80px, 10vh, 140px) clamp(16px, 4vw, 24px);
  overflow: hidden;
  background: #f7efe9;
}

.safety-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

.safety-title {
  margin: 0;
  color: #2b1a07;
  font-family: "Dioni Doodle Serif", "Rubik Dioni", serif;
  font-size: clamp(28px, 3.65vw, 40px);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.safety-subtitle {
  max-width: 100%;
  margin: 12px 0 0;
  padding-inline: 16px;
  color: #8a7b6a;
  font-family: "Dioni Doodle Serif", "Rubik Dioni", serif;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
}

.safety-mobile-break { display: none; }

.safety-stage {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1200 / 720;
  direction: ltr;
}

.safety-note {
  position: absolute;
  top: 50%;
  left: 50%;
  container-type: inline-size;
  width: clamp(360px, 32vw, 440px);
  max-width: 100%;
  aspect-ratio: 2050 / 2740;
  transform: translate(-50%, -50%);
}

.safety-note__paper {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  /* The original alpha retains the source silhouette and removes the outer backdrop. */
  mask-image: url("assets/safety/ruled-paper-source.lossless.webp");
  mask-mode: alpha;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.safety-list {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #2b1a07;
  font-family: "Dioni Doodles", "Rubik Dioni", sans-serif;
  font-size: 6cqi;
  font-weight: 400;
  line-height: 1.3;
  direction: rtl;
}

.safety-list li {
  position: absolute;
  top: var(--line-top);
  right: 10%;
  left: 38%;
  margin: 0;
  text-align: left;
  white-space: nowrap;
  transform: translateY(-50%) rotate(-2.5deg);
  transform-origin: left center;
}

.safety-list li:last-child {
  font-size: 5.4cqi;
}

.safety-sticker {
  position: absolute;
  container-type: inline-size;
  width: clamp(90px, 8vw, 110px);
  margin: 0;
}

.safety-sticker__art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  clip-path: var(--art-clip);
}

.safety-sticker figcaption {
  position: absolute;
  top: var(--caption-top);
  left: 12%;
  width: 80%;
  margin: 0;
  color: #110c08;
  font-family: "Dioni Doodles", "Rubik Dioni", sans-serif;
  font-size: 18cqi;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  direction: rtl;
}

.safety-sticker figcaption span {
  display: block;
  white-space: nowrap;
}

.safety-sticker--bookmark {
  --art-clip: inset(0 0 48% 0);
  --caption-top: 55%;
  top: 5%;
  left: 3%;
  aspect-ratio: 324 / 459;
}

.safety-sticker--bulb {
  --art-clip: inset(0 0 47% 0);
  --caption-top: 59%;
  top: 5%;
  right: 2%;
  aspect-ratio: 390 / 501;
}

.safety-sticker--shield {
  --caption-top: 69.8%;
  bottom: 5%;
  left: 8%;
  aspect-ratio: 381 / 420;
}

.safety-sticker__shield {
  position: absolute;
  top: 8.4%;
  left: 14%;
  display: block;
  width: 62%;
  height: auto;
  /* Fade only the empty outer margin; the full sticker remains inside the solid center. */
  mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
}

.safety-sticker--shield figcaption {
  left: 45%;
  width: max-content;
  text-align: center;
  transform: translateX(-50%);
}

.safety-sticker--heart {
  --art-clip: inset(0 0 53% 0);
  --caption-top: 52%;
  bottom: 5%;
  right: 3.5%;
  aspect-ratio: 336 / 465;
}

.safety-sticker--heart figcaption {
  left: 40%;
  width: max-content;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-width: 1023px) {
  .safety-scene {
    min-height: 90svh;
    padding-block: clamp(64px, 8vw, 96px);
  }

  .safety-stage { margin-top: clamp(48px, 6vw, 72px); }
}

@media (max-width: 767px) {
  .safety-mobile-break { display: block; }

  .safety-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    aspect-ratio: auto;
    margin-top: clamp(40px, 8vw, 48px);
  }

  .safety-note {
    position: relative;
    top: auto;
    left: auto;
    width: clamp(300px, 65vw, 380px);
    transform: none;
  }

  /* The reference also omits its corner stickers on phones. */
  .safety-sticker { display: none; }
}
