:root {
  --ink: #102b3a;
  --muted: #496673;
  --canvas: #f5faf8;
  --surface: #ffffff;
  --teal: #0d8f84;
  --teal-deep: #08645e;
  --teal-soft: #d9f1ec;
  --coral: #d95763;
  --coral-deep: #a93b48;
  --butter: #f2c75c;
  --butter-soft: #fff5d5;
  --line: #b9d3cf;
  --shadow: 0 16px 34px rgba(16, 43, 58, 0.14);
  --content: min(1160px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button, select { font: inherit; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

a:hover { color: var(--teal-deep); }

img { display: block; max-width: 100%; }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 { line-height: 1.2; letter-spacing: 0; }

h1 { max-width: 14ch; margin-bottom: 20px; font-size: clamp(2.55rem, 5vw, 4.7rem); }

h2 { margin-bottom: 16px; font-size: clamp(1.65rem, 2.8vw, 2.35rem); }

h3 { margin-bottom: 8px; font-size: 1.08rem; }

ul, ol { padding-left: 1.25rem; }

li + li { margin-top: 8px; }

code {
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--teal-deep);
  background: var(--teal-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: -56px;
  left: 16px;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  transition: top 160ms ease;
}

.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 12px max(20px, calc((100% - 1160px) / 2));
  border-bottom: 1px solid rgba(185, 211, 207, 0.9);
  background: rgba(245, 250, 248, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--butter);
}

.brand-mark img { width: 27px; height: 27px; object-fit: contain; image-rendering: pixelated; }

.main-nav { display: flex; justify-content: center; gap: 4px; }

.main-nav a {
  padding: 8px 11px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
}

.main-nav a:hover, .main-nav a[aria-current="page"] { border-color: var(--coral); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.language-select {
  min-width: 130px;
  min-height: 40px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--teal-deep);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 40px;
  border: 1px solid var(--teal-deep);
  border-radius: 5px;
  color: var(--teal-deep);
  background: var(--teal-soft);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.menu-toggle:hover { background: var(--teal); color: #fff; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(680px, calc(100svh - 72px));
  overflow: hidden;
  color: #fff;
  background: #123e49 url("../images/hero-pixel-studio.png") center / cover no-repeat;
  isolation: isolate;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(8, 43, 54, 0.23);
}

.hero-content { position: relative; z-index: 2; width: min(1080px, calc(100% - 112px)); margin: 0 auto; padding: 72px 0 88px; }

.hero-pet {
  position: absolute;
  z-index: 1;
  right: clamp(42px, 10vw, 160px);
  bottom: 48px;
  width: clamp(106px, 12vw, 176px);
  pointer-events: none;
}

.hero-pet-stage { position: relative; width: 100%; aspect-ratio: 1; }

.hero-pet-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0;
}

.hero-pet-frame-01 { opacity: 1; }

.hero-pixel {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--butter);
  box-shadow: 7px 0 0 var(--butter), 0 7px 0 var(--butter), 7px 7px 0 var(--butter);
}

.hero-pixel-one { top: 4%; left: -26%; }
.hero-pixel-two { top: 28%; right: -25%; transform: scale(0.72); }
.hero-pixel-three { bottom: 20%; left: -13%; transform: scale(0.55); }
.hero-pixel-four { bottom: -7%; right: -10%; transform: scale(0.8); }

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: #fff7d8;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy { max-width: 500px; margin-bottom: 28px; font-size: clamp(1.05rem, 1.8vw, 1.25rem); }

.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover { transform: translateY(-2px); color: inherit; }
.button:focus-visible, .menu-toggle:focus-visible, .language-select:focus-visible, summary:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }
.button-primary { color: #fff; background: var(--coral); border-color: var(--coral-deep); }
.button-primary:hover { color: #fff; background: var(--coral-deep); }
.button-secondary { color: var(--ink); background: var(--butter); border-color: #b18312; }
.button-secondary:hover { color: var(--ink); background: #ffd871; }
.button-teal { color: #fff; background: var(--teal); border-color: var(--teal-deep); }
.button-teal:hover { color: #fff; background: var(--teal-deep); }

.section { padding: 80px 0; }
.section-inner { width: var(--content); margin: 0 auto; }
.section-soft { background: var(--teal-soft); }
.section-butter { background: var(--butter-soft); }
.section-dark { color: #f7fffd; background: var(--ink); }

.section-kicker { margin-bottom: 8px; color: var(--teal-deep); font-size: 0.85rem; font-weight: 800; }
.section-dark .section-kicker { color: #8ce8d7; }

.lead { max-width: 720px; color: var(--muted); font-size: 1.12rem; }
.section-dark .lead { color: #c5ded9; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }

.feature-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.feature-card > img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
}

.pose-animation {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
}

.pose-animation img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0;
}

.pose-animation img:first-child { opacity: 1; }

.feature-card p { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }

.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: 54px; align-items: center; }

.image-stage {
  min-height: 360px;
  padding: 24px;
  border: 1px solid #79b9ae;
  border-radius: 7px;
  background: #e8f7f3;
}

.image-stage > img { width: 100%; height: 100%; max-height: 330px; object-fit: contain; image-rendering: pixelated; }
.image-stage .pose-animation-stage { width: 100%; height: 100%; min-height: 310px; }

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { position: absolute; left: 0; color: var(--coral); content: "■"; font-size: 0.75rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.step { padding-top: 18px; border-top: 4px solid var(--butter); }
.step strong { display: block; margin-bottom: 8px; color: var(--butter); font-size: 1.45rem; }

.workshop-spotlight { overflow: hidden; }
.workshop-spotlight .lead { max-width: 850px; }
.creator-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px; margin-top: 38px; }
.creator-path { padding: 24px 0 6px; border-top: 4px solid var(--teal); }
.creator-path-accent { border-color: var(--coral); }
.creator-path-kicker { margin-bottom: 10px; color: var(--teal-deep); font-size: 0.78rem; font-weight: 800; }
.creator-path-accent .creator-path-kicker { color: var(--coral-deep); }
.creator-flow { display: grid; gap: 18px; margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: creator-flow; }
.creator-flow li { position: relative; min-height: 42px; padding-left: 52px; counter-increment: creator-flow; }
.creator-flow li + li { margin-top: 0; }
.creator-flow li::before { position: absolute; top: 0; left: 0; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--teal-deep); border-radius: 50%; color: var(--teal-deep); content: counter(creator-flow); font-size: 0.86rem; font-weight: 800; }
.creator-path-accent .creator-flow li::before { border-color: var(--coral-deep); color: var(--coral-deep); }
.creator-flow strong, .creator-flow span { display: block; }
.creator-flow span { color: var(--muted); font-size: 0.95rem; }
.creator-character-showcase { display: grid; grid-template-columns: repeat(3, minmax(110px, 150px)) minmax(220px, 1fr); align-items: center; gap: clamp(18px, 3vw, 38px); margin-top: 42px; padding-top: 24px; border-top: 1px solid #d8c47e; }
.character-showcase-item { display: grid; justify-items: center; gap: 8px; color: var(--teal-deep); font-size: 0.9rem; text-align: center; }
.pose-animation-showcase { width: 112px; height: 112px; }
.creator-character-showcase > p { max-width: 340px; margin: 0 0 0 auto; color: var(--teal-deep); font-size: 1.05rem; font-weight: 800; }

.creator-guide-intro { max-width: 780px; }
.creator-guide-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr); gap: 52px; align-items: start; }
.creator-guide-layout h2 { margin-top: 42px; font-size: 1.55rem; }
.creator-guide-layout h3 { margin-top: 26px; }
.creator-guide-layout p, .creator-guide-layout li { color: #294755; }
.creator-aside { position: sticky; top: 100px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--teal-soft); }
.creator-aside p { margin-bottom: 16px; color: var(--muted); }
.creator-aside a { color: var(--teal-deep); font-weight: 800; }
.guide-downloads { display: grid; gap: 10px; margin-top: 22px; }
.guide-downloads .button { width: 100%; min-height: 42px; font-size: 0.9rem; }
.code-panel { overflow: auto; margin: 20px 0; padding: 20px; border: 1px solid #284d59; border-radius: 7px; color: #dff5ee; background: #0d2632; }
.code-panel code { display: block; min-width: 560px; padding: 0; color: inherit; background: transparent; font-size: 0.82rem; line-height: 1.55; white-space: pre; }
.creator-field-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.creator-field { padding: 15px 0; border-top: 1px solid var(--line); }
.creator-field p { margin: 5px 0 0; font-size: 0.94rem; }
.creator-checklist { padding: 20px 22px; border-left: 4px solid var(--coral); background: var(--butter-soft); }

.page-hero { padding: 76px 0 50px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-hero .section-inner { width: var(--content); }
.page-hero h1 { max-width: 20ch; margin-bottom: 14px; font-size: clamp(2.25rem, 4vw, 3.65rem); }
.page-hero p { max-width: 710px; margin-bottom: 0; color: var(--muted); font-size: 1.1rem; }

.legal-layout { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 64px; }
.legal-copy h2 { margin-top: 42px; font-size: 1.5rem; }
.legal-copy h3 { margin-top: 28px; }
.legal-copy p, .legal-copy li { color: #294755; }
.legal-aside { position: sticky; top: 100px; align-self: start; padding-left: 18px; border-left: 3px solid var(--teal); color: var(--muted); font-size: 0.9rem; }
.legal-aside a { display: block; margin: 8px 0; color: var(--teal-deep); }

.faq-list { display: grid; gap: 12px; max-width: 880px; }
details { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
summary { padding: 15px 18px; color: var(--ink); cursor: pointer; font-weight: 800; }
details p, details ul { margin: 0; padding: 0 18px 18px; color: var(--muted); }
details ul { padding-left: 38px; }

.support-banner { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 26px; border: 1px solid #d7b354; border-radius: 7px; background: var(--butter-soft); }
.support-banner p { margin-bottom: 0; color: var(--muted); }
.config-email { color: var(--teal-deep); font-weight: 800; }

.site-footer { padding: 38px 0; color: #c6ded9; background: #0d2632; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; width: var(--content); margin: 0 auto; }
.footer-brand { color: #fff; font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: #c6ded9; }
.footer-note { margin: 10px 0 0; color: #96b7b1; font-size: 0.86rem; }

[data-lang-content][hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; gap: 12px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; grid-column: 1 / -1; grid-row: 2; justify-content: stretch; flex-direction: column; padding-top: 8px; border-top: 1px solid var(--line); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px 4px; }
  .header-actions { gap: 8px; }
  .language-select { min-width: 112px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .legal-layout { grid-template-columns: 1fr; gap: 32px; }
  .creator-paths, .creator-guide-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-aside { position: static; order: -1; padding: 14px 0 0; border-top: 3px solid var(--teal); border-left: 0; }
  .creator-aside { position: static; order: -1; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --content: min(calc(100% - 32px), 1160px); }
  .site-header { min-height: 64px; padding: 10px 16px; }
  .brand { font-size: 0.93rem; }
  .brand-mark { width: 30px; height: 30px; }
  .hero { min-height: calc(100svh - 64px); background-position: 61% center; }
  .hero::before { background: rgba(8, 43, 54, 0.46); }
  .hero-content { width: min(calc(100% - 48px), 1080px); padding: 56px 0 70px; }
  .hero-pet { right: 22px; bottom: 20px; width: 98px; }
  .hero-pixel-one { left: -16%; }
  .hero-pixel-two { right: -12%; }
  h1 { font-size: 2.6rem; }
  .hero-copy { font-size: 1rem; }
  .section { padding: 56px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 62px 1fr; padding: 18px; }
  .feature-card > img, .pose-animation { width: 58px; height: 58px; }
  .page-hero { padding: 52px 0 38px; }
  .support-banner { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .creator-character-showcase { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .pose-animation-showcase { width: 78px; height: 78px; }
  .creator-character-showcase > p { grid-column: 1 / -1; margin: 10px 0 0; }
  .creator-field-list { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-pet {
    animation: hero-curious-wander 5.8s ease-in-out infinite;
  }

  .hero-pet-frame { transform-origin: center bottom; animation: hero-walk-cycle 1s steps(1, end) infinite; }
  .hero-pet-frame-02 { animation-delay: -0.833s; }
  .hero-pet-frame-03 { animation-delay: -0.667s; }
  .hero-pet-frame-04 { animation-delay: -0.5s; }
  .hero-pet-frame-05 { animation-delay: -0.333s; }
  .hero-pet-frame-06 { animation-delay: -0.167s; }

  .pose-animation img { animation: pose-frame-cycle 1s steps(1, end) infinite; }
  .pose-animation img:nth-child(2) { animation-delay: -0.833s; }
  .pose-animation img:nth-child(3) { animation-delay: -0.667s; }
  .pose-animation img:nth-child(4) { animation-delay: -0.5s; }
  .pose-animation img:nth-child(5) { animation-delay: -0.333s; }
  .pose-animation img:nth-child(6) { animation-delay: -0.167s; }

  .hero-pixel {
    opacity: 0;
    animation: hero-pixel-spark 2.7s steps(2, end) infinite;
  }

  .hero-pixel-two { animation-delay: -0.7s; }
  .hero-pixel-three { animation-delay: -1.35s; }
  .hero-pixel-four { animation-delay: -2.05s; }

  @media (hover: hover) {
    .hero:hover .hero-pet-stage {
      animation: hero-happy-hop 620ms ease-in-out 1;
    }
  }

  .motion-ready [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 520ms ease, transform 520ms ease;
    transition-delay: calc(var(--reveal-order, 0) * 70ms);
  }

  .motion-ready [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .motion-ready .hero-content.is-visible {
    transition-duration: 680ms;
  }

  .motion-ready .feature-card > img {
    transform-origin: center bottom;
    animation: pixel-companion-bob 2.8s ease-in-out infinite;
  }

  .motion-ready .feature-card:nth-child(2n) > img { animation-delay: -0.7s; }
  .motion-ready .feature-card:nth-child(3n) > img { animation-delay: -1.35s; }

  .motion-ready .image-stage > img {
    transform-origin: center top;
    animation: pixel-hang-sway 3.4s ease-in-out infinite;
  }

  .motion-ready .feature-card:hover > img {
    animation-play-state: paused;
    transform: translateY(-3px) scale(1.04);
  }

  .motion-ready .feature-card {
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .motion-ready .feature-card:hover {
    border-color: var(--teal);
    box-shadow: 0 10px 20px rgba(16, 43, 58, 0.1);
  }

  @keyframes pixel-companion-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
  }

  @keyframes pixel-hang-sway {
    0%, 100% { transform: rotate(-1.5deg) translateY(0); }
    50% { transform: rotate(1.5deg) translateY(3px); }
  }

  @keyframes hero-curious-wander {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    28% { transform: translate(-16px, -8px) rotate(-2deg); }
    55% { transform: translate(18px, -3px) rotate(2deg); }
    76% { transform: translate(5px, -10px) rotate(-1deg); }
  }

  @keyframes hero-walk-cycle {
    0%, 16.6% { opacity: 1; }
    16.7%, 100% { opacity: 0; }
  }

  @keyframes pose-frame-cycle {
    0%, 16.6% { opacity: 1; }
    16.7%, 100% { opacity: 0; }
  }

  @keyframes hero-paw-steps {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-1deg); }
  }

  @keyframes hero-happy-hop {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    35% { transform: translateY(-20px) rotate(-4deg); }
    60% { transform: translateY(2px) rotate(3deg); }
  }

  @keyframes hero-pixel-spark {
    0%, 100% { opacity: 0; transform: translateY(8px) scale(0.6); }
    35%, 70% { opacity: 1; transform: translateY(-5px) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
