:root {
  --pet-tent-main: #bd775f;
  --pet-tent-light: #d89a78;
  --pet-tent-shadow: #835044;
  --pet-tent-door: #553834;
  --pet-tent-pole: #6e4a3f;
}

.pet-story {
  --pet-shadow: rgba(72, 39, 30, 0.22);
  --pet-glass: rgba(255, 250, 247, 0.86);
  position: absolute;
  z-index: 14;
  width: clamp(350px, 27vw, 470px);
  height: clamp(250px, 35vh, 350px);
  contain: layout paint style;
  isolation: isolate;
  pointer-events: none;
}

.pet-story-hello { right: clamp(22px, 3.2vw, 66px); bottom: 2vh; }
.pet-story-approval {
  top: clamp(150px, 18vh, 190px);
  right: auto;
  bottom: auto;
  left: clamp(8px, 1.2vw, 24px);
  width: clamp(330px, 25vw, 430px);
}
.pet-story-agent { right: clamp(18px, 2.6vw, 52px); bottom: 1vh; width: clamp(330px, 24vw, 420px); }
.pet-story-camp { right: clamp(20px, 3.4vw, 70px); bottom: 1vh; width: clamp(410px, 31vw, 560px); }

.pet-stage {
  position: absolute;
  inset: 0;
  overflow: visible;
  transform: translateZ(0);
}

.pet-character {
  position: absolute;
  z-index: 4;
  bottom: 20px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px var(--pet-shadow));
  transform-origin: 50% 92%;
  will-change: transform, opacity;
}

.pet-story .pet-otter { left: 1%; height: 80%; }
.pet-story .pet-redpanda { right: 1%; height: 76%; }
.pet-story-approval .pet-otter,
.pet-story-agent .pet-otter { height: 78%; }
.pet-story-approval .pet-redpanda,
.pet-story-agent .pet-redpanda { height: 73%; }

.pet-scene-pair,
.pet-lounge-pair {
  position: absolute;
  z-index: 5;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px var(--pet-shadow));
  transform-origin: 50% 92%;
  will-change: transform, opacity;
}

.pet-scene-pair {
  bottom: 9px;
  left: 50%;
  width: 102%;
  transform: translateX(-50%);
}
.pet-scene-office { bottom: 2px; width: 104%; }
.pet-scene-floor { bottom: 10px; width: 100%; }

.pet-lounge-pair {
  z-index: 6;
  bottom: 14px;
  left: 50%;
  width: 104%;
  transform: translateX(-50%);
}

.pet-phone-ping {
  position: absolute;
  z-index: 8;
  top: 48%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 14px rgba(223, 114, 85, 0.72);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.pet-phone-ping::before,
.pet-phone-ping::after {
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(223, 114, 85, 0.5);
  border-radius: 50%;
  content: "";
}
.pet-phone-ping::after { inset: -12px; opacity: 0.46; }
.pet-phone-ping-left { left: 34%; }
.pet-phone-ping-right { left: 65%; }
.pet-phone-ping i {
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--amber);
}

.pet-ground {
  position: absolute;
  z-index: 1;
  right: 8%;
  bottom: 15px;
  left: 8%;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(87, 48, 36, 0.2), transparent 70%);
  filter: blur(7px);
  transform-origin: center;
  will-change: transform, opacity;
}

.pet-story-label {
  position: absolute;
  z-index: 12;
  top: 4px;
  right: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--pet-glass);
  box-shadow: 0 8px 22px rgba(91, 43, 33, 0.08);
  color: var(--muted);
  font-size: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pet-story-label b {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.pet-phone,
.pet-rest-phone {
  position: absolute;
  z-index: 8;
  width: 47px;
  height: 72px;
  border-radius: 11px 11px 13px 13px;
  background: linear-gradient(145deg, var(--ink), #503430);
  box-shadow: 0 12px 24px rgba(52, 26, 22, 0.22);
  transform-origin: 50% 90%;
  will-change: transform, opacity;
}

.pet-phone { bottom: 45px; left: calc(50% - 24px); }
.pet-phone::before {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 9px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.36);
  content: "";
  transform: translateX(-50%);
}

.pet-phone i,
.pet-phone span,
.pet-phone b {
  position: absolute;
  left: 9px;
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--coral);
}
.pet-phone i { top: 25px; width: 27px; }
.pet-phone span { top: 35px; width: 20px; background: var(--peach); }
.pet-phone b { top: 45px; width: 25px; background: rgba(255, 250, 247, 0.36); }

