:root {
  --site-bg: #fce8e4;
  --site-surface: #fff9f3;
  --site-surface-muted: #f4ded8;
  --site-ink: #122820;
  --site-dark: #0d241c;
  --site-accent: #c84422;
  --site-accent-text: #ad351c;
  --site-accent-soft: #efb3a4;
  --site-border: rgba(18, 40, 32, 0.16);
  --site-border-strong: rgba(18, 40, 32, 0.34);
  --site-muted: rgba(18, 40, 32, 0.68);
  --site-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --site-content: min(1240px, calc(100% - 10vw));
  --site-nav-height: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--site-bg);
  scroll-behavior: smooth;
}

body.site-page {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-ink);
  font-family: "Space Grotesk", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.site-page.menu-is-open {
  overflow: hidden;
}

body.case-page-shell {
  --site-bg: var(--page-bg);
  --site-ink: var(--text);
  --site-border: var(--line);
  --site-border-strong: var(--line);
  --site-muted: var(--muted);
  --site-dark: var(--page-bg);
  --site-accent: var(--text);
  --site-accent-text: var(--text);
}

a {
  color: inherit;
}

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

button {
  font: inherit;
}

img,
svg,
video {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: calc(var(--site-nav-height) + 8px);
  left: 8px;
  z-index: 1000;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--site-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  /* Keep the accessibility link fully outside the viewport until it receives focus. */
  transform: translateY(calc(-100% - var(--site-nav-height) - 8px));
  transition: transform 160ms var(--site-ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--site-accent);
  outline-offset: 4px;
}

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--site-nav-height);
  padding: 10px 5vw;
  border-bottom: 1px solid var(--site-border);
  background: color-mix(in srgb, var(--site-bg) 84%, transparent);
  box-shadow: 0 4px 20px -8px rgba(18, 40, 32, 0.22);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--site-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-symbol {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  position: relative;
  display: inline-grid;
  min-height: 30px;
  min-width: 72px;
  place-items: center;
  padding: 4px 14px;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--site-ink) 7%, transparent);
  color: var(--site-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms var(--site-ease), border-color 160ms var(--site-ease), color 160ms var(--site-ease), transform 160ms var(--site-ease);
}

.nav-pill .nav-text-en,
.nav-pill .nav-text-zh {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: opacity 140ms ease, transform 140ms var(--site-ease);
}

.nav-pill .nav-text-zh {
  opacity: 0;
  transform: translateY(4px);
}

.nav-pill:hover,
.nav-pill:focus-visible,
.nav-pill.is-active {
  border-color: var(--site-ink);
  background: var(--site-ink);
  color: var(--site-bg);
  transform: translateY(-1px);
}

.nav-pill:hover .nav-text-en,
.nav-pill:focus-visible .nav-text-en {
  opacity: 0;
  transform: translateY(-4px);
}

.nav-pill:hover .nav-text-zh,
.nav-pill:focus-visible .nav-text-zh {
  opacity: 1;
  transform: translateY(0);
}

.nav-pill.is-active .nav-text-en,
.nav-pill.is-active:hover .nav-text-en,
.nav-pill.is-active:focus-visible .nav-text-en {
  opacity: 1;
  transform: none;
}

.nav-pill.is-active .nav-text-zh,
.nav-pill.is-active:hover .nav-text-zh,
.nav-pill.is-active:focus-visible .nav-text-zh {
  opacity: 0;
  transform: translateY(4px);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 13px;
  border: 1px solid var(--site-ink);
  border-radius: 999px;
  background: var(--site-ink);
  color: #f3ede2;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.mobile-menu-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #62d391;
  box-shadow: 0 0 0 0 rgba(98, 211, 145, 0.18);
  animation: mobile-menu-pulse 2.2s ease-in-out infinite;
}

@keyframes mobile-menu-pulse {
  0%,
  100% {
    opacity: 0.68;
    box-shadow: 0 0 0 0 rgba(98, 211, 145, 0.16), 0 0 5px rgba(98, 211, 145, 0.18);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(98, 211, 145, 0.14), 0 0 12px rgba(98, 211, 145, 0.42);
  }
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 6vw 34px;
  background: var(--site-ink);
  color: #f3ede2;
  overflow-y: auto;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  overscroll-behavior: contain;
  transition: transform 500ms var(--site-ease), opacity 400ms ease;
}

.mobile-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.case-page-shell .mobile-drawer {
  background: var(--page-bg);
  color: var(--text);
}

.case-page-shell .mobile-menu-btn {
  border-color: var(--text);
  background: var(--text);
  color: var(--page-bg);
}

.case-page-shell .drawer-close-btn {
  border-color: color-mix(in srgb, var(--text) 32%, transparent);
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
}

.case-page-shell .drawer-footer {
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.drawer-close-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(243, 237, 226, 0.32);
  border-radius: 50%;
  background: rgba(243, 237, 226, 0.12);
  color: #f3ede2;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin: auto 0;
  padding: 48px 0;
}

.drawer-link {
  display: inline-flex;
  align-items: baseline;
  min-height: 44px;
  color: currentColor;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.drawer-link.is-active {
  color: #efb3a4;
}

.drawer-footer {
  border-top: 1px solid rgba(243, 237, 226, 0.24);
  padding-top: 18px;
}

.drawer-footer p,
.drawer-footer span {
  margin: 0;
}

.drawer-footer p {
  font-size: 14px;
}

.drawer-footer span {
  display: block;
  margin-top: 6px;
  color: rgba(243, 237, 226, 0.68);
  font-size: 12px;
}

.site-main {
  min-height: 60vh;
}

.site-footer {
  position: relative;
  margin-top: 80px;
  padding: 56px 5vw 32px;
  background: var(--site-dark);
  color: #fce8e4;
}

.site-footer-inner {
  width: var(--site-content);
  margin: 0 auto;
}

.site-footer-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid rgba(252, 232, 228, 0.24);
  padding-top: 20px;
}

.site-footer p {
  margin: 0;
}

.site-footer-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-footer-note {
  margin-top: 4px;
  color: rgba(252, 232, 228, 0.72);
  font-size: 13px;
}

.scroll-top {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  width: 48px;
  height: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  cursor: pointer;
  transition-property: background-color, border-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--site-ease);
}

.scroll-top:hover,
.scroll-top:focus-visible {
  border-color: #ffffff;
  background: #ffffff;
  color: #d94e28;
}

.scroll-top:active {
  transform: scale(0.96);
}

.back-to-top-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 5px 10px;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  color: var(--site-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-kicker.is-accent {
  border-color: var(--site-accent);
  color: var(--site-accent-text);
}

.template-note {
  color: var(--site-muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  :root {
    --site-content: min(1240px, calc(100% - 12vw));
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 540px) {
  .site-nav {
    padding-right: 5vw;
    padding-left: 5vw;
  }

  .nav-brand {
    font-size: 14px;
  }

  .site-footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
