:root {
  --red: #d7141d;
  --red-dark: #a00810;
  --yellow: #ffb400;
  --ink: #1d1517;
  --muted: #6f6266;
  --bg: #fbf7f1;
  --card: #fff;
  --line: #eadfd6;
  --gutter: clamp(16px, 5vw, 72px);
  --font-en: "Baloo 2", "Noto Sans TC", system-ui, sans-serif;
  --font: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

#dots {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- header ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
}

.brand { display: flex; align-items: baseline; gap: 8px; }

.brand-en {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.5px;
  color: var(--red);
}

.brand-en b { color: var(--yellow); font-weight: 800; }

.brand-zh { font-weight: 900; font-size: 15px; letter-spacing: .08em; }

.header-cta {
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: background .2s, color .2s;
}

.header-cta:hover { background: var(--ink); color: #fff; }

/* ---------- hero ---------- */
.hero {
  max-width: 1280px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 96px var(--gutter) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "head stage" "foot stage";
  column-gap: clamp(24px, 4vw, 64px);
  align-content: center;
}

.hero-head { grid-area: head; align-self: end; position: relative; z-index: 1; }
.hero-foot { grid-area: foot; align-self: start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--red);
}

.eyebrow::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
}

h1 {
  margin: .3em 0 .45em;
  font-size: clamp(2.3rem, 4.6vw, 4.6rem);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: .01em;
}

.pop {
  color: var(--red);
  background: linear-gradient(transparent 64%, rgba(255, 180, 0, .45) 64%);
  white-space: nowrap;
}

.services {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.services li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
}

.services li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 700 18px/1.2 var(--font);
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(215, 20, 29, .6);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(215, 20, 29, .7); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- stage ---------- */
.hero-stage {
  grid-area: stage;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-stage::before {
  content: "";
  position: absolute;
  top: 52%;
  left: 50%;
  width: min(96%, 600px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, rgba(255, 180, 0, .38), rgba(215, 20, 29, .12) 58%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.stage-svg {
  display: block;
  width: min(100%, 520px);
  height: auto;
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s ease-out;
}

.stage-svg:focus { outline: none; }
.stage-svg:focus-visible { outline: 3px dashed var(--red); outline-offset: 8px; border-radius: 24px; }

.stage-tip { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.tip-touch { display: none; }

@media (pointer: coarse) {
  .tip-mouse { display: none; }
  .tip-touch { display: inline; }
}

/* svg 內部 */
.skin { fill: url(#gHead); }
.lid { fill: #d3121b; }
[data-face="angry"] .skin { fill: url(#gHeadAngry); }
[data-face="angry"] .lid { fill: #b8000c; }

.arm { fill: none; stroke: #c90f18; stroke-width: 15; stroke-linecap: round; }
.hand rect { fill: #d3121b; stroke: #7d050c; stroke-width: 1.5; }

.sb-time { font: 700 13px var(--font); fill: #3a2200; }
.hint-t { font: 700 15px var(--font); fill: #fff; text-anchor: middle; }

.hint-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: ring 1.6s ease-out infinite;
}

@keyframes ring {
  0% { transform: scale(.8); opacity: .7; }
  100% { transform: scale(2.2); opacity: 0; }
}

#bubble { cursor: pointer; }
#bubbleShape { fill: #fff; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
#bubbleText { font: 900 19px var(--font); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

.face-neutral, .face-happy, .face-angry, .face-surprised, .face-sleepy { display: none; }
[data-face="neutral"] .face-neutral,
[data-face="happy"] .face-happy,
[data-face="angry"] .face-angry,
[data-face="surprised"] .face-surprised,
[data-face="sleepy"] .face-sleepy { display: inline; }

.puff {
  transform-box: fill-box;
  transform-origin: center;
  animation: puff 1s ease-out infinite;
}
.puff.p2 { animation-delay: .33s; }
.puff.p3 { animation-delay: .66s; }

@keyframes puff {
  0% { transform: translate(0, 10px) scale(.3); opacity: 0; }
  30% { opacity: .9; }
  100% { transform: translate(0, -34px) scale(1.4); opacity: 0; }
}

.zzz text { font: 800 22px var(--font-en); fill: #3a2200; }
.zzz text {
  transform-box: fill-box;
  transform-origin: center;
  animation: zzz 2.4s ease-in-out infinite;
}
.zzz text + text { animation-delay: 1.2s; font-size: 28px; }

@keyframes zzz {
  0% { transform: translate(0, 8px); opacity: 0; }
  40% { opacity: .8; }
  100% { transform: translate(10px, -18px); opacity: 0; }
}

/* ---------- contact ---------- */
.contact {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.contact h2 { margin: .25em 0 .3em; font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; line-height: 1.2; }
.contact-intro p:last-child { margin: 0; color: var(--muted); }

.contact-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 30px 60px -32px rgba(60, 20, 20, .28);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.field { margin: 0 0 18px; }

.field > label, .chips legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-weight: 700;
  font-size: 15px;
}

.req { color: var(--red); }

.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffdfb;
  color: var(--ink);
  font: 500 16px/1.5 var(--font);
  transition: border-color .2s, box-shadow .2s;
}

.field textarea { resize: vertical; min-height: 130px; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(215, 20, 29, .12);
}

.field .invalid { border-color: var(--red); background: #fff6f6; }

.chips { border: 0; padding: 0; min-width: 0; }

.chips > .chip { display: inline-block; margin: 0 6px 8px 0; font-weight: 500; cursor: pointer; }

.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.chip span {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
}

.chip input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-submit { min-width: 180px; }
.btn-submit[disabled] { opacity: .6; cursor: wait; transform: none; }

.form-status { min-height: 1.6em; margin: 14px 0 0; font-weight: 700; font-size: 15px; }
.form-status.ok { color: #1a8a4a; }
.form-status.err { color: var(--red); }

.site-footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .hero {
    min-height: 0;
    padding-top: 92px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "stage" "foot";
    text-align: center;
  }

  h1 { font-size: clamp(2.1rem, 9vw, 3.2rem); margin-bottom: 0; }

  /* 手機螢幕上方是留給小怪獸探頭的空間，往上疊到標題 */
  .hero-stage { margin-top: -8vw; }
  .stage-svg { width: min(84vw, 460px); }
  .hero-stage::before { top: 58%; }

  .services { justify-content: center; margin-top: 20px; }
  .hero-foot { text-align: center; }

  .contact { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .brand-en { font-size: 26px; }
  .services { gap: 8px; }
  .services li { padding: 8px 13px; font-size: 15px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .btn-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint-ring, .puff, .zzz text { animation: none; }
  .stage-svg { transition: none; }
}