.pet-notice {
  position: absolute;
  z-index: 9;
  bottom: 104px;
  left: calc(50% + 18px);
  width: 78px;
  height: 34px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(255, 245, 239, 0.92);
  box-shadow: 0 10px 25px rgba(93, 43, 31, 0.13);
  will-change: transform, opacity;
}

.pet-notice span,
.pet-notice i {
  position: absolute;
  left: 12px;
  height: 4px;
  border-radius: 999px;
  background: var(--coral);
}
.pet-notice span { top: 10px; width: 38px; }
.pet-notice i { top: 20px; width: 25px; background: var(--rose); }

.pet-spark {
  position: absolute;
  z-index: 10;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 16px rgba(241, 164, 93, 0.72);
  will-change: transform, opacity;
}
.pet-spark-a { top: 27%; left: 43%; }
.pet-spark-b { top: 18%; left: 53%; width: 4px; height: 4px; }
.pet-spark-c { top: 33%; left: 57%; width: 5px; height: 5px; background: var(--coral); }

.pet-approval-card {
  position: absolute;
  z-index: 9;
  bottom: 54px;
  left: calc(50% - 56px);
  width: 112px;
  height: 90px;
  padding: 13px;
  border-radius: 17px 12px 18px 11px;
  background: rgba(255, 246, 241, 0.94);
  box-shadow: 0 16px 35px rgba(91, 43, 33, 0.16);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.pet-approval-card > span {
  position: absolute;
  top: 13px;
  left: 14px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 760;
}
.pet-approval-done { opacity: 0; }

.pet-approval-card i,
.pet-approval-card b {
  position: absolute;
  left: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(110, 81, 73, 0.2);
}
.pet-approval-card i { top: 37px; width: 72px; }
.pet-approval-card b { top: 49px; width: 55px; }
.pet-approval-card em {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 25px;
  height: 16px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 5px 12px rgba(223, 114, 85, 0.23);
}
.pet-approval-card em::before {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 7px;
  height: 4px;
  border-bottom: 2px solid var(--bg);
  border-left: 2px solid var(--bg);
  content: "";
  transform: rotate(-45deg);
}

.pet-relay {
  position: absolute;
  z-index: 7;
  bottom: 112px;
  left: 22%;
  width: 56%;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(223, 114, 85, 0.18);
}
.pet-relay i {
  display: block;
  width: 26px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--coral));
  box-shadow: 0 0 12px var(--coral);
  will-change: transform, opacity;
}

.pet-agent-status {
  position: absolute;
  z-index: 8;
  bottom: 105px;
  left: calc(50% - 48px);
  width: 96px;
  height: 58px;
  padding: 10px;
  border-radius: 14px 10px 16px 11px;
  background: linear-gradient(145deg, var(--ink), #503430);
  box-shadow: 0 17px 36px rgba(52, 26, 22, 0.24);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.pet-agent-status i {
  display: block;
  width: 62px;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.24);
  transform-origin: left center;
  will-change: transform, opacity;
}
.pet-agent-status i:nth-of-type(2) { width: 45px; background: var(--coral); }
.pet-agent-status i:nth-of-type(3) { width: 56px; background: var(--rose); }
.pet-agent-status b {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 14px rgba(31, 169, 102, 0.44);
}
.pet-agent-status b::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 3px;
  border-bottom: 2px solid var(--bg);
  border-left: 2px solid var(--bg);
  content: "";
  transform: rotate(-45deg);
}

.pet-agent-signal {
  position: absolute;
  z-index: 10;
  top: 23%;
  left: 45%;
  display: flex;
  gap: 7px;
}
.pet-agent-signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 10px rgba(223, 114, 85, 0.5);
  will-change: transform, opacity;
}

.pet-camp-table {
  position: absolute;
  z-index: 6;
  bottom: 30px;
  left: calc(50% - 47px);
  width: 94px;
  height: 16px;
  border-radius: 50%;
  background: #825848;
  box-shadow: 0 7px 16px rgba(91, 43, 33, 0.2);
}
.pet-camp-table::before,
.pet-camp-table::after {
  position: absolute;
  top: 11px;
  width: 8px;
  height: 56px;
  border-radius: 999px;
  background: #674238;
  content: "";
  transform-origin: top center;
}
.pet-camp-table::before { left: 26px; transform: rotate(9deg); }
.pet-camp-table::after { right: 26px; transform: rotate(-9deg); }

