/* Paw Pop Match website: the app's "Cute" Pawville look (pink, cream, plum ink, orange title), light only.
   No inline styles anywhere (CSP style-src 'self'); RTL pages work through logical properties. */
:root {
  color-scheme: light;
  --bg: #FFF7FB;
  --bg-deep: #FFE4EF;
  --card: #FFFFFF;
  --ink: #4A2A4F;
  --ink-soft: #6E4F72;
  --line: #F6CFE0;
  --pink: #FF8FBE;
  --pink-deep: #C23A72;
  --orange: #D4601A;
  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 12px 32px rgba(122, 42, 92, 0.12);
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round";
  --script: system-ui;
  --measure: 66ch;
}
/* Han glyph forms differ by language, so pick the right font family per page. */
:lang(ja) { --script: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP"; }
:lang(zh-Hans) { --script: "PingFang SC", "Microsoft YaHei", "Noto Sans SC"; }
:lang(zh-Hant) { --script: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC"; }
:lang(ko) { --script: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR"; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--script), "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--pink-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 {
  font-family: var(--round), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--script), sans-serif;
  line-height: 1.2; margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); font-weight: 800; }
:lang(ja) :is(h1, h2, .lead, figcaption) { word-break: auto-phrase; }
h2 { font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { color: var(--ink-soft); font-size: 1.12rem; max-width: var(--measure); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--card); padding: 8px 12px; border-radius: 10px; z-index: 30; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--pink-deep); outline-offset: 2px; border-radius: 8px; }

/* Header ---------------------------------------------------------------------------------- */
.top {
  position: relative; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 12px 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-inline-end: auto;
  font-family: var(--round), -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 800; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand img { border-radius: 12px; box-shadow: 0 3px 10px rgba(122, 42, 92, 0.15); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 999px; font-weight: 650; color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--card); }
.nav a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tag {
  display: inline-block; margin-inline-start: 2px; padding: 0 5px; border-radius: 6px; vertical-align: 1px;
  font-size: 0.68em; font-weight: 700; line-height: 1.6; color: var(--ink-soft); background: var(--bg-deep);
}

@media (max-width: 640px) {
  .lang-menu { order: 1; }
  .nav { order: 2; flex-basis: 100%; }
  .nav a { padding: 6px 10px; }
}

.lang-menu summary {
  list-style: none; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-weight: 700; white-space: nowrap;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { box-shadow: inset 0 0 0 2px var(--pink); }
.lang-menu ul {
  position: absolute; inset-inline-end: 16px; top: calc(100% - 4px); z-index: 20;
  width: min(600px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px;
  margin: 0; padding: 10px; list-style: none;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.lang-menu li a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.lang-menu li a:hover { background: var(--bg); }
.lang-menu li a[aria-current="true"] { color: var(--pink-deep); background: var(--bg-deep); }

/* Layout ---------------------------------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; }
section { margin: 48px 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px; font-weight: 800; font-size: 1.05rem;
  text-decoration: none; color: #fff; background: var(--pink-deep); box-shadow: 0 8px 20px rgba(194, 58, 114, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 24px rgba(194, 58, 114, 0.35); }
.btn-soft { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover { color: var(--pink-deep); box-shadow: inset 0 0 0 1px var(--pink); }

/* Hero ------------------------------------------------------------------------------------ */
.hero {
  display: grid; gap: 24px; align-items: center; margin-top: 8px; padding: 32px 20px 0; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 247, 251, 0.94) 0%, rgba(255, 238, 245, 0.82) 55%, rgba(255, 228, 239, 0.55) 100%),
    url("img/village.webp") center bottom / cover no-repeat,
    var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--line);
}
.hero h1 { color: var(--orange); text-shadow: 0 2px 0 #fff; }
.hero .lead { color: var(--ink); font-weight: 600; }
.hero-art { position: relative; display: flex; justify-content: center; padding-inline-start: 72px; }
.phone {
  width: min(250px, 62vw); margin: 0 0 -60px; overflow: hidden;
  border: 8px solid #fff; border-radius: 34px; background: #fff; box-shadow: var(--shadow);
}
.hero-pip { position: absolute; inset-inline-start: max(0px, calc(50% - 230px)); bottom: 16px; width: 150px; z-index: 1; filter: drop-shadow(0 8px 14px rgba(122, 42, 92, 0.18)); }

@media (min-width: 820px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; padding: 48px 48px 0; }
  .hero-text { padding-bottom: 48px; }
  .hero-pip { width: 180px; inset-inline-start: 0; }
  .phone { width: 270px; }
}

