:root {
  --cream: #fff8ee;
  --ink: #432d2b;
  --muted: #80625c;
  --pink: #e98c91;
  --pink-deep: #c96572;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
}

.room-hero {
  width: 100%;
  background: #c98b76;
}

.room-scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: min(760px, 72vw);
  overflow: hidden;
  background: url("../assets/images/room-bg.webp") center center / cover no-repeat;
}

.room-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(62, 35, 30, 0.08), transparent 28%, rgba(62, 35, 30, 0.06));
  pointer-events: none;
}

.hero-brand {
  position: absolute;
  z-index: 5;
  top: clamp(22px, 4vw, 58px);
  left: 50%;
  width: min(460px, 42vw);
  transform: translateX(-50%);
  text-align: center;
  color: #4a2416;
  text-shadow: 0 1px 1px rgba(255, 249, 236, 0.3);
}

.hero-brand h1 {
  margin: 0;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.55rem, 3.7vw, 3.2rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-title-arc {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: inherit;
  font-family: inherit;
  font-size: 45px;
  font-weight: 1000;
  letter-spacing: -0.08em;
  text-shadow: 1px 3px 4px rgba(255, 249, 236, 0.923);
}

.hero-title-mobile {
  display: none;
}

.hero-title-arc text {
  fill: currentColor;
}

.hero-title-logo {
  x: calc(50% - 44px);
  y: 80px;
  width: 88px;
  height: 88px;
  overflow: visible;
}

.hero-subtitle {
  position: absolute;
  z-index: 5;
  left: 50%;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.78rem, 1.15vw, 1rem);
  letter-spacing: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.game-character,
.game-hotspot {
  position: absolute;
}

.main-character {
    z-index: 2;
  left: 50%;
    top: 52%;
    width: clamp(176px, 25vw, 385px);
  transform: translate(-50%, -50%);
}

.main-cat {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
}

.main-cat-closed {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.main-character:hover .main-cat:not(.main-cat-closed),
.main-character:focus-within .main-cat:not(.main-cat-closed) {
  opacity: 0;
}

.main-character:hover .main-cat-closed,
.main-character:focus-within .main-cat-closed {
  opacity: 1;
}

.main-cat-pupils {
  --left-eye-x: 56.8%;
  --left-eye-y: 44%;
  --right-eye-x: 74.7%;
  --right-eye-y: 56%;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pupil-socket {
  position: absolute;
  width: 13%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.pupil-left { left: var(--left-eye-x); top: var(--left-eye-y); }
.pupil-right { left: var(--right-eye-x); top: var(--right-eye-y); }

.pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 64%;
  border-radius: 50%;
  background: #101015;
  transform: translate(calc(-50% + var(--pupil-x, 0px)), calc(-50% + var(--pupil-y, 0px)));
  transition: transform 180ms ease-out;
}

.pupil-highlight {
  position: absolute;
  top: 16%;
  left: 20%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.main-cat-tail {
  position: absolute;
  z-index: 1;
  top: -5%;
  left: -10%;
  width: 48%;
  transform-origin: 60% 90%;;
  animation: tail-sway 7s ease-in-out infinite;
}

@keyframes tail-sway {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(0deg); }
  70% { transform: rotate(30deg); }
  100% { transform: rotate(0deg); }
}

.memory-hotspot {
    z-index: 5;
  left: 20%;
    top: 76%;
    width: clamp(112px, 16vw, 232px);
  min-height: 136px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  text-decoration: none;
}

.three-min-hotspot {
  z-index: 5;
  left: 80%;
  top: 76%;
  width: clamp(112px, 16vw, 232px);
  min-height: 136px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  text-decoration: none;
}

.three-min-state {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  transition: opacity 300ms ease-in-out;
}

.three-min-hotspot .game-label {
  width: max-content;
  max-width: 160px;
  font-size: clamp(0.65rem, 1vw, 0.86rem);
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.basket-hotspot {
  z-index: 5;
  left: 60%;
  top: 84%;
  width: clamp(112px, 16vw, 232px);
  min-height: 136px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  text-decoration: none;
}

.basket-state {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
}

.basket-default { opacity: 1; }
.basket-wave { opacity: 0; }

.basket-hotspot:hover .basket-default,
.basket-hotspot:focus-visible .basket-default { opacity: 0; }

.basket-hotspot:hover .basket-wave,
.basket-hotspot:focus-visible .basket-wave {
  opacity: 1;
  animation: basket-wave-impact 300ms ease-out;
}

.basket-hotspot .game-label {
  bottom: 8px;
}

.lines-basket-hotspot {
  z-index: 5;
  left: 40%;
  top: 84%;
  width: clamp(112px, 16vw, 232px);
  min-height: 136px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  text-decoration: none;
}

.lines-basket-hotspot .game-label {
  bottom: -25px;
}

.lines-basket-state {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  transition: opacity 300ms ease-in-out;
}

.lines-basket-default { opacity: 1; }
.lines-basket-catch { opacity: 0; }

.lines-basket-hotspot:hover .lines-basket-default,
.lines-basket-hotspot:focus-visible .lines-basket-default { opacity: 0; }

.lines-basket-hotspot:hover .lines-basket-catch,
.lines-basket-hotspot:focus-visible .lines-basket-catch {
  opacity: 1;
  animation: lines-basket-catch-impact 300ms ease-out;
}

@keyframes lines-basket-catch-impact {
  0% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes basket-wave-impact {
  0% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.three-min-default { opacity: 1; }
.three-min-splash { opacity: 0; }

.three-min-hotspot:hover .three-min-default,
.three-min-hotspot:focus-visible .three-min-default { opacity: 0; }

.three-min-hotspot:hover .three-min-splash,
.three-min-hotspot:focus-visible .three-min-splash {
  opacity: 1;
  animation: three-min-splash-impact 300ms ease-out;
}

@keyframes three-min-splash-impact {
  0% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.memory-cat,
.memory-tile-wrapper,
.game-label { position: absolute; transition: transform 360ms ease; }

.memory-cat { z-index: 2; bottom: 0; left: 0; width: 100%; }

.memory-tile-wrapper {
  z-index: 3;
  right: 15%;
  bottom: 3%;
  width: 28%;
  animation: none;
}

.memory-tile {
  display: block;
  width: 100%;
  transform: rotate(8deg);
}

.game-label {
  z-index: 4;
  left: 50%;
  right: auto;
  top: auto;
  bottom: -8px;
  padding: 7px 14px 8px;
  border: 1px solid rgba(111, 72, 64, 0.12);
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.94);
  box-shadow: 0 5px 14px rgba(84, 45, 39, 0.14);
  font-size: clamp(0.78rem, 1.2vw, 1rem);
  font-weight: 700;
  transform: translateX(-50%);
}

.memory-hotspot:hover .memory-cat,
.memory-hotspot:focus-visible .memory-cat { transform: translateY(-8px); }

.memory-hotspot:hover .memory-tile-wrapper,
.memory-hotspot:focus-visible .memory-tile-wrapper {
  animation: memory-tile-toss 780ms ease-in-out;
}

@keyframes memory-tile-toss {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-112px) rotate(5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.memory-hotspot:hover .game-label,
.memory-hotspot:focus-visible .game-label { transform: translate(-50%, -6px); }

.room-scene:has(.memory-hotspot:hover) .main-cat-tail,
.room-scene:has(.memory-hotspot:focus-visible) .main-cat-tail { animation-duration: 2.8s; }

.promise {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 48px);
  padding: clamp(28px, 1vw, 56px) max(24px, 6vw);
  background: var(--cream);
}

.promise-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.promise-icon {
  flex: 0 0 auto;
  color: var(--pink-deep);
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.promise-leaf { font-size: 2.15rem; }

.promise h2 {
  margin: 0 0 6px;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  line-height: 1.1;
}

.promise p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.1vw, 0.98rem);
  line-height: 1.35;
}

.homepage-about {
  border-top: 1px solid rgba(111, 72, 64, 0.12);
  background: #fff8ee;
}

.homepage-about-inner {
  width: min(100% - 48px, 820px);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 76px) 0 clamp(48px, 7vw, 88px);
}

.homepage-about h2 {
  max-width: 690px;
  margin: 0 0 24px;
  color: #4a2416;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.homepage-about p {
  margin: 0 0 18px;
  color: #684843;
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  line-height: 1.7;
}

.homepage-about p:last-child { margin-bottom: 0; }

.homepage-about strong { color: var(--ink); }

.site-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 26px 24px 28px;
  border-top: 1px solid rgba(111, 72, 64, 0.14);
  background: #fff8ee;
  color: #684843;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
}

.site-footer-nav,
.site-footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 16px;
}

.site-footer a {
  color: #6a3e3b;
  font-weight: 700;
  text-decoration-color: rgba(201, 101, 114, 0.55);
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible { color: #b45160; }

.site-footer p { margin: 0; color: #80625c; }

@media (max-width: 900px) {
  .room-scene { min-height: 720px; background-position: 50% center; }
  .hero-brand { width: min(390px, 72vw); }
  .hero-title-desktop { display: none; }
  .hero-title-mobile { display: block; }
  .hero-title-mobile .hero-title-logo {
    x: calc(50% - 33px);
    y: 110px;
    width: 90px;
    height: 90px;
  }
  .main-character { left: 56%; top: 55%; width: 37vw; }
  .memory-hotspot { left: 20%; top: 76%; width: 22vw; }
  .lines-basket-hotspot { left: 40%; top: 84%; width: 22vw; }
  .basket-hotspot { left: 60%; top: 84%; width: 22vw; }
  .three-min-hotspot { left: 80%; top: 76%; width: 22vw; }
  .promise { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .room-scene { min-height: 640px; background-position: 54% center; }
  .hero-brand { top: 18px; width: 88vw; }
  .hero-brand h1 { font-size: 1.65rem; }
  .hero-subtitle { font-size: 0.82rem; text-shadow: 1px 1px 1px #fff; }
  .main-character { left: 57%; top: 55%; width: 51vw; }
  .memory-hotspot { left: 16%; top: 68%; width: 26vw; min-height: 100px; }
  .lines-basket-hotspot { left: 36%; top: 86%; width: 26vw; min-height: 100px; }
  .basket-hotspot { left: 64%; top: 86%; width: 26vw; min-height: 100px; }
  .three-min-hotspot { left: 82%; top: 68%; width: 26vw; min-height: 100px; }
  .game-label { padding: 6px 11px; }
  .promise { grid-template-columns: 1fr; gap: 22px; padding: 30px 24px 36px; }
  .homepage-about-inner { width: min(100% - 40px, 820px); }
  .homepage-about h2 { margin-bottom: 20px; }
  .homepage-about p { line-height: 1.62; }
}

@media (max-width: 560px) {
  .site-footer { padding: 24px 20px; }
  .site-footer-nav, .site-footer-meta { flex-direction: column; gap: 9px; }
}