.pet-cup {
  position: absolute;
  z-index: 9;
  bottom: 43px;
  width: 28px;
  height: 38px;
  border-radius: 7px 7px 10px 10px;
  background: linear-gradient(180deg, rgba(246, 176, 155, 0.78), var(--coral));
  box-shadow: 0 8px 15px rgba(91, 43, 33, 0.16);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.pet-cup::before {
  position: absolute;
  top: -6px;
  right: -7px;
  width: 11px;
  height: 13px;
  border: 3px solid var(--coral);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  content: "";
}
.pet-cup i {
  position: absolute;
  top: -10px;
  left: 14px;
  width: 2px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink);
  transform: rotate(8deg);
}
.pet-cup-left { left: calc(50% - 40px); }
.pet-cup-right { left: calc(50% + 11px); }

.pet-rest-phone { z-index: 8; bottom: 43px; left: calc(50% - 20px); width: 41px; height: 62px; }
.pet-rest-phone i {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  transform: translateX(-50%);
}

.pet-campfire {
  position: absolute;
  z-index: 8;
  right: 13%;
  bottom: 20px;
  width: 38px;
  height: 48px;
  will-change: transform, opacity;
}
.pet-campfire i,
.pet-campfire b {
  position: absolute;
  bottom: 10px;
  left: 50%;
  border-radius: 64% 36% 62% 38% / 72% 43% 57% 28%;
  content: "";
  transform: translateX(-50%) rotate(45deg);
  transform-origin: 50% 90%;
}
.pet-campfire i { width: 27px; height: 27px; background: var(--coral); }
.pet-campfire b { width: 16px; height: 16px; background: var(--amber); }
.pet-campfire span {
  position: absolute;
  right: 1px;
  bottom: 2px;
  left: 1px;
  height: 7px;
  border-radius: 999px;
  background: #674238;
  transform: rotate(7deg);
}
.pet-campfire span::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  content: "";
  transform: rotate(-14deg);
}

.pet-story-camp .pet-ground {
  right: 2%;
  bottom: 8px;
  left: 2%;
  height: 74px;
  border-radius: 48% 52% 45% 55% / 55% 45% 55% 45%;
  background:
    radial-gradient(ellipse at 30% 22%, rgba(255, 245, 205, 0.92), transparent 43%),
    linear-gradient(180deg, rgba(181, 203, 134, 0.88), rgba(123, 158, 104, 0.76));
  filter: none;
  box-shadow: 0 15px 26px rgba(74, 91, 59, 0.15);
}

.pet-camp-tent {
  position: absolute;
  z-index: 2;
  bottom: 50px;
  left: 50%;
  width: 73%;
  height: 63%;
  filter: drop-shadow(0 16px 17px var(--pet-shadow));
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.pet-camp-tent::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(126deg, var(--pet-tent-light), var(--pet-tent-main) 48%, var(--pet-tent-shadow));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
}
.pet-camp-tent::after {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 50%;
  width: 37%;
  height: 66%;
  background: linear-gradient(110deg, var(--pet-tent-door), var(--pet-tent-shadow));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
  transform: translateX(-50%);
}
.pet-camp-tent i {
  position: absolute;
  z-index: 3;
  top: -8px;
  bottom: -3px;
  left: 50%;
  width: 3px;
  border-radius: 999px;
  background: var(--pet-tent-pole);
  content: "";
  transform: translateX(-50%);
}
.pet-camp-tent b {
  position: absolute;
  z-index: 1;
  right: 4%;
  bottom: -7px;
  left: 4%;
  height: 8px;
  border-radius: 50%;
  background: var(--pet-tent-shadow);
  content: "";
  opacity: 0.48;
}

.pet-camp-sun {
  position: absolute;
  z-index: 1;
  top: 38px;
  right: 12%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff7cf 0 12%, #f6c86b 55%, #eaa84f 100%);
  box-shadow: 0 0 34px rgba(246, 200, 107, 0.46);
  will-change: transform, opacity;
}
.pet-camp-sun i {
  position: absolute;
  inset: -23px;
  border: 1px dashed rgba(234, 168, 79, 0.38);
  border-radius: 50%;
}

