*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1ede9;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Announcement banner — ticker tape ── */
#announcement-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  background: #5c3317;
  color: #fdf5ee;
  overflow: hidden;
  padding: 0.85rem 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

#announcement-banner[hidden] { display: none; }

#announcement-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 28s linear infinite;
}

#announcement-banner:hover #announcement-track {
  animation-play-state: paused;
}

.ticker-item {
  flex: 0 0 auto;
  padding-left: 1rem;
  font-size: 1rem;
  line-height: 1.5;
}

.ticker-item::after {
  content: '🍵';
  margin: 0 2.5rem;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--ticker-item-width, 50%))); }
}


body.has-announcement .lang-switch {
  top: calc(3.5rem + 1rem);
}

/* ── Scene container ── */
.scene {
  position: relative;
  width: min(90vw, 130vh);
  aspect-ratio: 3 / 2;
  overflow: visible;
}

/* ── Layer 0: Background (room, scrolls, shelf, table, tray, planter) ── */
.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ── Layer 1: Bear ── */
.bear-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bear-body {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 90%;
  aspect-ratio: 3 / 2;
  transform-origin: 50% 90%;
}

.scene-bear-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.scene-bear-hotspot {
  position: absolute;
  left: 28%;
  top: 10%;
  width: 40%;
  height: 82%;
  pointer-events: all;
  cursor: pointer;
}

/* Bear sway on hover */
.bear-wrapper:has(.scene-bear-hotspot:hover) .bear-body {
  animation: bearFloat 2s ease-in-out infinite;
}

@keyframes bearFloat {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-1.5deg); }
  75%       { transform: rotate(2deg); }
}

/* ── Bear eyes (pupils track cursor) ── */
/* Tune left/top on each eye to align with the bear's drawn eyes */
.bear-eye {
  position: absolute;
  width: 4%;
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.bear-eye-left  { left: 44.9%; top: 23.9%; }
.bear-eye-right { left: 54.4%; top: 23.9%; }

.bear-pupil {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 90%;
  aspect-ratio: 1;
  background: #000;
  border-radius: 50%;
  transition: transform 0.08s ease-out;
}

/* ── Layer 2: Table (full-canvas, same 1536×1024, in front of bear) ── */
.table-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.scene-table-img {
  position: absolute;
  top: 36%;   /* ← increase % to push table further down */
  left: 6%;
  width: 86%;
  height: 86%;
  pointer-events: none;
  user-select: none;
}

/* ── Layer 3: Teapot (clickable — pours tea) ── */
.scene-teapot {
  position: absolute;
  left: 40%;
  top: 57%;
  width: 18%;
  pointer-events: auto;
  user-select: none;
  z-index: 3;
  cursor: pointer;
  transform-origin: 72% 55%;
  transition: transform 0.3s ease;
}

.scene-teapot.pouring {
  animation: teapotTilt 2.2s ease-in-out forwards;
  pointer-events: none;
  cursor: default;
}

@keyframes teapotTilt {
  0%   { transform: translateY(0)    rotate(0deg); }
  15%  { transform: translateY(-22%) rotate(0deg); }
  28%  { transform: translateY(-22%) rotate(-32deg); }
  72%  { transform: translateY(-22%) rotate(-32deg); }
  87%  { transform: translateY(-22%) rotate(0deg); }
  100% { transform: translateY(0)    rotate(0deg); }
}


.scene-teapot-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* Spout steam — adjust left/top to sit at spout tip */
.teapot-steam {
  position: absolute;
  left: 10%;
  top: 28%;
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.teapot-wisp {
  width: 5px;
  height: 22px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  filter: blur(2.5px);
  opacity: 0;
  animation: teapotSteam 2.8s ease-in-out infinite;
}

.teapot-wisp:nth-child(2) { animation-delay: 0.9s; width: 4px; }
.teapot-wisp:nth-child(3) { animation-delay: 1.8s; }

@keyframes teapotSteam {
  0%   { opacity: 0;    transform: translateY(0)     translateX(0); }
  15%  { opacity: 0.85; transform: translateY(-10px) translateX(-2px); }
  45%  { opacity: 0.55; transform: translateY(-26px) translateX(2px); }
  75%  { opacity: 0.2;  transform: translateY(-42px) translateX(-1px); }
  100% { opacity: 0;    transform: translateY(-55px) translateX(0); }
}

/* ── Interactive scene elements ── */
.scene-el {
  position: absolute;
  display: block;
  text-decoration: none;
  cursor: pointer;
  overflow: visible;
}

.scene-el img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* ── Layer 4: Teacup (on tray, LEFT of teapot) ── */
.scene-teacup {
  left: 36%;
  top: 70%;
  width: 9%;
  overflow: visible;
  z-index: 4;
  transform-origin: 50% 100%;
}

.scene-teacup:hover {
  animation: teacupFloat 1.6s ease-in-out infinite;
}

@keyframes teacupFloat {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-2deg); }
  75%       { transform: rotate(2.5deg); }
}

