:root {
  --container-max: 1280px;
  --container-gutter: 24px;
  --font-headline: "Avenir Next", "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
  --font-body: "Inter", "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body.pokopia-home {
  min-height: 100vh;
  color: #1b2621;
  font-family: var(--font-body), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f4fff9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.pokopia-home a {
  color: inherit;
  text-decoration: none;
}

body.menu-open {
  overflow: hidden;
}

.site-header-wrap {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0 var(--container-gutter);
  pointer-events: none;
}

.site-header-wrap > * {
  pointer-events: auto;
}

.site-header-inner {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: 64px;
  border: 1px solid rgba(131, 153, 142, 0.34);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 15px 34px rgba(56, 77, 67, 0.08);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.site-mascot {
  display: block;
  width: 34px;
  height: 24px;
  object-fit: contain;
  opacity: 0.9;
  flex-shrink: 0;
}

.site-domain,
.footer-domain {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-family: "Avenir Next", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  user-select: none;
}

.site-domain {
  font-size: 26px;
}

.footer-domain {
  align-items: flex-end;
  font-size: 34px;
  line-height: 0.82;
}

.letter {
  display: inline-block;
  transform-origin: 50% 50%;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7), 0 4px 10px rgba(28, 91, 80, 0.17);
}

.site-domain .letter {
  animation: logoWave 2.2s ease-in-out infinite;
  animation-delay: var(--letter-delay, 0s);
}

.footer-domain .letter {
  animation: bob 3.4s ease-in-out infinite;
}

.site-domain .letter:nth-child(1) { --letter-delay: 0s; }
.site-domain .letter:nth-child(2) { --letter-delay: 0.08s; }
.site-domain .letter:nth-child(3) { --letter-delay: 0.16s; }
.site-domain .letter:nth-child(4) { --letter-delay: 0.24s; }
.site-domain .letter:nth-child(5) { --letter-delay: 0.32s; }
.site-domain .letter:nth-child(6) { --letter-delay: 0.4s; }
.site-domain .letter:nth-child(7) { --letter-delay: 0.48s; }
.site-domain .letter:nth-child(8) { --letter-delay: 0.56s; }
.site-domain .letter:nth-child(9) { --letter-delay: 0.64s; }
.site-domain .letter:nth-child(10) { --letter-delay: 0.72s; }
.site-domain .letter:nth-child(11) { --letter-delay: 0.8s; }

.site-brand:hover .site-domain .letter {
  animation-name: bounce;
  animation-duration: 0.58s;
  animation-timing-function: ease;
  animation-iteration-count: 1;
  animation-fill-mode: both;
  animation-delay: var(--letter-delay, 0s);
}

.footer-brand:hover .footer-domain .letter {
  animation: bounce 0.58s ease;
}

.cBlue { color: #39b9eb; }
.cYellow { color: #f1bf43; }
.cPurple { color: #8d76e8; }
.cRed { color: #ef5c62; }
.cGreen { color: #60cf54; }
.cLavender { color: #a283f0; }
.cOrange { color: #ef8d2e; }
.cInk { color: #495651; }
.cCyan { color: #41c6ef; }
.cLime { color: #76cf56; }
.cGold { color: #f1bf43; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-1.2deg); }
}

@keyframes logoWave {
  0%, 68%, 100% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-8px) rotate(-2.5deg) scale(1.02); }
  44% { transform: translateY(0) rotate(0deg); }
}

@keyframes bounce {
  0% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-8px) rotate(-3deg) scale(1.03); }
  100% { transform: translateY(0) rotate(0deg); }
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link,
.nav-active {
  border-radius: 14px;
  padding: 9px 15px;
  font-size: 15px;
  font-weight: 700;
  color: rgb(77, 94, 87);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 44, 121, 0.12);
  color: #111827;
}

.nav-active {
  color: #fff;
  background: linear-gradient(135deg, #ff448f 0%, #ff2c79 100%);
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(255, 44, 121, 0.3);
}

.site-actions {
  justify-self: end;
}

.official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff448f 0%, #ff2c79 100%);
  box-shadow: 0 10px 18px rgba(255, 44, 121, 0.3);
}

.official-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

/* Force nav/button text colors to match design spec, even if other styles override them. */
.site-header-inner .site-nav .nav-link:not(.nav-active) {
  color: rgb(77, 94, 87) !important;
}

.site-header-inner .site-nav .nav-active,
.site-header-inner .official-link,
.hero .action-primary {
  color: #fff !important;
}

.site-header-inner .site-nav .nav-active:hover,
.site-header-inner .official-link:hover,
.hero .action-primary:hover {
  color: #fff !important;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(140, 118, 204, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2.5px;
  border-radius: 99px;
  background: #6d4aa8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.home-page {
  width: 100%;
  margin-top: 0;
}

.hero {
  position: relative;
  min-height: 760px;
  padding: 150px 24px 92px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 39, 28, 0.18) 0%, rgba(26, 45, 33, 0.14) 44%, rgba(32, 51, 38, 0.2) 100%),
    radial-gradient(circle at 14% 50%, rgba(165, 235, 143, 0.11), transparent 45%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 1060px);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.wood-board {
  width: min(100%, 900px);
  border-radius: 16px;
  border: 4px solid #8a4a19;
  background: linear-gradient(180deg, rgba(210, 181, 139, 0.97), rgba(196, 160, 113, 0.97));
  box-shadow: inset 0 0 20px rgba(87, 50, 18, 0.17), 0 10px 0 #71380d, 0 18px 32px rgba(50, 26, 6, 0.4);
  padding: 30px 26px 28px;
  text-align: center;
  position: relative;
}

.wood-board::before,
.wood-board::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #6a2f0c;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.24);
  transform: translateY(-50%);
}

.wood-board::before { left: 20px; }
.wood-board::after { right: 20px; }

.wood-board h1 {
  font-family: var(--font-headline), sans-serif;
  font-size: clamp(38px, 5.7vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(78, 42, 13, 0.42), 0 7px 24px rgba(0, 0, 0, 0.42);
}

.wood-board p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(18px, 1.65vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.action-primary {
  border-radius: 999px;
  border: 2px solid transparent;
  min-width: 188px;
  text-align: center;
  padding: 13px 24px;
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #ff448f 0%, #ff2c79 100%);
  box-shadow: 0 12px 22px rgba(255, 44, 121, 0.42);
}

.action-primary:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.04);
}

.pokeball {
  position: absolute;
  left: 50%;
  bottom: -38px;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  border: 5px solid #151515;
  background: linear-gradient(180deg, #f44f4b 0 49%, #fff 49% 100%);
  box-shadow: 0 10px 20px rgba(22, 24, 20, 0.35);
  transform: translateX(-50%);
  z-index: 8;
}

.pokeball::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background: #151515;
  transform: translateY(-50%);
}

.pokeball::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 4px solid #151515;
  background: #fff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.tools-section {
  position: relative;
  background: #95e35f;
  padding: 86px 0 116px;
  z-index: 1;
}

.zigzag {
  position: absolute;
  top: -18px;
  left: 0;
  width: 100%;
  height: 22px;
  background:
    linear-gradient(-135deg, #95e35f 11px, transparent 0) 0 0/22px 100%,
    linear-gradient(135deg, #95e35f 11px, transparent 0) 11px 0/22px 100%;
}

.tools-inner {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0 24px;
}

.cloud-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 46px;
}

.cloud-title {
  position: relative;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 28px rgba(29, 66, 35, 0.16);
  padding: 20px 46px;
  min-width: 350px;
  text-align: center;
}

.cloud-title::before,
.cloud-title::after {
  content: "";
  position: absolute;
  top: -14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
}

.cloud-title::before {
  left: 18%;
  width: 48px;
  height: 48px;
}

.cloud-title::after {
  right: 18%;
  width: 64px;
  height: 64px;
  top: -24px;
}

.cloud-ditto {
  position: absolute;
  left: -6px;
  top: -10px;
  width: 42px;
  height: 32px;
  transform: rotate(-14deg);
}

.cloud-title h2 {
  position: relative;
  z-index: 2;
  font-family: var(--font-headline), sans-serif;
  font-size: clamp(36px, 3vw, 50px);
  letter-spacing: -0.01em;
  color: #39463f;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.polaroid {
  position: relative;
  background: #fff;
  border-radius: 4px;
  padding: 16px 16px 22px;
  box-shadow: 0 18px 34px rgba(36, 67, 35, 0.2);
  color: #1a2922;
  transition: all 0.2s ease;
}

.polaroid:hover {
  transform: translateY(-6px) scale(1.01);
}

.tiltLeft { transform: rotate(-2deg); }
.tiltRight { transform: rotate(1.3deg); }
.tiltLeftSoft { transform: rotate(-1deg); }
.tiltRightSoft { transform: rotate(2deg); }

.polaroid:hover.tiltLeft,
.polaroid:hover.tiltRight,
.polaroid:hover.tiltLeftSoft,
.polaroid:hover.tiltRightSoft {
  transform: translateY(-8px) rotate(0deg) scale(1.015);
}

.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 86px;
  height: 30px;
  border-radius: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(234, 255, 237, 0.76), rgba(217, 245, 220, 0.62));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.85);
}

.card-scene {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  overflow: hidden;
}

.card-scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) blur(1.3px);
  transform: scale(1.04);
}