.pet-camp-sea {
  position: absolute;
  z-index: 0;
  right: 1%;
  bottom: 51px;
  left: 1%;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(126, 191, 198, 0.4), rgba(200, 225, 210, 0.12));
  transform-origin: center;
  will-change: transform, opacity;
}
.pet-camp-sea::after {
  position: absolute;
  top: 13px;
  right: 8%;
  left: 8%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  content: "";
}

.pet-cola {
  position: absolute;
  z-index: 9;
  bottom: 29px;
  width: 24px;
  height: 43px;
  border-radius: 7px 7px 9px 9px;
  background: linear-gradient(90deg, #9e332b, #d95343 47%, #9e332b);
  box-shadow: 0 9px 15px rgba(91, 43, 33, 0.17);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.pet-cola-left { left: 2%; }
.pet-cola-right { right: 2%; }
.pet-cola::before {
  position: absolute;
  top: 17px;
  right: 0;
  left: 0;
  height: 8px;
  background: rgba(255, 244, 231, 0.88);
  content: "";
  transform: skewY(-7deg);
}
.pet-cola i {
  position: absolute;
  top: -2px;
  right: 2px;
  left: 2px;
  height: 5px;
  border-radius: 50%;
  background: #6e625b;
}
.pet-cola b {
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 3px;
  border-radius: 50%;
  background: #d9d1ca;
  transform: translateX(-50%);
}

.pet-camp-breeze {
  position: absolute;
  z-index: 3;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  will-change: transform, opacity;
}
.pet-camp-breeze::after {
  position: absolute;
  top: -5px;
  right: -7px;
  width: 13px;
  height: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  content: "";
}
.pet-camp-breeze-one { top: 94px; left: 30%; width: 52px; }
.pet-camp-breeze-two { top: 122px; left: 61%; width: 36px; }

.pet-story.is-static :is(.pet-character, .pet-scene-pair, .pet-lounge-pair, .pet-ground, .pet-phone, .pet-notice, .pet-approval-card, .pet-relay, .pet-agent-status, .pet-agent-signal, .pet-camp-table, .pet-cup, .pet-rest-phone, .pet-campfire, .pet-cola, .pet-camp-sun, .pet-camp-sea, .pet-camp-tent, .pet-camp-breeze, .pet-story-label) {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 961px) {
  .chapter { position: relative; isolation: isolate; }
  .pet-story-hello { transform: translateY(8px) scale(0.92); transform-origin: right bottom; }
  .pet-story-approval { transform: scale(0.88); transform-origin: left top; }
  .pet-story-agent { transform: scale(0.86); transform-origin: right bottom; }
  .pet-story-camp {
    right: clamp(22px, 3vw, 64px);
    bottom: clamp(300px, 35vh, 410px);
    transform: scale(0.86);
    transform-origin: right bottom;
  }
}

@media (max-width: 1440px) and (min-width: 961px) {
  .pet-story-camp {
    right: 2px;
    bottom: clamp(242px, 36vh, 286px);
    width: 340px;
    height: 250px;
    transform: scale(0.72);
  }
}

@media (max-width: 1180px) and (min-width: 961px) {
  .pet-story { width: 330px; height: 250px; }
  .pet-story-hello,
  .pet-story-agent,
  .pet-story-camp { right: 12px; width: 390px; }
  .pet-story-approval { left: 8px; }
  .pet-story-label { transform: scale(0.88); transform-origin: right top; }
}

@media (max-width: 960px) {
  .pet-story,
  .pet-story-hello,
  .pet-story-approval,
  .pet-story-agent,
  .pet-story-camp {
    position: relative;
    inset: auto;
    width: min(100%, 460px);
    height: 300px;
    margin: 26px auto 0;
    transform: none;
  }
  .hero .pet-story { grid-column: 1; }
  .pet-story-label { right: 9px; }
}

@media (max-width: 640px) {
  .pet-story,
  .pet-story-hello,
  .pet-story-approval,
  .pet-story-agent,
  .pet-story-camp { width: min(100%, 380px); height: 260px; }
  .pet-scene-pair { width: 104%; }
  .pet-lounge-pair { width: 106%; }
  .pet-camp-tent { bottom: 45px; width: 72%; height: 60%; }
  .pet-story-camp .pet-ground { height: 64px; }
  .pet-story-camp .pet-camp-sun { top: 32px; right: 8%; transform: scale(0.82); }
  .pet-story-label { top: 0; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .pet-story * { animation: none !important; transition: none !important; }
}