/* Intro and pet parade --------------------------------------------------------------------- */
.intro { text-align: center; }
.intro .lead { margin-inline: auto; }
.parade { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.parade img { width: 64px; height: 64px; }
@media (min-width: 640px) { .parade img { width: 80px; height: 80px; } }
@media (prefers-reduced-motion: no-preference) {
  .parade li { animation: bob 2.8s ease-in-out infinite; }
  .parade li:nth-child(2n) { animation-delay: -0.7s; }
  .parade li:nth-child(3n) { animation-delay: -1.4s; }
  .parade li:nth-child(5n) { animation-delay: -2.1s; }
  @keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
}

/* Features -------------------------------------------------------------------------------- */
.features { display: grid; gap: 16px; }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { margin: 0; padding: 22px; background: var(--card); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.feature img { width: 64px; height: 64px; margin-bottom: 10px; }
.feature h2 { font-size: 1.02rem; color: var(--pink-deep); }
.feature ul { margin: 0; padding: 0; list-style: none; }
.feature li { position: relative; padding-inline-start: 1.25em; margin: 0 0 0.5em; }
.feature li::before {
  content: ""; position: absolute; inset-inline-start: 0.15em; top: 0.62em;
  width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--pink);
}

/* Screenshots ----------------------------------------------------------------------------- */
.shots h2 { text-align: center; }
.shot-strip {
  display: flex; gap: 16px; margin: 0; padding: 8px 4px 20px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
}
.shot-strip li { flex: 0 0 min(210px, 60vw); scroll-snap-align: center; }
.shot-strip figure { margin: 0; }
.shot { border: 6px solid #fff; border-radius: 26px; box-shadow: var(--shadow); background: #fff; }
.shot-strip figcaption { margin-top: 10px; text-align: center; font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
@media (min-width: 1100px) { .shot-strip { justify-content: center; } .shot-strip li { flex-basis: 160px; } }

/* Outro ----------------------------------------------------------------------------------- */
.outro {
  display: grid; justify-items: center; text-align: center; padding: 32px 20px;
  background: var(--bg-deep); border-radius: var(--radius-lg);
}
.outro-line { margin: 0; font-family: var(--round), -apple-system, "Segoe UI", Roboto, var(--script), sans-serif; font-weight: 800; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); }

/* Legal pages ----------------------------------------------------------------------------- */
.prose {
  max-width: 820px; margin: 16px auto 0; padding: clamp(20px, 4vw, 44px);
  background: var(--card); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line);
}
.prose h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); color: var(--orange); }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; color: var(--pink-deep); }
.prose ul { padding-inline-start: 1.3em; }
.prose li { margin-bottom: 0.35em; }
.updated { color: var(--ink-soft); font-weight: 600; }
.table { overflow-x: auto; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; min-width: 480px; }
th, td { text-align: start; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-deep); }
code { font-size: 0.92em; padding: 1px 5px; border-radius: 6px; background: var(--bg); }
.notfound { text-align: center; }
.notfound img { margin: 0 auto 12px; width: 140px; }
.notfound .cta { justify-content: center; }

/* Footer ---------------------------------------------------------------------------------- */
.foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; color: var(--ink-soft); font-size: 0.95rem; }
.foot-pip { width: 72px; margin: 0 auto 8px; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--pink-deep); }
