/* QuaPact pond scene — scoped visual module.
   All classes use the qp-scene- prefix. No global element resets. */

.qp-scene-root {
  --qp-scene-gold: #e8c276;
  --qp-scene-gold-deep: #a8762a;
  --qp-scene-cream: #fbf3df;
  --qp-scene-ink: #1d2b24;
  --qp-scene-muted: #576456;
  --qp-scene-panel: #fffaf0;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  background: #07121d;
  color: #f6eeda;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.qp-scene-root *,
.qp-scene-root *::before,
.qp-scene-root *::after {
  box-sizing: border-box;
}

.qp-scene-root [hidden] {
  display: none !important;
}

.qp-scene-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.qp-scene-root::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 54%;
  z-index: 8;
  display: none;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 13, 20, .68) 0%, rgba(4, 13, 20, .5) 42%, rgba(4, 13, 20, 0) 100%);
}

.qp-scene-world {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}

.qp-scene-art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.qp-scene-art-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qp-scene-asset {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.qp-scene-root[data-qp-asset-bg="true"] .qp-scene-asset--background {
  opacity: 1;
}

.qp-scene-root[data-qp-asset-bg="true"] .qp-scene-art {
  display: none;
}

.qp-scene-asset--background {
  z-index: 1;
}

.qp-scene-asset--guardian {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  opacity: 0;
}

.qp-scene-root[data-qp-asset-guardian="true"] .qp-scene-asset--guardian {
  opacity: 1;
}

.qp-scene-root[data-qp-asset-guardian="true"] .qp-scene-guardian-art {
  display: none;
}

/* R2 compatibility: a supplied guardian PNG is bottom-aligned exactly at the
   stage edge, so its feet/ground are not clipped by the default -2.2% offset.
   The vector guardian keeps the original framing. */
.qp-scene-root[data-qp-asset-guardian="true"] .qp-scene-guardian {
  bottom: 0;
}

.qp-scene-shimmer {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 56%;
  bottom: -2%;
  z-index: 2;
  pointer-events: none;
  opacity: .55;
  background:
    repeating-linear-gradient(180deg, rgba(255, 229, 190, 0) 0 13px, rgba(255, 229, 190, .055) 13px 15px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 62%, transparent 100%);
  animation: qp-scene-shimmer 19s linear infinite;
}

.qp-scene-guardian {
  position: absolute;
  right: clamp(-18px, -1vw, 10px);
  bottom: -2.2%;
  z-index: 4;
  width: clamp(300px, 43vw, 600px);
  aspect-ratio: 700 / 760;
  pointer-events: none;
  transform-origin: 50% 100%;
  will-change: transform;
  animation: qp-scene-guardian-breathe 7.5s ease-in-out infinite;
}

.qp-scene-guardian-art,
.qp-scene-guardian-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qp-scene-fog {
  position: absolute;
  left: -22%;
  width: 144%;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}

.qp-scene-fog--a {
  bottom: 1%;
  height: 34%;
  opacity: .5;
  background: radial-gradient(60% 100% at 50% 100%, rgba(211, 223, 219, .3), rgba(211, 223, 219, 0) 72%);
  animation: qp-scene-drift-a 58s ease-in-out infinite alternate;
}

.qp-scene-fog--b {
  top: 50%;
  height: 17%;
  opacity: .38;
  background: linear-gradient(90deg, rgba(226, 232, 226, 0) 0%, rgba(226, 232, 226, .2) 38%, rgba(226, 232, 226, .24) 58%, rgba(226, 232, 226, 0) 100%);
  animation: qp-scene-drift-b 74s ease-in-out infinite alternate;
}

.qp-scene-fog--c {
  bottom: -8%;
  height: 27%;
  z-index: 6;
  opacity: .34;
  background: radial-gradient(55% 100% at 46% 100%, rgba(234, 238, 229, .34), rgba(234, 238, 229, 0) 70%);
  animation: qp-scene-drift-c 46s ease-in-out infinite alternate;
}

.qp-scene-fireflies {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.qp-scene-firefly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe8ad;
  box-shadow: 0 0 10px 3px rgba(255, 212, 128, .55), 0 0 22px 6px rgba(255, 200, 110, .18);
  opacity: .75;
  animation: qp-scene-firefly 15s ease-in-out infinite;
}

.qp-scene-firefly--2 { width: 4px; height: 4px; animation-duration: 19s; animation-delay: -4s; }
.qp-scene-firefly--3 { width: 6px; height: 6px; animation-duration: 23s; animation-delay: -8s; }
.qp-scene-firefly--4 { width: 3px; height: 3px; animation-duration: 13s; animation-delay: -2s; }
.qp-scene-firefly--5 { width: 4px; height: 4px; animation-duration: 17s; animation-delay: -11s; }
.qp-scene-firefly--6 { width: 5px; height: 5px; animation-duration: 21s; animation-delay: -6s; }
.qp-scene-firefly--7 { width: 3px; height: 3px; animation-duration: 16s; animation-delay: -13s; }
.qp-scene-firefly--8 { width: 4px; height: 4px; animation-duration: 18s; animation-delay: -9s; }

.qp-scene-hero {
  position: absolute;
  left: clamp(20px, 6.4vw, 104px);
  top: clamp(30px, 13vh, 128px);
  z-index: 10;
  width: min(610px, 54%);
  pointer-events: none;
}

.qp-scene-hero-kicker {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid rgba(232, 194, 118, .38);
  border-radius: 999px;
  background: rgba(7, 22, 30, .34);
  color: #f0dfbd;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.qp-scene-hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--qp-scene-gold);
  box-shadow: 0 0 10px rgba(232, 194, 118, .8);
}

.qp-scene-hero-title {
  margin: 0;
  color: #fbf3e0;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(46px, 7.4vw, 96px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.02em;
  text-shadow: 0 10px 32px rgba(2, 10, 16, .45);
}

.qp-scene-hero-title span {
  color: var(--qp-scene-gold);
}

.qp-scene-hero-slogan {
  margin: 18px 0 0;
  max-width: 22ch;
  color: #f6e8c9;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(19px, 2.2vw, 30px);
  line-height: 1.3;
  text-shadow: 0 6px 24px rgba(2, 10, 16, .5);
}

.qp-scene-hero-text {
  margin: 14px 0 0;
  max-width: 34ch;
  color: #d9e0d3;
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.6;
  text-shadow: 0 2px 14px rgba(2, 10, 16, .55);
}

.qp-scene-panel {
  position: absolute;
  left: clamp(16px, 4.4vw, 72px);
  top: 50%;
  z-index: 12;
  width: min(720px, 58vw);
  max-height: min(84%, 780px);
  overflow: auto;
  transform: translateY(-50%);
  padding: clamp(22px, 3.2vw, 44px);
  border: 1px solid rgba(168, 118, 42, .34);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .99), rgba(247, 240, 226, .99));
  color: var(--qp-scene-ink);
  box-shadow: 0 28px 90px rgba(2, 10, 16, .5), 0 2px 0 rgba(255, 255, 255, .6) inset;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #b9a67d transparent;
}

