:root {
  color-scheme: dark;
  font-family: "PingFang TC", "Noto Sans TC", sans-serif;
  background: #101010;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; }

body { overflow: hidden; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-brand {
  position: fixed;
  z-index: 11;
  top: calc(18px + env(safe-area-inset-top));
  left: 18px;
  display: block;
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 6px 16px #0009);
}

.site-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.site-brand:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.gallery-page {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #101010;
}

.gallery-page::after {
  content: "";
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  height: 290px;
  background: linear-gradient(transparent, #101010af 32%, #101010ed 75%, #101010f7);
  pointer-events: none;
}

.gallery-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  outline: none;
}

.gallery-viewport:active { cursor: grabbing; }

.gallery-viewport:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.gallery-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.gallery-tile {
  position: absolute;
  overflow: hidden;
  background: #292b2c;
}

.gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.6);
  transform-origin: center 30%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.language-overview {
  position: fixed;
  z-index: 9;
  bottom: calc(119px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  color: #f7f5f0;
  text-align: center;
  text-shadow: 0 2px 9px #000c;
  transform: translateX(-50%);
}

.language-overview h1 {
  margin: 0 0 5px;
  color: #f2f0eb;
  font: 400 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
  letter-spacing: .12em;
}

.language-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 4px;
}

.language-shortcuts button {
  min-height: 36px;
  padding: 6px 7px;
  border: 0;
  color: #f2f0eb;
  background: transparent;
  font: 400 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  white-space: nowrap;
  cursor: pointer;
}

.language-shortcuts button:hover,
.language-shortcuts button[aria-pressed="true"] { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; }

.store-downloads {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
}

.store-button {
  position: relative;
  flex: 0 1 168px;
  min-width: 0;
  min-height: 68px;
  padding: 8px 24px 8px 12px;
  border: 1px solid #f7f4ef;
  border-radius: 12px;
  background: #f7f4ef;
  color: #151515;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 25px #0005;
  transition: transform .18s ease, background .18s ease;
}

.store-button[data-store="android"] { border-color: #ffffff70; background: #111e; color: #fff; }
.store-button:hover { transform: translateY(-2px); }
.store-button[data-store="ios"]:hover { background: #fff; }
.store-button[data-store="android"]:hover { background: #292929f2; }
.store-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.store-copy { display: flex; flex-direction: column; gap: 2px; }
.store-copy small { font: 500 14px/1.2 "PingFang TC", "Noto Sans TC", sans-serif; }
.store-copy small span { margin-left: 3px; opacity: .65; }
.store-copy strong { font: 600 17px/1.1 "PingFang TC", "Noto Sans TC", sans-serif; white-space: nowrap; letter-spacing: -.01em; }
.store-arrow { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font: 17px/1 sans-serif; opacity: .62; }

.site-nav {
  position: fixed;
  z-index: 10;
  bottom: calc(44px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: calc(100vw - 28px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px;
  border: 1px solid #ffffff1b;
  border-radius: 999px;
  background: #0b0b0be8;
  box-shadow: 0 9px 35px #0008;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav > :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 21px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e9e9e9;
  font: 500 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.site-nav > :is(button, a):hover { background: #ffffff20; }

.site-nav > button[aria-pressed="true"] {
  background: #f6f6f6;
  color: #171717;
}

.site-nav :focus-visible,
.language-overview :focus-visible,
.gallery-tools :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.site-legal {
  position: fixed;
  z-index: 10;
  bottom: calc(13px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  color: #aaa9a5;
  font-size: 14px;
  line-height: 1.5;
  transform: translateX(-50%);
}

.site-legal a { color: #dedbd5; text-decoration: none; }
.site-legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-legal a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.gallery-tools { position: fixed; z-index: 11; top: calc(18px + env(safe-area-inset-top)); right: 18px; }

.gallery-tools summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid #ffffff26;
  border-radius: 50%;
  background: #111c;
  color: #fff;
  list-style: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.gallery-tools summary::-webkit-details-marker { display: none; }

.gallery-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 232px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #ffffff24;
  border-radius: 17px;
  background: #111e;
  box-shadow: 0 12px 32px #0004;
  backdrop-filter: blur(16px);
}

.site-language {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  padding: 6px 3px 11px;
  color: #c5c2ba;
  font: 500 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
}

.site-language select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #ffffff35;
  border-radius: 10px;
  color: #fff;
  background: #ffffff12;
  font: 500 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
  cursor: pointer;
}

.site-language select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.site-language option { color: #111; background: #fff; }

.gallery-toolbar button {
  min-height: 39px;
  border: 0;
  border-radius: 10px;
  color: #eee;
  background: #ffffff0b;
  font: 500 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif;
  cursor: pointer;
}

.gallery-toolbar button:hover { background: #ffffff20; }
.gallery-toolbar button[data-gallery-action="motion"] { grid-column: 1 / -1; }
.gallery-toolbar button[aria-pressed="true"] { color: #191919; background: #f5f3ed; }
.gallery-toolbar button:disabled { opacity: .4; cursor: default; }

.site-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 100px);
  margin: auto;
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #fff8;
  border-radius: 24px;
  color: #292922;
  background: #f6f4ef;
  box-shadow: 0 28px 100px #0005;
  color-scheme: light;
}

.site-dialog::backdrop { background: #0c101080; backdrop-filter: blur(5px); }
.site-dialog :focus-visible { outline: 2px solid #687258; outline-offset: 3px; }

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e9e6df;
  color: #333;
  font: 25px/1 sans-serif;
  cursor: pointer;
}

.dialog-close:hover { background: #dedad1; }
.dialog-eyebrow { margin: 4px 35px 16px 0; color: #74766a; font-size: 14px; line-height: 1.5; font-weight: 600; letter-spacing: .12em; }
.site-dialog h1 { margin: 0 0 14px; font: 500 28px/1.45 "Songti TC", "Noto Serif TC", serif; letter-spacing: .025em; white-space: pre-line; }
.dialog-intro { margin: 0 0 23px; color: #73736b; font-size: 16px; line-height: 1.75; }
.download-dialog { max-width: 420px; }
.download-dialog .dialog-intro { margin-bottom: 2px; }

.language-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.language-options button { min-height: 67px; padding: 10px 7px; border: 1px solid #dfddd5; border-radius: 12px; background: #ffffff7d; color: #33362d; font: 500 14px/1.4 "PingFang TC", "Noto Sans TC", sans-serif; overflow-wrap: anywhere; cursor: pointer; }
.language-options button span { display: block; margin-top: 3px; color: #84877b; font-size: 14px; line-height: 1.4; font-weight: 400; }
.language-options button[data-language="all"] { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 9px 15px; }
.language-options button[data-language="all"] span { margin: 0; }
.language-options button:hover { border-color: #959c85; background: #eeeee5; }
.language-options button[aria-pressed="true"] { border-color: #373e30; background: #373e30; color: #fff; }
.language-options button[aria-pressed="true"] span { color: #d6ddcd; }

.about-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 25px 0; padding: 20px 0; border-block: 1px solid #dcd9d0; }
.about-facts > div + div { border-left: 1px solid #dcd9d0; padding-left: 20px; }
.about-facts dt { color: #7c7f72; font-size: 14px; line-height: 1.5; }
.about-facts dd { margin: 5px 0 0; font: 38px/1.2 "Songti TC", "Noto Serif TC", serif; }
.about-facts dd span { margin-left: 5px; font-size: 14px; line-height: 1.5; }
.about-copy p { margin: 0 0 15px; color: #777970; font-size: 16px; line-height: 1.75; }
.about-copy strong { display: block; margin-bottom: 3px; color: #33382e; font-size: 16px; line-height: 1.5; font-weight: 500; }
.dialog-primary { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 47px; margin-top: 24px; padding: 12px 17px; border: 0; border-radius: 12px; background: #373e30; color: #fff; font: 500 14px/1.5 "PingFang TC", "Noto Sans TC", sans-serif; cursor: pointer; }
.dialog-primary:hover { background: #48503f; }
.dialog-primary span { font-size: 19px; }

@media (max-width: 600px) {
  .gallery-page::after { height: 320px; }
  .language-overview { width: calc(100vw - 24px); bottom: calc(110px + env(safe-area-inset-bottom)); }
  .site-nav { gap: 1px; max-width: calc(100vw - 16px); padding: 5px; bottom: calc(41px + env(safe-area-inset-bottom)); }
  .site-nav > :is(button, a) { min-height: 42px; padding: 0 8px; font-size: 14px; letter-spacing: 0; }
  .site-brand { top: calc(12px + env(safe-area-inset-top)); left: 12px; width: 68px; height: 68px; }
  .gallery-tools { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
  .site-legal { bottom: calc(10px + env(safe-area-inset-bottom)); }
  .site-dialog { padding: 27px 22px; border-radius: 21px; }
  .site-dialog h1 { font-size: 25px; }
  .about-facts > div + div { padding-left: 15px; }
}

@media (max-width: 360px) {
  .site-nav > :is(button, a) { padding: 0 5px; }
  .site-brand { width: 64px; height: 64px; }
  .store-button { min-height: 68px; padding: 7px 18px 7px 8px; }
  .store-copy strong { font-size: 16px; }
  .store-arrow { right: 8px; font-size: 14px; }
  .site-dialog { padding: 25px 17px; }
  .site-dialog h1 { font-size: 23px; }
  .about-facts dd { font-size: 32px; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
