:root {
  color-scheme: light;
  --paper: #f4f3ee;
  --paper-deep: #e9ebe5;
  --surface: #fffdf7;
  --surface-soft: #f8f7f1;
  --ink: #202321;
  --muted: #68706a;
  --line: #d9d7ce;
  --jade: #1e6f5c;
  --jade-dark: #164d42;
  --cinnabar: #b94132;
  --cinnabar-dark: #8e3028;
  --gold: #b58a34;
  --shadow: 0 18px 44px rgba(33, 36, 31, 0.10);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { overflow-x: clip; background: var(--paper); scroll-behavior: smooth; }

body { min-width: 320px; margin: 0; overflow-x: clip; color: var(--ink); background: var(--paper); }

a { color: inherit; }

.site-header, main, footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { display: block; border-radius: 22%; box-shadow: 0 5px 14px rgba(30, 111, 92, 0.17); }
.brand-copy { display: grid; gap: 3px; }
.brand strong { font-size: 17px; font-weight: 700; }
.brand small { color: var(--muted); font-size: 12px; }

.site-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.8);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.site-link:hover { border-color: var(--jade); color: var(--jade); }

.hero {
  --hero-shift: 0px;
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 520px;
  margin-left: calc(50% - 50vw);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 72px max(24px, calc((100vw - 1068px) / 2));
  color: #fff;
  background: #173f37;
}
.hero::before {
  position: absolute;
  z-index: -2;
  inset: -26px;
  content: "";
  background: url("assets/hero-zhizhi-temple-20260718.jpg") center 52% / cover no-repeat;
  transform: translate3d(0, var(--hero-shift), 0) scale(1.05);
  animation: hero-image-breathe 18s ease-in-out infinite alternate;
  will-change: transform, background-position;
}
.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(12, 35, 30, .92) 0%, rgba(12, 35, 30, .74) 43%, rgba(12, 35, 30, .24) 74%, rgba(12, 35, 30, .08) 100%),
    linear-gradient(0deg, rgba(17, 39, 34, .42), transparent 48%);
}
.hero-copy { max-width: 650px; animation: hero-copy-in 760ms ease-out both; }
.hero-brandline { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.hero-brandline img { width: 64px; height: 64px; display: block; border-radius: 22%; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); }
.hero-brandline .eyebrow { margin: 0; color: #f1cf7c; }
.eyebrow { margin: 0 0 11px; color: var(--cinnabar); font-size: 12px; font-weight: 800; letter-spacing: 0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-family: "STKaiti", "KaiTi", serif; font-size: 60px; font-weight: 700; line-height: 1.15; }
h1 span { color: #f1cf7c; }
.lead { max-width: 620px; margin: 22px 0 0; color: rgba(255,255,255,.84); font-size: 18px; line-height: 1.8; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 28px; color: rgba(255,255,255,.76); font-size: 13px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta i { color: #f1cf7c; font-size: 10px; font-style: normal; }

@keyframes hero-image-breathe {
  from { background-position: 50% 49%; }
  to { background-position: 52% 55%; }
}
@keyframes hero-copy-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

section { width: 100%; }
.download-panel { padding: 52px 0 40px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.section-heading h2, .about-section h2, .trust-section h2 { margin: 0; font-size: 29px; line-height: 1.25; }
.section-heading > p { max-width: 370px; margin: 0 0 2px; color: var(--muted); font-size: 14px; line-height: 1.7; text-align: right; }
.section-heading-tight { margin-bottom: 28px; }

.download-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.download-button {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.download-button:hover { transform: translateY(-2px); box-shadow: 0 22px 44px rgba(33, 36, 31, 0.16); }
.download-button.android { background: var(--jade); }
.download-button.android:hover { background: var(--jade-dark); }
.download-button.ios { background: var(--cinnabar); }
.download-button.ios:hover { background: var(--cinnabar-dark); }
.button-badge { min-width: 47px; padding: 8px 6px; border: 1px solid rgba(255,255,255,.48); border-radius: 6px; font: 700 11px/1 Georgia, serif; letter-spacing: 0; text-align: center; }
.button-copy { min-width: 0; display: grid; gap: 4px; }
.button-copy strong { font-size: 16px; line-height: 1.25; }
.button-copy small { color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.35; }
.button-arrow { font-size: 22px; line-height: 1; }
.download-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.download-notes p { margin: 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.download-notes strong { color: var(--ink); }

.screenshots-section { padding: 42px 0 62px; border-top: 1px solid var(--line); }
.gallery-heading-actions { max-width: 390px; display: flex; align-items: end; gap: 18px; }
.gallery-heading-actions p { margin: 0 0 2px; color: var(--muted); font-size: 14px; line-height: 1.7; text-align: right; }
.gallery-controls { display: flex; gap: 8px; flex: 0 0 auto; }
.gallery-controls button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font: 400 27px/1 Georgia, serif;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.gallery-controls button:hover { border-color: var(--cinnabar); color: var(--cinnabar); transform: translateY(-1px); }
.gallery-controls button:disabled { border-color: var(--line); color: #a7aaa7; background: transparent; cursor: default; transform: none; opacity: .62; }
.screenshots-scroller {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 2px 18px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.screenshots-scroller::-webkit-scrollbar { display: none; }
.screenshot-item { flex: 0 0 208px; min-width: 0; margin: 0; scroll-snap-align: start; }
.screenshot-open { width: 100%; display: block; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in; text-align: inherit; }
.screenshot-frame { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 13px 32px rgba(33, 36, 31, .12); transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.screenshot-frame img { width: 100%; height: auto; aspect-ratio: 828 / 1792; display: block; object-fit: cover; object-position: top; }
.screenshot-open:hover .screenshot-frame { transform: translateY(-3px); border-color: rgba(185, 65, 50, .48); box-shadow: 0 18px 38px rgba(33, 36, 31, .17); }
.screenshot-open:focus-visible { outline: 3px solid rgba(181,138,52,.55); outline-offset: 4px; }
.screenshot-item figcaption { display: grid; gap: 4px; padding: 13px 2px 0; }
.screenshot-item figcaption strong { font-size: 15px; }
.screenshot-item figcaption span { color: var(--muted); font-size: 12px; line-height: 1.45; }

body.gallery-open { overflow: hidden; }
.screenshot-lightbox[hidden] { display: none; }
.screenshot-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: rgba(10, 18, 16, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: lightbox-in 180ms ease-out both;
}
.screenshot-lightbox figure { min-width: 0; max-width: 520px; max-height: calc(100dvh - 48px); display: grid; gap: 13px; justify-self: center; margin: 0; }
.screenshot-lightbox figure img { width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 98px); display: block; justify-self: center; border-radius: 8px; box-shadow: 0 28px 90px rgba(0,0,0,.46); object-fit: contain; touch-action: pan-y; user-select: none; }
.screenshot-lightbox figcaption { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #fff; }
.screenshot-lightbox figcaption strong { font-size: 14px; }
.screenshot-lightbox figcaption span { color: rgba(255,255,255,.65); font-size: 12px; }
.lightbox-close, .lightbox-step {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.lightbox-close:hover, .lightbox-step:hover { background: rgba(255,255,255,.18); transform: scale(1.04); }
.lightbox-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); font-size: 27px; line-height: 1; }
.lightbox-step { font: 400 35px/1 Georgia, serif; }
.lightbox-previous { justify-self: end; }
.lightbox-next { justify-self: start; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }

.about-section { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 68px; padding: 58px 7%; border-block: 1px solid var(--line); background: var(--paper-deep); }
.about-intro { position: relative; isolation: isolate; min-height: 350px; display: flex; flex-direction: column; justify-content: end; overflow: hidden; padding: 28px; border-radius: 6px; color: #fff; }
.about-intro::before { position: absolute; z-index: -2; inset: 0; content: ""; background: url("assets/heritage-taoist-priests-20260718.jpg") center 34% / cover no-repeat; filter: sepia(.18) contrast(1.04); transition: transform 700ms ease; }
.about-intro::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(0deg, rgba(15,35,31,.92), rgba(15,35,31,.12) 72%); }
.about-intro:hover::before { transform: scale(1.025); }
.about-intro .eyebrow { color: #f1cf7c; }
.about-intro > p:last-child { max-width: 420px; margin: 19px 0 0; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.85; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.feature-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; min-width: 0; padding-top: 14px; border-top: 1px solid rgba(104,112,106,.35); }
.feature-index { color: var(--cinnabar); font: 700 12px/1 Georgia, serif; }
.feature-item h3 { margin: 0; font-size: 15px; }
.feature-item p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.trust-section { display: grid; grid-template-columns: .8fr 1.2fr; align-items: start; gap: 68px; padding: 48px 7%; }
.trust-section ul { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.trust-section li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 11px; align-items: start; }
.trust-section li > span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: rgba(30,111,92,.12); color: var(--jade); font-size: 13px; font-weight: 800; }
.trust-section li div { display: grid; gap: 3px; }
.trust-section li strong { font-size: 14px; }
.trust-section li small { color: var(--muted); font-size: 12px; line-height: 1.5; }

footer { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: var(--muted); font-size: 13px; }
footer a { text-decoration: none; }
.footer-links { display: grid; justify-items: end; gap: 4px; }
.photo-credit { color: #7b817d; font-size: 10px; }
.photo-credit:hover { color: var(--jade); }
a:focus-visible { outline: 3px solid rgba(181,138,52,.55); outline-offset: 3px; }

@media (max-width: 820px) {
  .hero { min-height: 480px; padding-inline: 5%; }
  h1 { font-size: 52px; }
  .about-section, .trust-section { gap: 38px; padding-inline: 4%; }
}

@media (max-width: 640px) {
  .site-header, main, footer { width: min(100% - 28px, 560px); }
  .site-header { min-height: 70px; }
  .brand img { width: 38px; height: 38px; }
  .brand small { font-size: 11px; }
  .site-link { min-height: 36px; padding-inline: 12px; font-size: 13px; }
  .hero { min-height: 490px; padding: 50px 24px 46px; text-align: left; }
  .hero::before { background-position: 54% 52%; }
  .hero::after { background: linear-gradient(0deg, rgba(11,31,27,.92), rgba(11,31,27,.53) 72%, rgba(11,31,27,.36)); }
  .hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
  .hero-brandline { gap: 12px; margin-bottom: 16px; }
  .hero-brandline img { width: 52px; height: 52px; }
  h1 { font-size: 43px; }
  .lead { margin-top: 16px; font-size: 16px; line-height: 1.7; }
  .hero-meta { justify-content: flex-start; margin-top: 20px; gap: 8px 14px; font-size: 12px; }
  .download-panel { padding: 34px 0 30px; }
  .section-heading { display: block; margin-bottom: 17px; }
  .section-heading h2, .about-section h2, .trust-section h2 { font-size: 25px; }
  .section-heading > p { max-width: none; margin-top: 8px; text-align: left; }
  .gallery-heading-actions { max-width: none; align-items: center; justify-content: space-between; margin-top: 10px; }
  .gallery-heading-actions p { max-width: 270px; text-align: left; font-size: 12px; }
  .gallery-controls button { width: 34px; height: 34px; }
  .download-actions { gap: 9px; }
  .download-button { min-height: 86px; grid-template-columns: 1fr; justify-items: center; gap: 6px; padding: 10px 7px; text-align: center; }
  .button-badge { min-width: 42px; padding: 6px 4px; font-size: 10px; }
  .button-copy { justify-items: center; gap: 3px; }
  .button-copy strong { font-size: 13px; line-height: 1.28; }
  .button-copy small { font-size: 10px; line-height: 1.28; }
  .button-arrow { display: none; }
  .download-notes { grid-template-columns: 1fr; gap: 9px; margin-top: 15px; }
  .download-notes p { padding-top: 10px; font-size: 11px; }
  .screenshots-section { padding: 32px 0 45px; }
  .screenshots-scroller { gap: 13px; margin-right: -14px; padding: 1px 14px 15px 1px; }
  .screenshot-item { flex: 0 0 154px; }
  .screenshot-item figcaption { padding-top: 10px; }
  .screenshot-item figcaption strong { font-size: 13px; }
  .screenshot-item figcaption span { font-size: 11px; }
  .screenshot-lightbox { display: flex; align-items: center; justify-content: center; padding: max(54px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); }
  .screenshot-lightbox figure { width: 100%; max-height: calc(100dvh - 76px); }
  .screenshot-lightbox figure img { max-height: calc(100dvh - 128px); }
  .lightbox-step { position: absolute; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); background: rgba(10,18,16,.5); }
  .lightbox-step:hover { transform: translateY(-50%); }
  .lightbox-previous { left: 10px; }
  .lightbox-next { right: 10px; }
  .about-section, .trust-section { grid-template-columns: 1fr; gap: 28px; padding: 36px 4px; }
  .about-intro { min-height: 320px; padding: 23px; }
  .about-intro > p:last-child { margin-top: 13px; font-size: 14px; }
  .feature-grid { gap: 17px 20px; }
  .feature-item { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding-top: 11px; }
  .feature-item p { font-size: 11px; }
  .trust-section { padding-top: 34px; padding-bottom: 38px; }
  footer { min-height: 86px; align-items: flex-start; padding-block: 18px; }
  .footer-links { max-width: 230px; text-align: right; }
}

@media (max-width: 360px) {
  .brand-copy small { display: none; }
  .download-button { min-height: 90px; }
  .button-copy strong { font-size: 12px; }
  .button-copy small { font-size: 9px; }
  .screenshot-item { flex-basis: 144px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .download-button, .screenshot-frame, .about-intro::before { transition: none; }
  .hero::before, .hero-copy, .screenshot-lightbox { animation: none; }
}
