@import url('https://fonts.googleapis.com/css2?family=Ruthie&family=Oxanium:wght@400;500;600&family=Kalam:wght@300;400;700&display=swap');

@font-face{
  font-family: 'Pecita';
  src: url('fonts/Pecita.woff2') format('woff2'),
       url('fonts/Pecita.otf') format('opentype');
  font-display: swap;
}

:root{
  --cream: #f7f1ea;
  --coral: #e07a5a;
  --coral-deep: #c85a3f;
  --blush: #f3b9a6;
  --peach: #f6c9a8;
  --olive: #7c7350;
  --olive-soft: #8c8464;
  --glass-gold: #f0c98a;
  --glass-pink: #f3a6b8;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html, body{
  height:100%;
  overflow-x:hidden;
}

body{
  font-family:'Quicksand', sans-serif;
  background: linear-gradient(165deg, var(--cream) 0%, var(--cream) 30%, var(--blush) 65%, var(--peach) 100%);
  background-attachment: fixed;
  min-height:100vh;
  position:relative;
  cursor: pointer;
}

/* ---------- menu toggle (hamburger) ---------- */

.menu-toggle{
  position: fixed;
  top: 2.4rem;
  left: 2.4rem;
  z-index: 40;
  width: 42px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
}

.menu-toggle span{
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--coral);
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.3s ease, background 0.3s ease;
  transform-origin: center;
}

.menu-toggle:hover span{
  background: var(--coral-deep);
}