/* ── Steam (always on, above teacup) ── */
.steam {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  pointer-events: none;
  z-index: 3;
}

.steam-wisp {
  width: 6px;
  height: 28px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  filter: blur(3px);
  opacity: 0;
  animation: steamRise 2.4s ease-in-out infinite;
}

.steam-wisp:nth-child(2) { animation-delay: 0.8s; width: 5px; }
.steam-wisp:nth-child(3) { animation-delay: 1.6s; }

@keyframes steamRise {
  0%   { opacity: 0;    transform: translateY(0)      translateX(0); }
  15%  { opacity: 0.9;  transform: translateY(-14px)  translateX(2px); }
  45%  { opacity: 0.65; transform: translateY(-36px)  translateX(-3px); }
  75%  { opacity: 0.3;  transform: translateY(-58px)  translateX(2px); }
  100% { opacity: 0;    transform: translateY(-76px)  translateX(0); }
}

/* ── Layer 5: Camellia (stem anchored to blue pot in bg) ── */
/* Pot rim at scene x≈83.7%, y≈62.5%. Stem base at ~50%x, ~97%y in own canvas.
   Solving for stem to land at pot: W=31%, top=2%, left=68%.
   Stem-x: 68%+0.50×31%=83.5% ✓  Stem-y: 2%+0.974×(31%×1.5×1445/1088)=62.2% ✓ */
.scene-camellia {
  left: 69%;
  top: 12%;
  width: 31%;
  transform-origin: 50% 97%;
  transform: scale(0.75);
  transition: transform 0.4s ease-out;
  z-index: 5;
}

.scene-camellia:hover {
  /* grow once, then sway indefinitely */
  animation:
    camelliaGrow 0.4s ease-out forwards,
    camelliaSway 2.2s 0.4s ease-in-out infinite;
}

@keyframes camelliaGrow {
  from { transform: scale(0.75) rotate(0deg); }
  to   { transform: scale(1)    rotate(0deg); }
}

@keyframes camelliaSway {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%       { transform: scale(1) rotate(-2deg); }
  75%       { transform: scale(1) rotate(2.5deg); }
}

/* ── Layer 6: Logo (top-left UI element, always in front) ── */
.scene-businesscard {
  left: 15%;
  top: 63%;
  width: 14%;
  z-index: 4;
  transform: rotate(-2deg);
  cursor: pointer;
  transition: transform 0.25s ease;
}

.scene-businesscard:hover {
  transform: rotate(-1deg) translateY(-3%);
}

.scene-businesscard img {
  width: 100%;
  display: block;
}


/* ── Language switcher ── */
.lang-switch {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 20;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5a5248;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* ── Footer ── */
.site-footer {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.7rem;
  color: #b0a898;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 10;
}

.footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: all;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #1a1a1a;
}

/* ── Overlay ── */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#overlay.active {
  opacity: 1;
  pointer-events: all;
}

#overlay-panel {
  position: relative;
  width: 90%;
  height: 90%;
  border-radius: 20px;
  overflow: hidden;
  transform: translateY(32px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

#overlay.active #overlay-panel {
  transform: translateY(0) scale(1);
}

#overlay-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

#overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#overlay-close:hover {
  background: rgba(0, 0, 0, 0.55);
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
  .ticker-item {
    font-size: 0.88rem;
  }

  body.has-announcement .lang-switch {
    top: calc(4.5rem + 0.75rem);
  }

  .scene {
    width: 98vw;
  }

  .lang-switch {
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    top: 1rem;
    right: 1rem;
  }

  #overlay-panel {
    width: 96%;
    height: 92%;
    border-radius: 14px;
  }
}