.hue-0 { filter: hue-rotate(0deg) saturate(1.1) blur(1.3px); }
.hue-90 { filter: hue-rotate(90deg) saturate(1.1) blur(1.3px); }
.hue-175 { filter: hue-rotate(175deg) saturate(1.1) blur(1.3px); }
.hue-255 { filter: hue-rotate(255deg) saturate(1.1) blur(1.3px); }

.card-scene-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.58));
  backdrop-filter: blur(0.9px);
}

.card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.card-icon {
  width: 34px;
  height: 34px;
  display: block;
  background-image: url("https://file.jkhcz.com/pokopia/filters/icon.webp");
  background-size: 680px auto;
  background-repeat: no-repeat;
  transform: scale(2);
  transform-origin: center;
  filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.7));
}

.icon-pokemon { background-position: -442px -102px; }
.icon-habitats { background-position: -476px -102px; }
.icon-items { background-position: -510px -102px; }
.icon-events { background-position: -544px -102px; }

.card-content h3 {
  margin-top: 26px;
  font-size: clamp(34px, 2.8vw, 48px);
  font-family: var(--font-headline), sans-serif;
  letter-spacing: -0.01em;
}

.polaroid p {
  margin-top: 16px;
  font-size: clamp(16px, 1.3vw, 22px);
  line-height: 1.55;
  text-align: center;
  color: #2f3f38;
}