.qp-scene-panel-kicker {
  margin: 0 0 12px;
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid #d9c294;
  border-radius: 999px;
  background: #f8edd2;
  color: #6d4d18;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.qp-scene-panel-title {
  margin: 0;
  color: #173d2e;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.01em;
}

.qp-scene-panel-sub {
  margin: 6px 0 0;
  color: var(--qp-scene-muted);
  font-size: 14px;
  letter-spacing: .02em;
}

.qp-scene-panel-rule {
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, #c9a96a, rgba(201, 169, 106, .08));
}

.qp-scene-panel-text {
  margin: 0 0 18px;
  color: #26332b;
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.68;
}

.qp-scene-panel-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.qp-scene-panel-list li {
  position: relative;
  padding-left: 22px;
  color: #36453a;
  font-size: clamp(13.5px, 1.15vw, 15px);
  line-height: 1.55;
}

.qp-scene-panel-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .56em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8893b;
  box-shadow: 0 0 0 3px rgba(184, 137, 59, .16);
}

.qp-scene-panel-note {
  margin: 0;
  padding-top: 16px;
  border-top: 1px dashed #ddcfb2;
  color: #6a6247;
  font-size: 11.5px;
  line-height: 1.55;
}

.qp-scene-help {
  position: absolute;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2.4vh, 28px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 18px 11px 12px;
  border: 1px solid rgba(232, 194, 118, .8);
  border-radius: 999px;
  background: rgba(9, 30, 25, .84);
  color: #f9efd6;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  cursor: pointer;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .34);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.qp-scene-help:hover {
  background: rgba(16, 48, 38, .94);
  border-color: #f4d799;
  transform: translateY(-1px);
}

