@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --paper: #f2f2f0;
  --ink: #242522;
  --muted: #666762;
  --plum: #5a3458;
  --plum-dark: #40243e;
  --line: rgba(36, 37, 34, 0.13);
  --surface: rgba(255, 255, 255, 0.66);
  --header-bg: rgba(242, 242, 240, 0.9);
  --portrait-bg: #e2e2de;
  --profile-link: #596672;
  --profile-link-hover: #293944;
  --shadow: 0 20px 55px rgba(42, 43, 39, 0.09);
  --banner-overlay: linear-gradient(rgba(20, 24, 34, 0.46), rgba(20, 24, 34, 0.54));
  --serif: "Newsreader", "Noto Serif SC", Georgia, serif;
  --sans: "Manrope", "Noto Sans SC", "Segoe UI", sans-serif;
}

:root[data-theme="comfort"] {
  color-scheme: light;
  --paper: #f5f1e8;
  --ink: #25231f;
  --muted: #6c665e;
  --line: rgba(37, 35, 31, 0.16);
  --surface: rgba(255, 253, 248, 0.58);
  --header-bg: rgba(245, 241, 232, 0.9);
  --portrait-bg: #e2dbcf;
  --profile-link: #694b60;
  --profile-link-hover: #4c3048;
  --shadow: 0 20px 55px rgba(54, 43, 34, 0.12);
  --banner-overlay: linear-gradient(rgba(28, 25, 22, 0.44), rgba(28, 25, 22, 0.52));
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1d1a1e;
  --ink: #f2eee7;
  --muted: #b9b0a7;
  --plum: #ad8eab;
  --plum-dark: #c3a9c1;
  --line: rgba(242, 238, 231, 0.16);
  --surface: rgba(255, 255, 255, 0.055);
  --header-bg: rgba(29, 26, 30, 0.9);
  --portrait-bg: #312c32;
  --profile-link: #aab0b9;
  --profile-link-hover: #c4c9d0;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
  --banner-overlay: linear-gradient(rgba(10, 9, 12, 0.56), rgba(10, 9, 12, 0.64));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(90, 52, 88, 0.08), transparent 26rem),
    radial-gradient(circle at 8% 92%, rgba(112, 130, 118, 0.08), transparent 22rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--plum);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--plum-dark);
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  color: #fff;
  background: var(--plum-dark);
  transform: translateY(-200%);
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.page-shell,
.footer-shell {
  width: min(1060px, calc(100% - 3rem));
  margin: 0 auto;
}

.nav-shell {
  width: calc(100% - 3rem);
  max-width: none;
  margin: 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding-left: 111px;
}

.brand-marks {
  position: absolute;
  right: auto;
  left: 0;
  width: 96px;
  height: auto;
  max-width: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--plum);
}

.theme-toggle {
  display: none;
}

.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  align-self: center;
  box-shadow: 0 4px 16px rgba(40, 39, 36, 0.05);
}

.theme-choice {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  line-height: 0;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-choice:hover {
  color: var(--plum);
}

.theme-choice[aria-pressed="true"] {
  color: var(--plum-dark);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 2px 8px rgba(40, 39, 36, 0.12);
}

:root[data-theme="dark"] .theme-choice[aria-pressed="true"] {
  color: var(--plum-dark);
  background: rgba(255, 255, 255, 0.12);
}

.campus-banner {
  position: relative;
  width: 100%;
  height: clamp(190px, 15vw, 235px);
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-image: var(--banner-overlay), url("../img/cuhk-campus-banner.jpg");
  background-position: center, center 48%;
  background-size: cover;
  box-shadow: none;
}

.campus-banner-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding-top: 2.25rem;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.46);
}

.has-campus-banner .home {
  padding-top: clamp(2.5rem, 5vh, 3.75rem);
}

.has-campus-banner .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: linear-gradient(rgba(12, 14, 20, 0.38), rgba(12, 14, 20, 0.08));
  backdrop-filter: none;
}