.polaroid strong {
  margin-top: 10px;
  display: block;
  text-align: center;
  color: #5a6d65;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.site-footer {
  margin-top: 0;
  padding: 0 18px 18px;
  background: #e9f0eb;
}

/* Keep homepage tools section and footer visually continuous (no seam). */
.home-page + .site-footer {
  background: #95e35f;
}

.footer-card {
  width: min(1820px, calc(100vw - 36px));
  margin: 0 auto;
  border: 1px solid rgba(255, 165, 208, 0.35);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(161, 103, 136, 0.08);
  padding: 34px 44px 26px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: clamp(28px, 5vw, 140px);
}

.brand-panel {
  color: #7d6aa9;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-mascot {
  width: 34px;
  height: 26px;
  object-fit: contain;
}

.footer-subtitle {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  color: #5e3f97;
}

.footer-description {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: #7e71b0;
  white-space: pre-line;
}

.legal-row {
  margin-top: 22px;
  border-top: 1px solid rgba(207, 181, 227, 0.25);
  border-bottom: 1px solid rgba(207, 181, 227, 0.25);
  padding: 14px 0;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  max-width: 100%;
}

.legal-link {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #7a68ab;
  position: relative;
}

.legal-link:not(:last-child)::after {
  content: "·";
  color: #9f91c7;
  margin-left: 14px;
}

.legal-link:hover {
  color: #5f4793;
}

