/* Super Yang Yang — shared site styles */
:root {
  --paper: #fdf4e1;
  --paper-2: #f8e8c6;
  --card: #fffaf0;
  --ink: #3b2a1e;
  --ink-soft: #6b5646;
  --yellow: #f5b92e;
  --yellow-deep: #e29a12;
  --red: #d8432b;
  --red-deep: #b3301c;
  --blue: #2f5fb3;
  --blue-deep: #22488c;
  --sky: #8ec9f0;
  --green: #4d9c47;
  --purple: #8b6bc4;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(59, 42, 30, .12), 0 14px 30px rgba(59, 42, 30, .12);
  --font-display: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .4em; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253, 244, 225, .92);
  backdrop-filter: blur(8px);
  border-bottom: 3px dashed var(--paper-2);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1;
}
.logo-star {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: var(--yellow); display: grid; place-items: center;
  box-shadow: 0 3px 0 var(--yellow-deep);
}
.logo-star svg { width: 36px; height: 36px; margin-top: -2px; }
.logo small { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--paper-2); }
.nav a.nav-play { background: var(--yellow); box-shadow: 0 3px 0 var(--yellow-deep); }
.nav a.nav-play:hover { background: #ffc947; }
@media (max-width: 640px) {
  .nav a:not(.nav-play) { display: none; }
  .logo { font-size: 1.2rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  padding: 12px 26px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; color: #fff; background: var(--red);
  box-shadow: 0 5px 0 var(--red-deep);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--red-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-deep); }
.btn.yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-deep); }
.btn.yellow:hover { box-shadow: 0 7px 0 var(--yellow-deep); }
.btn.blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-deep); }
.btn.blue:hover { box-shadow: 0 7px 0 var(--blue-deep); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-art {
  position: relative; border-radius: 0 0 40px 40px; overflow: hidden;
  aspect-ratio: 3 / 2; max-height: 78vh; width: 100%;
  container-type: size;
  --fx: .5; --fy: .4;             /* which part of the picture stays in view when cropped */
}
.hero-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(40, 22, 8, .55) 100%);
}
/* The stage always has the picture's 3:2 shape and covers the hero like object-fit: cover,
   so the layers inside can be placed in the picture's own percentages. */