.has-campus-banner .brand,
.has-campus-banner .nav-links a {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.38);
}

.has-campus-banner .nav-links a:hover,
.has-campus-banner .nav-links a[aria-current="page"] {
  color: #fff;
}

.has-campus-banner .theme-switch {
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(16, 18, 25, 0.24);
  box-shadow: none;
}

.has-campus-banner .theme-choice {
  color: rgba(255, 255, 255, 0.78);
}

.has-campus-banner .theme-choice:hover,
.has-campus-banner .theme-choice[aria-pressed="true"],
:root[data-theme="dark"] .has-campus-banner .theme-choice[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.journal-banner {
  height: clamp(190px, 15vw, 235px);
}

.journal-banner-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.25rem 1.5rem 0;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.5);
}

.journal-banner-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.journal-banner-subtitle {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.journal-banner-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 4.55rem);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.journal-banner-title.is-long {
  font-size: clamp(2.55rem, 4.3vw, 3.9rem);
}

.journal-banner-title-zh {
  margin: 0.5rem 0 0;
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1;
}

.home {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(4.25rem, 9vw, 7.25rem);
  align-items: start;
  padding: clamp(2.75rem, 6vh, 4.25rem) 0 clamp(1.75rem, 3vh, 2.5rem);
}

.home-copy {
  grid-column: 2;
  grid-row: 1;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--plum);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.affiliation {
  margin: 0 0 1.15rem;
  color: var(--plum);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  font-weight: 520;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.home h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.65rem, 4vw, 3.5rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

html[lang="zh-Hans"] .home h1 {
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.role {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.03rem, 1.65vw, 1.25rem);
  font-style: normal;
}

.pronunciation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.015em;
}

.pronunciation-label {
  font-weight: 600;
}

.pronunciation-item {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.pronunciation-item strong {
  color: var(--ink);
  font-weight: 600;
}

.pronunciation-play {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-grid;
  place-items: center;
  margin-left: 0.12rem;
  padding: 0;
  border: 1px solid rgba(90, 52, 88, 0.28);
  border-radius: 50%;
  color: var(--plum);
  background: transparent;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.pronunciation-play:hover,
.pronunciation-play:focus-visible,
.pronunciation-play.is-playing {
  border-color: var(--plum);
  color: var(--paper);
  background: var(--plum);
}

.pronunciation-play:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.pronunciation + .role {
  margin-top: 0.65rem;
}

.intro {
  max-width: 650px;
  margin: 1.15rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.04rem, 1.6vw, 1.2rem);
  line-height: 1.58;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.05rem;
  margin-top: 1.45rem;
}

.profile-links a {
  width: 34px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--profile-link);
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.profile-links .ssrn-link {
  width: 54px;
  border-radius: 0;
}

.ssrn-mark {
  font-size: 2rem;
  line-height: 1;
  transform: scaleX(1.3);
  transform-origin: center;
}

.profile-links a:hover {
  color: var(--profile-link-hover);
  background: transparent;
  transform: translateY(-1px);
}

.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;
}

.portrait-wrap {
  position: relative;
  width: min(100%, 275px);
  margin: 0 0 0 2rem;
  justify-self: start;
  grid-column: 1;
  grid-row: 1;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 0.65rem;
  background: var(--portrait-bg);
  box-shadow: var(--shadow);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: rgba(90, 52, 88, 0.75);
  font-family: var(--serif);
  font-size: 4rem;
}

.portrait-frame.is-fallback img {
  display: none;
}

.portrait-frame.is-fallback .portrait-fallback {
  display: grid;
}

.research-section {
  padding: clamp(1.75rem, 3vw, 2.75rem) 0 clamp(3.5rem, 6vw, 5.5rem);
  border-top: 1px solid var(--line);
}

.research-heading {
  display: block;
  margin-bottom: 1rem;
}