.menu-toggle.is-open span:nth-child(1){
  transform: translateY(11px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2){
  opacity: 0;
}
.menu-toggle.is-open span:nth-child(3){
  transform: translateY(-11px) rotate(-45deg);
}

/* ---------- slide-out menu ---------- */

.menu-overlay{
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(90,60,50,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.menu-overlay.open{
  opacity: 1;
  pointer-events: auto;
}

.side-menu{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: min(340px, 82vw);
  height: 100%;
  padding: 5.5rem 2rem 2rem;
  background: linear-gradient(160deg,
    rgba(200,215,140,0.92) 0%,
    rgba(246,201,168,0.94) 45%,
    rgba(246,201,138,0.96) 100%);
  backdrop-filter: blur(6px);
  box-shadow: 4px 0 30px rgba(150,100,70,0.18);
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.side-menu.open{
  transform: translateX(0);
}

.menu-logo{
  width: 270px;
  height: 270px;
  margin-bottom: 2rem;
}

.menu-logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.menu-links{
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.menu-links a{
  font-family: 'Pecita', 'Kalam', cursive;
  font-size: 2rem;
  letter-spacing: 2px;
  color: #3a3020;
  text-decoration: none;
  padding-bottom: 0.35rem;
  border-bottom: 2.5px solid #3a3020;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.menu-links a:hover{
  color: var(--coral-deep);
  border-color: var(--coral-deep);
  transform: scale(1.05);
}

/* ---------- hero ---------- */

.hero{
  position:relative;
  min-height:100vh;
  padding: 6vh 6vw 8vh;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.title-row{
  display:flex;
  align-items:center;
  gap: 3rem;
  flex-wrap: wrap;
}

h1.script{
  font-family:'Ruthie', cursive;
  font-weight:400;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height:1.05;
  color: var(--coral);
  text-shadow: 0 2px 18px rgba(224,122,90,0.15);
  letter-spacing: 0.5px;
  margin-left: 2.4rem;
}

.logo-frame{
  width: 330px;
  height: 330px;
  margin-left: -3rem;
  background: transparent;
  border: none;
  box-shadow: none;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  overflow:hidden;
  transition: transform 0.4s ease;
}

.logo-frame:hover{
  transform: scale(1.04) rotate(-1deg);
}

.logo-image{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

.enter-prompt{
  opacity: 0.8;
  margin-top: -8rem;
  margin-left: 2.4rem;
  font-family:'Oxanium', sans-serif;
  font-weight:500;
  font-size: 1.15rem;
  color: var(--coral);
  display:inline-flex;
  align-items:center;
  gap: 0.5rem;
  width:fit-content;
}

.enter-prompt .arrow{
  display:inline-block;
  transition: transform 0.3s ease;
}

body:hover .enter-prompt .arrow{
  transform: translateX(4px);
}

.welcome{
  align-self:flex-end;
  max-width: 660px;
  margin-right: -2vw;
  margin-bottom: 6vh;
  text-align:center;
  font-family:'Kalam', cursive;
  font-size: 1.5rem;
  line-height:1.6;
  color: var(--olive);
}

.welcome p{
  margin-bottom: 0.15rem;
}

/* ---------- bubbles ---------- */

.bubble{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.15) 22%, rgba(255,255,255,0) 45%),
    radial-gradient(circle at 70% 75%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 40%);
  border: 1.5px solid rgba(255,255,255,0.55);
  box-shadow:
    inset 0 0 20px rgba(255,255,255,0.35),
    0 8px 30px rgba(200,120,90,0.12);
  animation: drift 9s ease-in-out infinite, spin-shimmer 14s linear infinite;
  transition: transform 0.5s ease;
}

.bubble::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 35%, transparent 65%, rgba(255,255,255,0.15) 100%);
}

.bubble.gold{
  border-color: rgba(240,201,138,0.6);
  box-shadow: inset 0 0 22px rgba(240,201,138,0.3), 0 8px 30px rgba(200,120,90,0.12);
}

.bubble.pink{
  border-color: rgba(243,166,184,0.6);
  box-shadow: inset 0 0 22px rgba(243,166,184,0.3), 0 8px 30px rgba(200,120,90,0.12);
}

#bubble-1{ width:460px; height:460px; top:2vh; right:2vw; animation-delay:0s, 0s; }
#bubble-2{ width:150px; height:150px; top:32vh; left:29vw; animation-delay:1.2s, 2s; }
#bubble-3{ width:230px; height:230px; bottom:12vh; right:12vw; animation-delay:2.4s, 4s; }
#bubble-4{ width:220px; height:220px; bottom:16vh; left:8vw; animation-delay:0.6s, 1s; }

@keyframes drift{
  0%, 100%{ transform: translateY(0px) translateX(0px); }
  50%{ transform: translateY(-18px) translateX(8px); }
}

@keyframes spin-shimmer{
  0%{ filter: brightness(1); }
  50%{ filter: brightness(1.08); }
  100%{ filter: brightness(1); }
}

/* ---------- about page ---------- */

.about-page{
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 6vh 6vw 10vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-title{
  font-family:'Ruthie', cursive;
  font-weight:400;
  font-size: clamp(3rem, 7vw, 5rem);
  color: var(--coral);
  text-shadow: 0 2px 18px rgba(224,122,90,0.15);
  margin-bottom: 2rem;
  margin-left: 2.4rem;
}

.about-text{
  max-width: 1050px;
  margin: 0 auto;
  text-align: center;
  font-family:'Kalam', cursive;
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  line-height: 1.75;
  background: linear-gradient(180deg, var(--coral-deep) 0%, var(--coral) 35%, var(--olive) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.about-text p{
  margin-bottom: 0.5rem;
}

.avatar-wrap{
  position: fixed;
  right: 0;
  bottom: 48px;
  width: clamp(220px, 26vw, 340px);
  z-index: 8;
  pointer-events: auto;
  cursor: pointer;
}

/* stage 1: the natural swing you liked — slow start, amplitude narrows,
   gets faster. Plays once and holds its end frame at +2px. */
@keyframes avatar-swing{
  0%   { transform: translateX(0); }
  12%  { transform: translateX(8px); }
  24%  { transform: translateX(-8px); }
  36%  { transform: translateX(7px); }
  46%  { transform: translateX(-7px); }
  55%  { transform: translateX(6px); }
  63%  { transform: translateX(-6px); }
  70%  { transform: translateX(5px); }
  76%  { transform: translateX(-5px); }
  81%  { transform: translateX(4px); }
  85%  { transform: translateX(-4px); }
  89%  { transform: translateX(3px); }
  92%  { transform: translateX(-3px); }
  95%  { transform: translateX(2px); }
  97%  { transform: translateX(-2px); }
  99%  { transform: translateX(1px); }
  100% { transform: translateX(2px); }
}

/* stage 2: peak motion held forever — seamless ±2px loop, starts & ends at
   +2px so it connects to stage 1's end frame and loops without a jump. */
@keyframes avatar-peak{
  0%   { transform: translateX(2px); }
  50%  { transform: translateX(-2px); }
  100% { transform: translateX(2px); }
}

.avatar-wrap.paused{
  animation: none !important;
  transform: translateX(0);
}

.avatar-base,
.avatar-wave{
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease;
}

.avatar-wave{
  position: absolute;
  inset: 0;
  opacity: 0;
}

.avatar-wrap:hover .avatar-base{
  opacity: 0;
}

.avatar-wrap:hover .avatar-wave{
  opacity: 1;
}

.avatar-hi{
  position: absolute;
  top: -16%;
  left: 60%;
  transform: translateX(-50%);
  width: 28%;
  height: auto;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

.avatar-wrap:hover .avatar-hi{
  opacity: 1;
}

/* ---------- footer ---------- */

.site-footer{
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 15;
  width: 100%;
  padding: 1rem 6vw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Oxanium', sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: var(--olive);
  background: linear-gradient(90deg,
    rgba(184,206,120,0.85) 0%,
    rgba(232,196,140,0.85) 50%,
    rgba(244,178,120,0.9) 100%);
}

.about-link{
  color: var(--coral-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.about-link:hover{
  color: var(--coral);
}

/* ---------- gallery page ---------- */

.gallery-page{
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 5vh 4vw 12vh;
}

.gallery-title{
  font-family:'Ruthie', cursive;
  font-weight:400;
  font-size: clamp(3rem, 7vw, 5rem);
  color: var(--coral);
  text-shadow: 0 2px 18px rgba(224,122,90,0.15);
  margin-left: 6rem;
}

.shatter-stage{
  width: 100%;
  max-width: 1240px;
  margin: -2vh auto 0;
}

.shatter-svg{
  width: 100%;
  height: auto;
  overflow: visible;
}

.shard{
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(var(--dx,0px), var(--dy,0px)) rotate(var(--rot,0deg));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.5s ease;
  animation: shard-in 0.9s ease both, shard-float 7s ease-in-out infinite;
  filter: drop-shadow(3px 5px 7px rgba(120,70,60,0.28));
}

/* crack outline */
.shard .edge{
  fill: none;
  stroke: rgba(80,50,45,0.42);
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
}

/* bevel: bright rim reflection along the cut edges = cut-glass thickness/light.
   Painted with a thick bright stroke that only shows near the edges (clipped to
   the shard), giving a glossy chamfered rim instead of a flat dark line. */
.shard .bevel{
  fill: none;
  stroke: url(#bevel);
  stroke-width: 10;
  stroke-linejoin: round;
  opacity: 0.85;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* surface reflection sweep on image shards */
.shard .sheen{
  fill: url(#sheen);
  mix-blend-mode: screen;
  opacity: 0.7;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* glint: the surface highlight brightens & dims in place (no movement) —
   like light glancing off glass now and then. Only opacity animates. */
.shard .glint{
  animation: glint-flicker 5.5s ease-in-out infinite;
  animation-delay: var(--flick-delay, 0s);
}
@keyframes glint-flicker{
  0%, 100% { opacity: 0.55; }
  8%       { opacity: 1; }
  16%      { opacity: 0.6; }
  50%      { opacity: 0.5; }
}

/* edge glow: rim flares bright in sync with the glint, then fades — the 光电 */
.shard .edge-glow{
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: edge-glow 5.5s ease-in-out infinite;
  animation-delay: var(--flick-delay, 0s);
}
@keyframes edge-glow{
  0%, 100% { opacity: 0; }
  6%       { opacity: 0.85; }
  14%      { opacity: 0; }
}

/* hover: a stronger flare, still no movement */
.shard:hover .glint{ animation: glint-flicker 0.6s ease-out; opacity: 1; }
.shard:hover .edge-glow{ animation: edge-glow-hover 0.7s ease-out; }
@keyframes edge-glow-hover{
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}

/* pure glass shards */
.glass .glass-fill{ fill: url(#glassFill); }
.glass .glass-sheen{ fill: url(#glassSheen); mix-blend-mode: screen; opacity: 0.9; pointer-events:none; }
.glass{ filter: drop-shadow(3px 5px 8px rgba(150,100,110,0.3)); }
.glass .edge{ stroke: rgba(255,255,255,0.55); stroke-width: 1.5; }

/* hover: lift + scale, brighten, reflections flare, float pauses */
.shard:hover{
  transform: translate(var(--dx,0px), var(--dy,0px)) rotate(var(--rot,0deg)) scale(1.07);
  filter: brightness(1.13) drop-shadow(4px 10px 20px rgba(200,120,90,0.42));
  animation-play-state: paused, paused;
}
.shard:hover .sheen,
.shard:hover .glass-sheen,
.shard:hover .bevel{ opacity: 1; }

/* fragment 7: image swap toggled by JS (.show-b) */
.shard-swap .img-7b{ opacity: 0; transition: opacity 0.4s ease; }
.shard-swap.show-b .img-7a{ opacity: 0; transition: opacity 0.4s ease; }
.shard-swap.show-b .img-7b{ opacity: 1; }

/* fly in from center on load, land at drift+rotation */
@keyframes shard-in{
  0%   { transform: translate(0,0) rotate(0deg) scale(0.15); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translate(var(--dx,0px), var(--dy,0px)) rotate(var(--rot,0deg)) scale(1); opacity: 1; }
}

/* gentle float — independent 'translate' so it composes with the drift transform */
@keyframes shard-float{
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -7px; }
}

@media (prefers-reduced-motion: reduce){
  .shard{ animation: none; }
}

/* ---------- puzzle page ---------- */

.puzzle-page{
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 5vh 6vw 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puzzle-title{
  font-family:'Ruthie', cursive;
  font-weight:400;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  color: var(--coral);
  text-shadow: 0 2px 18px rgba(224,122,90,0.15);
}

.puzzle-hint{
  font-family:'Kalam', cursive;
  font-size: 1.05rem;
  color: var(--olive);
  margin: 0.4rem 0 2rem;
  text-align: center;
}

.puzzle-area{
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

.puzzle-board{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  background: rgba(255,255,255,0.35);
  border: 2px dashed rgba(224,122,90,0.5);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(150,100,70,0.15);
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.puzzle-board.solved{
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(224,122,90,0.35), 0 14px 40px rgba(224,122,90,0.4);
}

.slot{
  position: relative;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
}
.slot.over{ background: rgba(240,201,138,0.5); }

.puzzle-tray{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  min-height: 120px;
  align-content: start;
  background: rgba(255,255,255,0.25);
  border: 2px dashed transparent;
  border-radius: 8px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.puzzle-tray.over{
  border-color: rgba(224,122,90,0.6);
  background: rgba(240,201,138,0.3);
}

.piece{
  aspect-ratio: var(--piece-ratio, 1);
  background-repeat: no-repeat;
  border-radius: 3px;
  cursor: grab;
  box-shadow: 0 3px 8px rgba(150,100,70,0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.slot .piece{ width: 100%; height: 100%; box-shadow: none; border-radius: 2px; aspect-ratio: auto; }
.piece:hover{ transform: scale(1.03); }
.piece.dragging{ opacity: 0.5; cursor: grabbing; }
.piece.picked{ outline: 3px solid var(--coral); outline-offset: -3px; }

/* ---------- confetti ---------- */

.confetti-layer{
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.confetti-bit{
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes confetti-fall{
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}

/* ---------- detail page ---------- */

.detail-page{
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 7vh 7vw 10vh;
  transition: filter 0.5s ease;
}
.detail-page.blurred{ filter: blur(9px); pointer-events: none; }

.detail-head{ margin-bottom: 0; }
.detail-eyebrow{
  font-family:'Oxanium', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 0.3rem;
}
.detail-name{
  font-family:'Ruthie', cursive;
  font-weight:400;
  font-size: clamp(3rem, 10vw, 7rem);
  color: var(--coral);
  text-shadow: 0 2px 18px rgba(224,122,90,0.15);
  line-height: 1;
}

.detail-subhead{
  font-family:'Oxanium', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin-bottom: 1rem;
}

/* main visual: art on the left, name (top) + intro (lower) on the right */
.detail-main{
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3vw;
  align-items: stretch;
  margin-bottom: 8vh;
}
.detail-right{
  display: flex;
  flex-direction: column;
  padding: 1vh 0 4vh;
}
.detail-head{
  margin-top: 4vh;
}
.detail-intro{
  max-width: 46ch;
  margin: auto 0;
}
.detail-body p{ margin-bottom: 0.8rem; }

.char-visual{ 
  display: flex; 
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.char-stage{
  position: relative;
  width: min(530px, 92%);
  cursor: pointer;
}
.char-line, .char-color{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.char-color{
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.char-stage:hover .char-color{ opacity: 1; }

.char-zoom{
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.8);
  color: var(--coral-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(150,90,70,0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}
.char-zoom:hover{ background: #fff; transform: scale(1.08); }

.detail-back{
  display: inline-block;
  margin-top: 2rem;
  font-family:'Oxanium', sans-serif;
  color: var(--coral-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--coral-deep);
  padding-bottom: 2px;
}
.detail-back:hover{ color: var(--coral); border-color: var(--coral); }

/* process slideshow */
.process-head{
  font-family:'Ruthie', cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--coral);
  text-align: center;
  margin-bottom: 2rem;
}
.slideshow{
  display: flex;
  align-items: stretch;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}
.slide-stage{
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: rgba(255,255,255,0.4);
  border: 1.5px solid rgba(224,122,90,0.25);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 12px 34px rgba(150,100,70,0.14);
  min-height: 340px;
}
.slide-figure{
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-figure img{
  max-width: 100%;
  max-height: 340px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(150,100,70,0.25);
}
.slide-caption{ align-self: center; }
.step-count{
  font-family:'Oxanium', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--olive);
}
.step-title{
  font-family:'Ruthie', cursive;
  font-weight: 400;
  font-size: 2.2rem;
  color: var(--coral);
  margin: 0.2rem 0 0.8rem;
}
.step-text{
  font-family:'Kalam', cursive;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--coral-deep);
  max-height: 220px;
  overflow-y: auto;
}
.step-text p{ margin-bottom: 0.6rem; }

.slide-nav{
  flex-shrink: 0;
  width: 52px;
  border: none;
  border-radius: 12px;
  background: rgba(224,122,90,0.12);
  color: var(--coral-deep);
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.slide-nav:hover{ background: var(--coral); color: #fff; }

.slide-dots{
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.slide-dot{
  width: 11px; height: 11px;
  border-radius: 50%;
  border: none;
  background: rgba(224,122,90,0.3);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.slide-dot.active{ background: var(--coral); transform: scale(1.25); }

/* zoom popup framed by window asset */
.art-overlay{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(90,60,50,0.4);
  backdrop-filter: blur(3px);
}
.art-overlay.open{ display: flex; animation: art-in 0.4s ease both; }

@keyframes art-in{ from{opacity:0;} to{opacity:1;} }

.art-frame{
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  animation: art-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes art-pop{ 0%{transform:scale(0.8);opacity:0;} 100%{transform:scale(1);opacity:1;} }

.art-img{
  display: block;
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(80,50,45,0.5);
}
.art-close{
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}
.art-close:hover{ background: var(--coral-deep); transform: scale(1.08); }

/* ---------- responsive ---------- */

/* 超小屏幕：320px - 480px */
@media (max-width: 480px){
  #bubble-1{ width: 120px; height: 120px; top: 5vh; right: 5vw; }
  #bubble-2{ width: 60px; height: 60px; }
  #bubble-3{ width: 80px; height: 80px; }
  #bubble-4{ width: 70px; height: 70px; }
  
  .menu-toggle{ top: 1.2rem; left: 1.2rem; width: 36px; height: 30px; }
  .menu-toggle span{ height: 2px; }
  .menu-toggle.is-open span:nth-child(1){ transform: translateY(9px) rotate(45deg); }
  .menu-toggle.is-open span:nth-child(3){ transform: translateY(-9px) rotate(-45deg); }
  
  h1.script{ font-size: clamp(3.2rem, 8vw, 5.4rem); margin-left: 0.8rem; }
  
  .title-row{ 
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }
  
  .logo-frame{ 
    width: 160px; 
    height: 160px;
    margin-left: 0;
  }
  
  .enter-prompt{
    margin-left: 0;
    margin-top: -1rem;
    font-size: 1.05rem;
    justify-content: center;
  }
  
  .hero{ 
    padding: 4vh 4vw 6vh;
    gap: 2rem;
  }
  
  .welcome{ 
    font-size: 1.2rem; 
    max-width: 100%; 
    margin-right: 0;
    align-self: center;
    padding: 0 1rem;
  }
  
  .site-footer{ 
    flex-direction: column; 
    gap: 0.2rem; 
    text-align: center; 
    font-size: 0.95rem;
    padding: 0.8rem 4vw;
  }
  
  .menu-logo{ width: 240px; height: 240px; margin-bottom: 1.5rem; }
  .menu-links{ gap: 1.5rem; }
  .menu-links a{ font-size: 1.8rem; }
  
  .about-page{ padding: 4vh 4vw 14vh; }
  .about-title{ 
    font-size: clamp(3rem, 7vw, 5rem);
    margin-left: 0;
    margin-bottom: 1.5rem;
    text-align: center; 
  }
  .about-text{ 
    font-size: clamp(1.4rem, 2.4vw, 1.95rem);
    line-height: 1.5;
    max-width: 90%;
    margin: 0 auto;
  }
  
  .avatar-wrap{ 
    position: relative;
    width: 160px; 
    bottom: auto;
    right: auto;
    margin: 2rem auto 0;
  }
  
  .gallery-page{ padding: 3vh 3vw 16vh; }
  .gallery-title{ 
    font-size: clamp(3rem, 7vw, 5rem);
    margin-left: 0;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  .shatter-stage{ margin-top: -15vh; }
  
  .puzzle-page{ padding: 3vh 3vw 6vh; }
  .puzzle-title{ font-size: clamp(2.6rem, 6vw, 4.4rem); }
  .puzzle-hint{ font-size: 1rem; }
  .puzzle-area{ gap: 1.5rem; }
  .puzzle-board{ max-width: 85vw; gap: 1px; padding: 4px; }
  .puzzle-tray{ max-width: 85vw; gap: 6px; }
  
  .detail-page{ padding: 4vh 4vw 8vh; }
  .detail-name{ font-size: clamp(3rem, 10vw, 7rem); }
  .detail-main{ 
    grid-template-columns: 1fr;
    gap: 2vw;
  }
  .char-stage{ width: min(100%, 90vw); }
}

@media (max-width: 720px){
  #bubble-1{ width: 200px; height: 200px; }
  #bubble-2{ width: 80px; height: 80px; }
  #bubble-3{ width: 120px; height: 120px; }
  #bubble-4{ width: 110px; height: 110px; }
  .menu-toggle{ top: 1.6rem; left: 1.6rem; width: 34px; height: 28px; }
  .menu-toggle.is-open span:nth-child(1){ transform: translateY(9px) rotate(45deg); }
  .menu-toggle.is-open span:nth-child(3){ transform: translateY(-9px) rotate(-45deg); }
  .title-row{ gap: 1.4rem; }
  .logo-frame{ width: 150px; height:150px; }
  .welcome{ font-size: 1.1rem; max-width: 90%; margin-right: 0; }
  .site-footer{ flex-direction: column; gap: 0.3rem; text-align: center; font-size: 0.95rem; }
  .menu-logo{ width: 240px; height: 240px; }
  .menu-links a{ font-size: 1.7rem; }
  .about-page{ padding: 5vh 6vw 14vh; }
  .avatar-wrap{ 
    position: relative;
    width: 150px; 
    bottom: auto;
    right: auto;
    margin: 3rem auto 0;
  }
  .about-text{ font-size: 1.2rem; }
  .about-title{ 
    margin-left: 0;
    margin-bottom: 2rem;
    text-align: center; 
  }
  .gallery-title{ 
    margin-left: 0;
    margin-bottom: 2rem;
    text-align: center;
  }
  .gallery-page{ padding: 4vh 4vw 16vh; }
  .shatter-stage{ margin-top: -18vh; }
}