.qr-panel {
  justify-self: end;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.qr-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(186, 158, 216, 0.45);
  background: #fff;
}

.qr-card p {
  font-size: 13px;
  line-height: 1.35;
  color: #7f71b0;
  font-weight: 700;
}

.footer-bottom {
  margin-top: 16px;
}

.footer-copy {
  font-size: 13px;
  line-height: 1.4;
  color: #9286bf;
}

@media (max-width: 1200px) {
  .site-actions {
    display: none;
  }
}

@media (max-width: 1120px) {
  .footer-top {
    grid-template-columns: minmax(220px, 1fr) minmax(210px, 280px);
    gap: 22px;
  }
}

@media (max-width: 1100px) {
  .hero {
    min-height: 650px;
  }

  .wood-board {
    padding: 26px 20px 24px;
  }

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

@media (max-width: 960px) {
  .site-header-wrap {
    top: 8px;
    padding: 0 10px;
  }

  .site-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    row-gap: 0;
    border-radius: 24px;
    padding: 11px 14px;
    min-height: unset;
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(170, 198, 184, 0.42);
  }

  .site-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-domain {
    font-size: 20px;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border-color: rgba(130, 167, 151, 0.35);
    background: rgba(245, 255, 250, 0.95);
  }

  .menu-toggle span {
    width: 20px;
    background: #536d61;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    margin: 12px 0 0;
    padding: 0;
    border-top: 1px solid rgba(170, 198, 184, 0.45);
    gap: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link,
  .nav-active {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    padding: 14px 4px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    box-shadow: none;
  }

  .nav-link {
    color: rgb(77, 94, 87);
  }

  .nav-active {
    color: #fff;
    background: rgba(255, 44, 121, 0.14);
  }

  .nav-link:hover,
  .nav-active:hover {
    background: rgba(255, 44, 121, 0.1);
    color: #111827;
  }

  .hero {
    min-height: 620px;
    padding-top: 182px;
    padding-bottom: 80px;
  }

  .wood-board {
    border-width: 3px;
    box-shadow: inset 0 0 16px rgba(87, 50, 18, 0.13), 0 8px 0 #71380d, 0 18px 30px rgba(50, 26, 6, 0.34);
  }

  .pokeball {
    width: 66px;
    height: 66px;
    bottom: -24px;
  }

  .tools-section {
    padding-top: 68px;
  }

  .site-footer {
    padding: 0 10px 14px;
  }

  .footer-card {
    width: calc(100vw - 20px);
    border-radius: 20px;
    padding: 18px 16px 14px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-domain {
    font-size: 28px;
  }

  .footer-subtitle {
    font-size: 14px;
    margin-top: 6px;
  }

  .footer-description {
    margin-top: 8px;
    font-size: 14px;
  }

  .legal-nav {
    justify-content: flex-start;
    gap: 8px 10px;
  }

  .legal-link {
    font-size: 14px;
  }

  .legal-link:not(:last-child)::after {
    margin-left: 10px;
  }

  .qr-panel {
    justify-self: start;
  }

  .qr-grid {
    gap: 10px;
  }

  .qr-image {
    width: 84px;
    height: 84px;
  }

  .qr-card p {
    font-size: 12px;
  }

  .footer-copy {
    font-size: 12px;
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 178px 14px 66px;
    min-height: 560px;
  }

  .wood-board {
    padding: 24px 14px;
    border-radius: 12px;
  }

  .wood-board::before,
  .wood-board::after {
    width: 10px;
    height: 10px;
  }

  .hero-actions {
    width: 100%;
  }

  .action-primary {
    width: 100%;
    min-width: 170px;
    padding: 12px;
  }

  .tools-inner {
    padding: 0 12px;
  }

  .cloud-title {
    min-width: 0;
    width: 100%;
    padding: 18px 26px;
  }

  .cloud-ditto {
    left: -2px;
    top: -16px;
    width: 34px;
    height: 26px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .polaroid,
  .tiltLeft,
  .tiltRight,
  .tiltLeftSoft,
  .tiltRightSoft {
    transform: none;
  }
}