.research-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 520;
  letter-spacing: -0.035em;
  line-height: 1;
}

.research-heading p {
  margin: 1rem 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-weight: 550;
  letter-spacing: -0.01em;
}

.paper-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding: 0;
}

.paper-entry h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 560;
  line-height: 1.25;
}

.paper-authors {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.paper-authors a {
  color: inherit;
  text-decoration-color: rgba(90, 52, 88, 0.38);
  text-underline-offset: 0.16em;
}

.paper-authors a:hover {
  color: var(--plum);
  text-decoration-color: currentColor;
}

.paper-award {
  margin: 0.85rem 0 0;
  color: var(--plum);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.paper-link {
  color: var(--plum);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.paper-link:hover {
  text-decoration: underline;
}

.cv-page {
  width: min(1180px, calc(100% - 3rem));
  min-height: calc(100svh - 130px);
  margin: 0 auto;
  padding: 1.4rem 0 2rem;
}

.cv-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.4rem;
}

.cv-heading-actions {
  justify-content: flex-end;
}

.cv-frame-layout {
  position: relative;
}

.cv-frame-layout > .cv-open {
  position: absolute;
  top: 0;
  left: calc(100% + 1.15rem);
  z-index: 2;
  white-space: nowrap;
}

.cv-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 520;
  letter-spacing: -0.02em;
  line-height: 1;
}

.cv-open {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: #fff;
  background: var(--plum);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.cv-open:hover {
  color: #fff;
  background: var(--plum-dark);
}

@media (max-width: 1500px) and (min-width: 761px) {
  .cv-page {
    padding-top: 4rem;
  }

  .cv-frame-layout > .cv-open {
    top: -3rem;
    right: 0;
    left: auto;
  }
}

.cv-frame-shell {
  width: 100%;
  height: calc(100svh - 180px);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
}

.cv-frame {
  display: block;
  width: 100%;
  height: 100%;
  margin-left: 0;
  border: 0;
  background: #fff;
}

.trail-journal {
  width: min(1160px, calc(100% - 3rem));
  display: grid;
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  gap: clamp(3rem, 5vw, 4.5rem);
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
}

.trail-sidebar {
  position: static;
  min-width: 0;
  align-self: start;
  padding-right: 1.5rem;
  border-right: 1px solid var(--line);
}

.life-journal,
.route-journal {
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
}

.trail-sidebar-label {
  margin: 0 0 0.9rem;
  color: var(--plum);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.trail-index {
  display: grid;
}

.trail-index a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.52rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease, padding-left 150ms ease;
}

.trail-index a:last-child {
  border-bottom: 1px solid var(--line);
}

.trail-index a:hover,
.trail-index a[aria-current="page"] {
  padding-left: 0.25rem;
  color: var(--plum);
}

.trail-number {
  padding-top: 0.2rem;
  color: var(--plum);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.trail-index strong,
.trail-index small {
  display: block;
}

.trail-index strong {
  color: inherit;
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 560;
  line-height: 1.22;
}

.trail-index a[href*="luk-chau-stone-bushland"] strong {
  white-space: nowrap;
}

.trail-index small {
  margin-top: 0.22rem;
  color: var(--muted);
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.22;
}

@media (min-width: 761px) {
  .trail-sidebar-label,
  .trail-index {
    margin-left: -1rem;
  }
}

.trail-journal-content {
  min-width: 0;
}

.life-intro {
  max-width: 720px;
}

.journal-page .life-lede {
  margin-top: 0;
}

.life-intro .eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.11em;
}

.life-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 4.55rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.life-lede {
  max-width: 650px;
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  line-height: 1.6;
}

.trail-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.35rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.life-journal .trail-feature-grid {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
}

.trail-card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--portrait-bg);
  box-shadow: var(--shadow);
  color: #fff;
  text-decoration: none;
}

.trail-card:hover,
.trail-card:focus-visible {
  color: #fff;
}

.trail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.trail-card:hover img {
  transform: scale(1.025);
}