.qp-scene-help:active {
  transform: translateY(0);
}

.qp-scene-help:focus-visible {
  outline: 3px solid #ffe6a4;
  outline-offset: 3px;
}

.qp-scene-help-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #ffe9ad, #d3a247 70%, #9c6b20);
  color: #22301e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 247, 220, .35) inset;
}

.qp-scene-help-label {
  display: inline-block;
}

/* ---------- Motion ---------- */

.qp-scene-frog-breathe {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.qp-scene-frog-eyelid {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  transform: scaleY(0);
  animation: qp-scene-blink 9.6s ease-in-out infinite;
}

.qp-scene-frog-eyelid--r {
  animation-delay: .08s;
}

.qp-scene-crown-glint {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: qp-scene-glint 6.5s ease-in-out infinite;
}

.qp-scene-pad {
  will-change: transform;
  animation: qp-scene-pad-bob 11s ease-in-out infinite;
}

.qp-scene-pad--b { animation-delay: -2.6s; animation-duration: 12.5s; }
.qp-scene-pad--c { animation-delay: -5.1s; animation-duration: 10.2s; }
.qp-scene-pad--d { animation-delay: -7.4s; animation-duration: 13.6s; }
.qp-scene-pad--e { animation-delay: -1.8s; animation-duration: 12s; }
.qp-scene-pad--f { animation-delay: -9s; animation-duration: 14.5s; }
.qp-scene-pad--g { animation-delay: -4s; animation-duration: 11.8s; }

.qp-scene-star {
  opacity: .75;
}

@keyframes qp-scene-guardian-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.0035); }
}

@keyframes qp-scene-blink {
  0%, 91%, 95%, 100% { transform: scaleY(0); }
  93% { transform: scaleY(1); }
}

@keyframes qp-scene-glint {
  0%, 72%, 100% { opacity: .2; transform: scale(.86); }
  78% { opacity: 1; transform: scale(1.06); }
  84% { opacity: .4; transform: scale(.94); }
}

@keyframes qp-scene-pad-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}



@keyframes qp-scene-drift-a {
  0% { transform: translate3d(-3%, 0, 0) scaleX(1); }
  100% { transform: translate3d(3%, -1%, 0) scaleX(1.04); }
}

@keyframes qp-scene-drift-b {
  0% { transform: translate3d(2%, 0, 0); }
  100% { transform: translate3d(-2.5%, 1%, 0); }
}

@keyframes qp-scene-drift-c {
  0% { transform: translate3d(-2%, 0, 0); }
  100% { transform: translate3d(2%, -1.5%, 0); }
}

@keyframes qp-scene-firefly {
  0%, 100% { opacity: .15; transform: translate3d(0, 0, 0) scale(.7); }
  35% { opacity: .9; transform: translate3d(8px, -14px, 0) scale(1); }
  65% { opacity: .45; transform: translate3d(-6px, -22px, 0) scale(.85); }
}

@keyframes qp-scene-shimmer {
  0%, 100% { opacity: .4; }
  50% { opacity: .62; }
}

/* ---------- Mode: workspace ---------- */

.qp-scene-root--workspace .qp-scene-world {
  filter: saturate(.72) brightness(.68) contrast(1.03);
}

