/* Muggle Zoo Motion Lab — layout & UI. Palette from 米思行銷 mismkt.com brand sheet. */
:root {
  --blue: #004AAD; --blue-d: #003380; --slate: #6A7E97;
  --bg: #F8F7F2; --bg2: #EDEDED; --beige: #ECE1CE; --grey: #BFBFBF;
  --yellow: #F5C842; --ink: #282828; --sub: #666;
  --navy: #14213D; --red: #E5483B; --green: #2FA84F;
  --r: 8px; --gap: 20px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--blue); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

/* language visibility */
html[data-lang="zh"] .en, html[data-lang="en"] .zh { display: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r); z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(248, 247, 242, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(40, 40, 40, .08); }
.top__inner { max-width: 1440px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 32px; width: auto; }
.brand__txt { font: 600 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding-left: 10px; border-left: 1px solid var(--grey); }
.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; color: var(--ink); font-size: 14px; padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
.cats a:hover { background: var(--bg2); }
.cats__r { font: 12px var(--mono); color: var(--sub); }
.ctrls { display: flex; gap: 10px; align-items: center; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: 14px; cursor: pointer; transition: background .2s, transform .2s; }
.pill:hover { background: var(--blue); }
.pill:active { transform: scale(.97); }
.pill--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--grey); }
.pill--ghost:hover { background: var(--bg2); }
.pill .ico { width: 10px; height: 12px; display: inline-block; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.pill.is-paused .ico { border: 0; width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }


/* ---------- particle hero (from Mi's muggle-zoo-hero-refined) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mzh { --mx: 50%; --my: 45%; position: relative; max-width: 1392px; margin: 20px auto 0; height: clamp(380px, 46vw, 600px); overflow: hidden; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .11); color: #f8f3e7; isolation: isolate; touch-action: pan-y; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(55% 45% at var(--mx) var(--my), rgba(242, 199, 92, .08), transparent 72%), radial-gradient(100% 80% at 50% 8%, #1a2d55 0%, #0d1830 48%, #050914 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .06); }
.mzh__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mzh__grid, .mzh__glow, .mzh__frame { position: absolute; inset: 0; pointer-events: none; }
.mzh__grid { z-index: 1; opacity: .1; background-image: linear-gradient(rgba(183, 201, 237, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(183, 201, 237, .08) 1px, transparent 1px); background-size: 72px 72px; -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%); }
.mzh__glow { z-index: 1; opacity: 0; transition: opacity .45s; background: radial-gradient(220px circle at var(--mx) var(--my), rgba(255, 218, 120, .13), transparent 72%); }
.mzh:hover .mzh__glow { opacity: 1; }
.mzh::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to bottom, rgba(3, 7, 15, .05) 46%, rgba(3, 7, 15, .78) 100%), radial-gradient(92% 74% at 50% 40%, transparent 48%, rgba(3, 7, 15, .6) 100%); }
.mzh__frame { z-index: 5; inset: 12px; border: 1px solid rgba(255, 255, 255, .055); border-radius: 13px; }
.mzh__frame::before, .mzh__frame::after { content: ""; position: absolute; width: 46px; height: 46px; border-color: rgba(242, 199, 92, .52); }
.mzh__frame::before { left: -1px; top: -1px; border-left: 1px solid; border-top: 1px solid; border-radius: 14px 0 0; }
.mzh__frame::after { right: -1px; bottom: -1px; border-right: 1px solid; border-bottom: 1px solid; border-radius: 0 0 14px; }
.mzh__brand { position: absolute; z-index: 6; top: 26px; left: 30px; margin: 0; display: flex; align-items: center; gap: 12px; font: 700 11px/1 var(--font); letter-spacing: .22em; }
.mzh__dot { width: 9px; height: 9px; border-radius: 50%; background: #f2c75c; box-shadow: 0 0 20px rgba(242, 199, 92, .9); }
.mzh__replay { position: absolute; top: 20px; right: 26px; z-index: 7; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(240, 192, 64, .3); background: rgba(7, 14, 29, .45); color: #f2c75c; font-size: 16px; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .6s, background .2s, transform .3s; }
.mzh.is-ready .mzh__replay { opacity: 1; }
.mzh__replay:hover { background: rgba(240, 192, 64, .16); transform: rotate(-35deg) scale(1.05); }
.mzh__overlay { position: absolute; inset: 0; z-index: 4; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding: 0 24px 48px; }
.mzh__eyebrow { margin: 0; color: #f2c75c; font: 700 11px/1 var(--mono); letter-spacing: .34em; text-transform: uppercase; text-shadow: 0 0 18px rgba(240, 192, 64, .35); opacity: 0; transform: translateY(10px); transition: opacity 1.1s ease .2s, transform 1.1s ease .2s; }
.mzh__title { margin: 12px 0 0; opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease .42s, transform 1.2s ease .42s; }
.mzh__t1 { display: block; font-size: clamp(26px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: rgba(248, 243, 231, .97); }
.mzh__t2 { display: block; margin-top: 8px; font-size: clamp(14px, 1.5vw, 19px); font-weight: 600; letter-spacing: .08em; color: rgba(248, 243, 231, .78); }
.mzh__sub { margin: 10px 0 0; font-size: clamp(12px, 1.1vw, 14px); letter-spacing: .06em; color: rgba(244, 241, 234, .6); opacity: 0; transition: opacity 1.3s ease .7s; }
.mzh__hint { position: absolute; z-index: 6; left: 30px; bottom: 26px; margin: 0; display: flex; align-items: center; gap: 10px; color: rgba(174, 191, 224, .55); font: 500 10px/1 var(--font); letter-spacing: .13em; opacity: 0; transition: opacity 1.4s ease 1.1s; }
.mzh__hint::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, #f2c75c, transparent); }
.mzh.is-ready .mzh__eyebrow, .mzh.is-ready .mzh__title { opacity: 1; transform: none; }
.mzh.is-ready .mzh__sub, .mzh.is-ready .mzh__hint { opacity: 1; }
@media (max-width: 860px) {
  .mzh { margin: 12px 14px 0; height: clamp(420px, 122vw, 560px); border-radius: 14px; }
  .mzh__eyebrow { font-size: 9px; letter-spacing: .22em; }
  .mzh__t1 { font-size: 26px; }
  .mzh__t2 { font-size: 13px; letter-spacing: .04em; }
  .stats { gap: 18px; }
  .stats dt { font-size: 26px; }
  .mzh__brand { top: 24px; left: 24px; font-size: 9px; letter-spacing: .16em; }
  .mzh__replay { top: 16px; right: 18px; }
  .mzh__overlay { padding-bottom: 60px; }
  .mzh__hint { left: 24px; bottom: 26px; font-size: 9px; }
  .mzh__grid { background-size: 52px 52px; }
}
@media (min-width: 861px) { .mzh { width: calc(100% - 48px); } }
@media (prefers-reduced-motion: reduce) { .mzh__eyebrow, .mzh__title, .mzh__sub, .mzh__hint, .mzh__replay { transition: opacity .4s; transform: none; } }

/* ---------- hero ---------- */
.hero { max-width: 1440px; margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; }
.eyebrow { font: 600 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin: 0 0 18px; }
.hero h1 { margin: 0; }
.h1-a { display: block; font-size: clamp(44px, 7vw, 104px); line-height: .95; font-weight: 800; letter-spacing: -.035em; }
.h1-b { display: block; margin-top: 18px; font-size: clamp(18px, 2vw, 26px); font-weight: 600; color: var(--slate); letter-spacing: .02em; }
.lede { max-width: 620px; font-size: 18px; color: #444; margin: 22px 0 28px; }
.stats { display: flex; gap: 36px; margin: 0; flex-wrap: wrap; }
.stats div { border-left: 4px solid var(--yellow); padding-left: 12px; }
.stats dt { font: 700 34px/1 var(--font); letter-spacing: -.02em; }
.stats dd { margin: 6px 0 0; font-size: 13px; color: var(--sub); }
.hero__cast { position: relative; height: 380px; }
.hero__cast .c { position: absolute; bottom: 0; filter: drop-shadow(0 10px 14px rgba(20, 33, 61, .18)); animation: castBob 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
/* back row: wolf, fox, elephant, dog — front row: SmallBlue, Grandma, Cuckoo (faces never covered) */
.hero__cast .c1 { left: 0; width: 23%; bottom: 47%; animation-delay: -.4s; }
.hero__cast .c2 { left: 24%; width: 22%; bottom: 52%; animation-delay: -1.2s; }
.hero__cast .c4 { left: 52%; width: 23%; bottom: 52%; animation-delay: -.8s; }
.hero__cast .c6 { right: 0; width: 22%; bottom: 47%; animation-delay: -2.6s; }
.hero__cast .c5 { left: 2%; width: 22%; bottom: 0; z-index: 2; animation-delay: -1.6s; }
.hero__cast .c3 { left: 30%; width: 36%; bottom: 0; z-index: 3; animation-delay: -2s; }
.hero__cast .c7 { right: 2%; width: 25%; bottom: 0; z-index: 2; animation-delay: -3s; }
@keyframes castBob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
body.all-paused .hero__cast .c { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hero__cast .c { animation: none; } }

.motion-note { max-width: 1392px; margin: 0 auto 10px; padding: 12px 16px; background: var(--beige); border-left: 4px solid var(--yellow); border-radius: var(--r); font-size: 14px; }

/* ---------- sections ---------- */
main { max-width: 1440px; margin: 0 auto; padding: 0 24px 80px; }
.sec { padding-top: 56px; }
.sec__head { display: grid; grid-template-columns: 120px 1fr; column-gap: 24px; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 18px; margin-bottom: 24px; }
.sec__range { grid-row: span 2; margin: 0; font: 700 28px/1 var(--mono); color: var(--blue); }
.sec h2 { margin: 0; font-size: 28px; line-height: 1.2; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.sec h2 .t-en { font-size: 18px; font-weight: 500; color: var(--slate); }
.sec__desc { margin: 6px 0 0; color: var(--sub); font-size: 15px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 1180px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero__cast { height: 220px; }
  .sec__head { grid-template-columns: 1fr; }
  .sec__range { grid-row: auto; font-size: 20px; margin-bottom: 6px; }
  .top__inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; }
  .cats { order: 3; flex-basis: 100%; }
  .ctrls { margin-left: auto; }
  main, .hero { padding-left: 14px; padding-right: 14px; }
}

/* ---------- card ---------- */
.card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 1px rgba(40, 40, 40, .06); display: flex; flex-direction: column; transition: box-shadow .25s, transform .25s; }
.card:hover { box-shadow: 0 10px 30px rgba(20, 33, 61, .12), 0 0 0 1px rgba(40, 40, 40, .08); transform: translateY(-2px); }
@media (min-width: 861px) { .card--feat { grid-column: span 2; } }
.card__frame { position: relative; }
.card__ctl { display: inline-flex; gap: 4px; margin-left: 4px; }
.ib { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--bg2); color: var(--ink); cursor: pointer; display: grid; place-items: center; position: relative; transition: background .2s, color .2s, transform .15s; }
.ib:hover { background: var(--blue); color: #fff; }
.ib:active { transform: scale(.92); }
.ib::before { content: ""; display: block; }
.ib--play::before { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; margin-left: 2px; }
.ib--play[aria-pressed="true"]::before { width: 9px; height: 11px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; margin: 0; }
.ib--replay::before { width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.ib--replay::after { content: ""; position: absolute; top: 8px; right: 8px; border-left: 4px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transform: rotate(45deg); }
.ib--expand::before { width: 11px; height: 11px; border: 2px solid currentColor; border-radius: 2px; }

.card__meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__line { margin: 0; display: flex; gap: 8px; align-items: center; font: 12px var(--mono); color: var(--sub); }
.num { font-weight: 700; color: var(--blue); font-size: 13px; }
.mode { white-space: nowrap; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--ink); font-family: var(--font); font-size: 11px; }
.mode--hover { background: #DDE8F7; } .mode--click { background: #FCEFC3; }
.dur { margin-left: auto; }
.card h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; display: flex; flex-direction: column; }
.card h3 .t-en { font-size: 13px; font-weight: 500; color: var(--slate); }
.card__desc { margin: 4px 0 0; font-size: 14px; color: #555; line-height: 1.55; }
.tags { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.tags li { font: 11px var(--mono); padding: 2px 7px; border-radius: 4px; background: var(--bg); color: var(--sub); }
@media (max-width: 560px) {
  .card__meta { padding: 10px 10px 12px; }
  .card__desc { display: none; }
  .card h3 { font-size: 15px; }
  .tags { display: none; }
  .card__line { flex-wrap: wrap; row-gap: 8px; }
  .dur { margin-left: auto; }
  .card__ctl { order: 9; flex-basis: 100%; margin-left: 0; gap: 8px; }
  .ib { width: 34px; height: 34px; }
}

/* ---------- lightbox ---------- */
.lb { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); width: 100%; max-height: 96vh; max-height: 96dvh; overflow: hidden; }
.lb::backdrop { background: rgba(14, 18, 30, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lb__box { position: relative; background: #fff; border-radius: 14px; overflow: auto; max-height: 96vh; max-height: 96dvh; display: grid; grid-template-columns: 1fr; }
.lb__x { position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.lb__x:hover { background: var(--yellow); }
.lb__meta { padding: 18px 22px 22px; }
.lb__num { margin: 0; font: 13px var(--mono); color: var(--blue); }
.lb h2 { margin: 6px 0 8px; font-size: 24px; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.lb h2 .t-en { font-size: 16px; color: var(--slate); font-weight: 500; }
.lb__desc { margin: 0 0 8px; color: #444; }
.lb__btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.foot { border-top: 1px solid rgba(40, 40, 40, .1); background: #fff; }
.foot__inner { max-width: 1440px; margin: 0 auto; padding: 32px 24px 40px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; color: var(--sub); font-size: 14px; }
.foot__inner p { margin: 0; flex: 1 1 360px; }
.foot .small { flex: none; font: 12px var(--mono); }