.trail-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(24, 19, 23, 0.72));
}

.trail-card-copy {
  position: absolute;
  right: 1.15rem;
  bottom: 1rem;
  left: 1.15rem;
}

.trail-card-copy small,
.trail-card-copy strong {
  display: block;
}

.trail-card-copy small {
  margin-bottom: 0.28rem;
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.trail-card-copy strong {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 560;
  line-height: 1.05;
}

.route-header {
  margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

.route-kicker {
  margin: 0 0 0.7rem;
  color: var(--plum);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.route-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.1rem);
  font-weight: 520;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

@media (min-width: 1120px) {
  [data-hike-page="luk-chau-stone-bushland"] .route-title {
    font-size: clamp(3rem, 4.1vw, 3.75rem);
    white-space: nowrap;
  }
}

.route-title-zh {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
  font-size: clamp(1.38rem, 2vw, 1.55rem);
  font-weight: 700;
}

.route-gallery {
  position: relative;
  width: min(100%, 780px);
  height: clamp(600px, 52.8vw, 672px);
  overflow: hidden;
  border-radius: 0.8rem;
  background: #171419;
  box-shadow: var(--shadow);
}

[data-hike-page="victoria-peak"] .route-gallery,
[data-hike-page="lai-chi-wo"] .route-gallery,
[data-hike-page="lantau-trail"] .route-gallery,
[data-hike-page="luk-chau-stone-bushland"] .route-gallery,
[data-hike-page="pat-sin-leng"] .route-gallery {
  width: min(100%, 750px);
}

[data-hike-page="lamma-island"] .route-gallery,
[data-hike-page="ma-on-shan"] .route-gallery {
  width: min(100%, 750px);
}

[data-hike-page="sai-kung-north"] .route-gallery {
  width: min(100%, 800px);
}

[data-hike-page="tai-mo-shan"] .route-gallery,
[data-hike-page="kai-kung-leng"] .route-gallery {
  width: min(100%, 800px);
  height: clamp(480px, 45.6vw, 552px);
}

@media (min-width: 1208px) {
  .route-gallery {
    width: min(936px, calc(100% + 50vw - 604px));
  }

  [data-hike-page="victoria-peak"] .route-gallery,
  [data-hike-page="lai-chi-wo"] .route-gallery,
  [data-hike-page="lantau-trail"] .route-gallery,
  [data-hike-page="luk-chau-stone-bushland"] .route-gallery,
  [data-hike-page="pat-sin-leng"] .route-gallery,
  [data-hike-page="lamma-island"] .route-gallery,
  [data-hike-page="ma-on-shan"] .route-gallery {
    width: min(900px, calc(100% + 50vw - 604px));
  }

  [data-hike-page="sai-kung-north"] .route-gallery,
  [data-hike-page="tai-mo-shan"] .route-gallery,
  [data-hike-page="kai-kung-leng"] .route-gallery {
    width: min(960px, calc(100% + 50vw - 604px));
  }
}

.route-gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.route-gallery-track::-webkit-scrollbar {
  display: none;
}

.route-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.route-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.route-gallery-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 20, 25, 0.68);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 1.15rem;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 160ms ease, opacity 160ms ease;
}

.route-gallery-button:hover {
  background: rgba(90, 52, 88, 0.92);
}

.route-gallery-button:disabled {
  opacity: 0.26;
  cursor: default;
}

.route-gallery-previous {
  left: 1rem;
}

.route-gallery-next {
  right: 1rem;
}

.route-gallery-autoplay {
  position: absolute;
  bottom: 0.9rem;
  left: 1rem;
  z-index: 2;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 20, 25, 0.68);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease;
}

.route-gallery-autoplay:hover {
  background: rgba(90, 52, 88, 0.92);
}