.qp-scene-root--workspace .qp-scene-guardian {
  opacity: .72;
  right: -1.5%;
  width: clamp(280px, 38vw, 540px);
}

.qp-scene-root--workspace .qp-scene-shimmer {
  opacity: .2;
}

.qp-scene-root--workspace .qp-scene-fog--a,
.qp-scene-root--workspace .qp-scene-fog--c {
  opacity: .3;
}

/* ---------- Motion off / paused ---------- */

.qp-scene-root[data-qp-motion="off"] .qp-scene-world *,
.qp-scene-root[data-qp-motion="off"] .qp-scene-shimmer,
.qp-scene-root[data-qp-motion="off"] .qp-scene-fog,
.qp-scene-root[data-qp-motion="off"] .qp-scene-firefly,
.qp-scene-root[data-qp-motion="off"] .qp-scene-star,
.qp-scene-root[data-qp-motion="off"] .qp-scene-pad,
.qp-scene-root[data-qp-motion="off"] .qp-scene-frog-eyelid,
.qp-scene-root[data-qp-motion="off"] .qp-scene-crown-glint,
.qp-scene-root[data-qp-paused="true"] .qp-scene-world *,
.qp-scene-root[data-qp-paused="true"] .qp-scene-shimmer,
.qp-scene-root[data-qp-paused="true"] .qp-scene-fog,
.qp-scene-root[data-qp-paused="true"] .qp-scene-firefly {
  animation-play-state: paused !important;
}

.qp-scene-root[data-qp-motion="off"] .qp-scene-shimmer {
  opacity: .3;
}

.qp-scene-root[data-qp-motion="off"] .qp-scene-frog-eyelid {
  transform: scaleY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .qp-scene-root::before {
    display: block;
  }

  .qp-scene-root--workspace::before {
    display: none;
  }

  .qp-scene-hero {
    left: 20px;
    right: 20px;
    top: 26px;
    width: auto;
  }

  .qp-scene-hero-kicker {
    margin-bottom: 10px;
    padding: 6px 11px;
    font-size: 10px;
  }

  .qp-scene-hero-title {
    font-size: clamp(44px, 13.5vw, 66px);
  }

  .qp-scene-hero-slogan {
    margin-top: 12px;
    font-size: clamp(18px, 5.4vw, 24px);
    max-width: 19ch;
  }

  .qp-scene-hero-text {
    margin-top: 10px;
    font-size: 13px;
    max-width: 30ch;
  }

  .qp-scene-guardian {
    width: clamp(280px, 94vw, 470px);
    right: -12%;
    bottom: -3%;
  }

  .qp-scene-root--workspace .qp-scene-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 82px;
    width: auto;
    max-height: none;
    transform: none;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .qp-scene-root--workspace .qp-scene-guardian {
    width: 120vw;
    right: -38%;
    opacity: .28;
  }

  .qp-scene-help {
    right: 12px;
    bottom: 12px;
    min-height: 48px;
    padding: 10px 15px 10px 10px;
    font-size: 14px;
  }

  .qp-scene-help-icon {
    width: 26px;
    height: 26px;
    font-size: 17px;
  }

  .qp-scene-panel-title {
    font-size: clamp(25px, 7.4vw, 32px);
  }

  .qp-scene-panel-text {
    font-size: 15px;
  }

  .qp-scene-panel-list li {
    font-size: 13.5px;
  }
}

@media (max-height: 560px) {
  .qp-scene-hero {
    top: 18px;
  }

  .qp-scene-hero-text {
    display: none;
  }

  .qp-scene-guardian {
    width: clamp(230px, 34vh, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qp-scene-root .qp-scene-world *,
  .qp-scene-root .qp-scene-shimmer,
  .qp-scene-root .qp-scene-fog,
  .qp-scene-root .qp-scene-firefly {
    animation: none !important;
  }

  .qp-scene-root *,
  .qp-scene-root *::before,
  .qp-scene-root *::after {
    transition: none !important;
  }

  .qp-scene-root .qp-scene-frog-eyelid {
    transform: scaleY(0);
  }
}