.hero-stage {
  position: absolute;
  width: max(100cqw, 150cqh); height: max(100cqh, 66.6667cqw);
  left: calc((100cqw - max(100cqw, 150cqh)) * var(--fx));
  top: calc((100cqh - max(100cqh, 66.6667cqw)) * var(--fy));
  animation: hero-drift 24s ease-in-out infinite alternate;
}
.hero-bg { width: 100%; height: 100%; }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-fx .tw { fill: #fffbe0; opacity: 0; transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; filter: drop-shadow(0 0 6px #ffe27a); }
.hero-fx .sun { transform-box: fill-box; transform-origin: center; animation: sun-glow 5s ease-in-out infinite alternate; }
.hero-fx .dust { fill: #fff3b0; opacity: 0; animation: dust 2.4s ease-out infinite; }
.hero-yy {
  position: absolute; left: 41.667%; top: 9.18%; width: 37.044%;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 45% 60%;
  animation: yy-float 3.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.hero-yy img { width: 100%; height: auto; animation: yy-in 1.2s cubic-bezier(.2,.9,.3,1.15) both; filter: drop-shadow(0 12px 14px rgba(40, 60, 120, .25)); }
.hero-yy.ready img { animation: none; }            /* entrance done; don't replay it */
.hero-yy.ready.loop img { animation: yy-loop 1.3s ease-in-out; }
.hero-yy:focus-visible { outline: 4px solid #fff; outline-offset: 6px; border-radius: 30px; }

@keyframes yy-float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(.8%, -3.4%) rotate(-2.5deg); }
}
@keyframes yy-in {
  from { transform: translate(-7%, 9%) scale(.9) rotate(4deg); }
  to { transform: none; }
}
@keyframes yy-loop {
  0% { transform: none; }
  25% { transform: translate(6%, -8%) rotate(-50deg) scale(1.03); }
  55% { transform: translate(-6%, -10%) rotate(-200deg) scale(1.05); }
  80% { transform: translate(-3%, -3%) rotate(-320deg); }
  100% { transform: rotate(-360deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes sun-glow {
  from { opacity: .55; transform: scale(.9); }
  to { opacity: 1; transform: scale(1.12); }
}
@keyframes dust {
  0% { opacity: 0; transform: translate(0, 0); }
  20% { opacity: .95; }
  100% { opacity: 0; transform: translate(-110px, 30px); }
}
@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0 0 clamp(20px, 5vw, 56px);
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.35);
  pointer-events: none;
}
.hero-copy a { pointer-events: auto; }
.hero-copy h1 { font-size: clamp(2.6rem, 8vw, 5.6rem); margin-bottom: .1em; }
.hero-copy p { font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 700; max-width: 34ch; }
.hero-copy .btn { text-shadow: none; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hero-art { aspect-ratio: 4 / 5; border-radius: 0 0 28px 28px; --fx: .62; --fy: .5; }
}

/* ---------- sections ---------- */
section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 6px;
}

/* games feature */
.game-feature {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center;
  background: var(--card); border-radius: 32px; padding: clamp(18px, 3vw, 36px); box-shadow: var(--shadow);
}
.game-feature .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-feature .pair img { border-radius: 14px; aspect-ratio: 3/2; object-fit: cover; }
.game-feature ul { padding-left: 1.1em; margin: 0 0 1.2em; }
.game-feature li { margin-bottom: .3em; }
.more-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.game-card {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(160px, 300px) 1fr; gap: 18px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); transition: transform .15s ease;
}
.game-card:hover { transform: translateY(-3px); }
.game-card img { border-radius: 14px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.game-card b { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; margin: 2px 0 6px; }
.game-card > span { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 560px) { .game-card { grid-template-columns: 1fr; } }
.soon {
  border: 3px dashed var(--paper-2); border-radius: var(--radius); padding: 18px 20px;
  color: var(--ink-soft); font-weight: 700; display: flex; align-items: center; gap: 12px;
}
.soon span { font-size: 1.8rem; }
@media (max-width: 800px) { .game-feature { grid-template-columns: 1fr; } }

/* family */
.band { background: var(--paper-2); }
.family {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(4px, 2vw, 22px);
  max-width: 800px; margin: 0 auto 20px;
}
/* flex-grow is proportional to each figure's width at a shared scale, so heights stay true to life */
.family figure { margin: 0; text-align: center; flex: var(--g) 1 0; min-width: 0; }
.family img { width: 100%; height: auto; }
.family figcaption { font-family: var(--font-display); font-weight: 800; font-size: clamp(.8rem, 2.4vw, 1.35rem); line-height: 1.1; margin-top: 6px; }
.family figcaption small { display: block; font-family: var(--font-body); font-size: .7em; font-weight: 700; color: var(--ink-soft); }
.fam-yy { --g: 147; } .fam-dd { --g: 126; } .fam-nn { --g: 132; } .fam-mm { --g: 133; } .fam-bb { --g: 165; }

.friends { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.friend { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.friend img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.friend div { padding: 12px 16px 16px; }
.friend h3 { font-size: 1.35rem; margin: 0; }
.friend p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 800px) { .friends { grid-template-columns: repeat(2, 1fr); } }

/* books */
.books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.book { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.book img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.book div { padding: 14px 18px 20px; }
.book .num { font-family: var(--font-display); font-weight: 800; color: var(--red); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }
.book h3 { font-size: 1.35rem; margin: 2px 0 6px; }
.book p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 980px) { .books { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .books, .friends { grid-template-columns: 1fr 1fr; gap: 12px; } .book div, .friend div { padding: 10px 12px 14px; } .book p { display: none; } }

/* footer */
.site-footer { background: var(--ink); color: #f4e6cc; padding: 36px 0; font-size: .95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #ffd66b; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