.route-gallery-count {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  z-index: 2;
  margin: 0;
  padding: 0.32rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 20, 25, 0.68);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.route-note {
  max-width: 650px;
  margin: 1.4rem 0 0;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.route-pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.route-pager a {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.route-pager a:hover {
  color: var(--plum);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-pronunciation {
  width: min(1060px, calc(100% - 3rem));
  justify-content: flex-start;
  margin: 0 auto;
  padding: 0.65rem 0 0.1rem;
  font-family: "Crimson Pro", "Newsreader", Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
}

.footer-pronunciation .pronunciation-label,
.footer-pronunciation .pronunciation-item strong {
  font-weight: 400;
}

.footer-pronunciation .pronunciation-play {
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.08rem;
  font-size: 0.58rem;
}

.footer-shell {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-family: "Crimson Pro", "Newsreader", Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.35;
}

.footer-shell p {
  margin: 0;
}

.footer-shell a {
  color: inherit;
  text-decoration: none;
}

.footer-copyright {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.footer-last-update {
  grid-column: 1;
  justify-self: start;
  white-space: nowrap;
}

.footer-site-visits {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid rgba(90, 52, 88, 0.34);
  outline-offset: 4px;
}

@media (max-width: 1275px) {
  .brand-marks {
    display: none;
  }

  .brand {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .nav-shell,
  .page-shell,
  .footer-shell,
  .footer-pronunciation {
    width: min(100% - 2rem, 1060px);
  }

  .nav-shell {
    gap: 0.7rem;
  }

  .nav-actions {
    gap: 0.55rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a {
    font-size: 0.82rem;
  }

  .theme-switch {
    gap: 1px;
    padding: 2px;
  }

  .theme-choice {
    width: 25px;
    height: 25px;
  }

  .theme-icon {
    width: 14px;
    height: 14px;
  }

  .campus-banner {
    width: 100%;
    height: 190px;
    margin: 0;
    border-radius: 0;
    background-position: center, 48% 50%;
  }

  .journal-banner-copy {
    padding: 5.1rem 0.75rem 0;
  }

  .journal-banner-title {
    font-size: clamp(2.35rem, 11vw, 3rem);
  }

  .journal-banner-title.is-long {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
    line-height: 0.94;
  }

  .journal-banner-kicker {
    margin-bottom: 0.22rem;
    font-size: 0.62rem;
  }

  .journal-banner-title-zh {
    margin-top: 0.32rem;
    font-size: 1.18rem;
  }

  .home {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2.1rem 0 3rem;
  }

  .portrait-wrap {
    width: min(70vw, 285px);
    justify-self: start;
    grid-row: 1;
    grid-column: 1;
    margin-left: 0.45rem;
  }

  .home-copy {
    grid-row: 2;
    grid-column: 1;
  }

  .home h1 {
    font-size: clamp(2.5rem, 12vw, 3.2rem);
  }

  .paper-entry {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .footer-shell {
    min-height: auto;
    padding: 0.65rem 0;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
  }

  .footer-pronunciation {
    font-size: 0.82rem;
  }

  .cv-page {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .cv-frame-layout {
    display: flex;
    flex-direction: column;
  }

  .cv-frame-layout > .cv-open {
    position: static;
    align-self: flex-end;
    margin-bottom: 0.75rem;
  }

  .cv-heading {
    align-items: center;
  }

  .cv-frame-shell {
    height: calc(100svh - 160px);
    min-height: 620px;
  }

  .trail-journal {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
    padding-top: 2.5rem;
  }

  .trail-sidebar {
    position: static;
    width: 100%;
    padding: 0 0 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trail-index {
    grid-auto-flow: column;
    grid-auto-columns: minmax(155px, 0.72fr);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .trail-index a {
    padding-right: 1rem;
    border-bottom: 1px solid var(--line);
  }

  [data-hike-page] .route-gallery,
  .route-gallery-track {
    height: auto;
  }

  .route-slide {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 620px) {
  .trail-feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .nav-shell {
    min-height: auto;
    padding: 0.7rem 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
