/* jiaxuli.com: shared by every page (type, colour, nav, footer, buttons) */

@font-face {
  font-family: "SF Pro Web";
  src: url("../fonts/sf-pro.woff2") format("woff2-variations"), url("../fonts/sf-pro.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bg: #000;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --link: #2997ff;
  --blue: #0071e3;
  --hairline: rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 44px;
  --gutter: max(22px, env(safe-area-inset-left), env(safe-area-inset-right));
  --panel-max: 1120px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation; /* no double-tap zoom delay; pinch zoom still works */
}

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
sup { font-size: 0.6em; line-height: 0; vertical-align: super; margin-left: 1px; }
.footnote-ref { color: inherit; opacity: 0.75; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; letter-spacing: 0; color: #d6e2ff; }
em { font-style: normal; color: var(--text); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: #000; font-size: 14px;
  transform: translateY(-150%); transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; text-decoration: none; }

/* ---------------- Global navigation ---------------- */

.globalnav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.5s var(--ease);
}
.globalnav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: rgba(255, 255, 255, 0.06);
}
.globalnav-content {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 1024px; height: var(--nav-h); margin: 0 auto; padding: 0 var(--gutter);
}
.globalnav-logo {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: var(--nav-h); color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  opacity: 0.92; transition: opacity 0.3s;
}
.globalnav-logo:hover { opacity: 1; text-decoration: none; }
.globalnav-logo img { display: block; width: 22px; height: 22px; }
.globalnav-list { display: flex; flex: 1; justify-content: space-between; max-width: 760px; }
.globalnav-list a {
  display: block; padding: 0 8px; line-height: var(--nav-h);
  color: rgba(255, 255, 255, 0.8); font-size: 12px; letter-spacing: -0.01em;
  transition: color 0.3s;
}
.globalnav-list a:hover, .globalnav-list a[aria-current] { color: #fff; text-decoration: none; }
.globalnav-list a[aria-current="page"] { font-weight: 500; }
.globalnav-menu { display: none; }
.globalnav-curtain { display: none; }

@media (max-width: 833px) {
  .globalnav-menu {
    display: grid; place-items: center; position: relative;
    width: 44px; height: 44px; margin-right: -12px; padding: 0;
    border: 0; background: none; color: var(--text); cursor: pointer;
  }
  .globalnav-menu span {
    position: absolute; left: 14px; width: 16px; height: 1.2px; border-radius: 1px; background: currentColor;
    transition: transform 0.35s var(--ease);
  }
  .globalnav-menu span:first-child { transform: translateY(-3.5px); }
  .globalnav-menu span:last-child { transform: translateY(3.5px); }
  .globalnav.is-open .globalnav-menu span:first-child { transform: rotate(45deg); }
  .globalnav.is-open .globalnav-menu span:last-child { transform: rotate(-45deg); }

  .globalnav-list {
    position: fixed; left: 0; right: 0;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h) - env(safe-area-inset-top, 0px));
    flex-direction: column; justify-content: flex-start; max-width: none;
    padding: 20px calc(var(--gutter) + 26px) 40px;
    background: rgba(8, 8, 10, 0.985);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0;
    transition: opacity 0.32s var(--ease), visibility 0s linear 0.32s;
  }
  .globalnav.is-open .globalnav-list { visibility: visible; opacity: 1; transition: opacity 0.32s var(--ease); }
  .globalnav-list li { opacity: 0; transform: translateY(-8px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
  .globalnav.is-open .globalnav-list li {
    opacity: 1; transform: none;
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
    transition-delay: calc(60ms + var(--i, 0) * 25ms);
  }
  .globalnav-list a {
    padding: 6px 0; line-height: 1.15; font-family: var(--font-display);
    font-size: 28px; font-weight: 600; letter-spacing: 0.007em; color: #e8e8ed;
  }
  .globalnav.is-open { background: rgba(0, 0, 0, 0.86); }
}

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

/* ---------------- Buttons: Apple-style pills ---------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 28px; padding: 11px 22px; border: 1px solid transparent; border-radius: 980px;
  background: var(--blue); color: #fff;
  font-size: 17px; line-height: 1.17648; font-weight: 400; letter-spacing: -0.022em; white-space: nowrap;
  cursor: pointer; transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.button:hover { background: #0077ed; text-decoration: none; }
.button:active { transform: scale(0.98); }
.button-secondary { background: transparent; border-color: var(--link); color: var(--link); }
.button-secondary:hover { background: var(--link); color: #fff; }
.button-quiet { background: rgba(255, 255, 255, 0.1); color: var(--text); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.button-quiet:hover { background: rgba(255, 255, 255, 0.18); }
.button-small { padding: 7px 15px; font-size: 14px; line-height: 1.28577; letter-spacing: -0.016em; }
.button.out::after, .link.out::after { content: "\2197"; font-size: 0.85em; }
.link { white-space: normal; }
.link::after { content: "\00a0\203A"; }
.link.out::after { content: "\00a0\2197"; }

/* ---------------- Progressive blur veil (bottom up) ---------------- */

.veil {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: var(--veil-h, 62%);
  pointer-events: none;
  opacity: var(--veil-o, 1);
  transition: height 0.9s var(--ease), opacity 0.9s var(--ease);
}
.veil i { position: absolute; inset: 0; }
.veil i:nth-child(1) { display: none; } /* a 1px blur pass costs a full frame for almost nothing */
.veil i:nth-child(2) { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 78%); mask-image: linear-gradient(to top, #000 35%, transparent 78%); }
.veil i:nth-child(3) { -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  -webkit-mask-image: linear-gradient(to top, #000 25%, transparent 60%); mask-image: linear-gradient(to top, #000 25%, transparent 60%); }
.veil i:nth-child(4) { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to top, #000 12%, transparent 44%); mask-image: linear-gradient(to top, #000 12%, transparent 44%); }
.veil i:nth-child(5) {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.5) 30%, rgba(0, 0, 0, 0.16) 62%, transparent 100%);
}

/* ---------------- Footer ---------------- */

.globalfooter {
  position: relative; z-index: 2;
  background: #0b0b0d;
  color: var(--text-3);
  font-size: 12px; line-height: 1.33337; letter-spacing: -0.01em;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
}
.footer-content { max-width: 1024px; margin: 0 auto; padding: 22px var(--gutter) calc(22px + var(--safe-bottom)); }
.footer-notes { padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: #86868b; }
.footer-notes + .footer-notes { padding-top: 14px; }
.footer-notes ol { list-style: decimal; padding-left: 1.4em; }
.footer-notes li, .footer-notes p { margin-bottom: 9px; }
.footer-notes li:target { color: var(--text); }
.footer-directory { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; padding: 22px 0 28px; }
.directory-section + .directory-section { margin-top: 24px; }
.directory-title { font-size: 12px; font-weight: 600; line-height: 1.33; color: #e8e8ed; }
.directory-title button { all: unset; display: block; width: 100%; pointer-events: none; }
.directory-section ul { margin-top: 10px; }
.directory-section li { margin-bottom: 9px; }
.globalfooter a { color: #a1a1a6; }
.globalfooter a:hover { color: #e8e8ed; text-decoration: underline; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-legal-links { display: flex; }
.footer-legal-links li + li { margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.2); }

@media (max-width: 833px) {
  .footer-directory { grid-template-columns: 1fr; gap: 0; padding: 10px 0 18px; }
  .directory-section { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .directory-section + .directory-section { margin-top: 0; }
  .directory-title button { pointer-events: auto; cursor: pointer; padding: 12px 0; position: relative; }
  .directory-title button::after {
    content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
    border-right: 1.2px solid #a1a1a6; border-bottom: 1.2px solid #a1a1a6; transform: rotate(45deg);
    transition: transform 0.3s var(--ease), margin 0.3s var(--ease);
  }
  .directory-title button[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: -1px; }
  .js .directory-section ul { display: none; margin: 0; padding: 0 0 12px 8px; }
  .js .directory-section.is-open ul { display: block; }
  .footer-legal { flex-direction: column; }
}

@media (max-width: 734px) {
  :root { --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); }
}

/* Search stays available outside the mobile menu. */
.globalnav-search { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 44px; color: #e8e8ed; }
.globalnav-search:hover { color: #fff; }
@media (max-width: 833px) { .globalnav-search { margin-left: auto; } }
