:root {
  --gutter: clamp(1rem, 4.1vw, 3.5rem);
  --header-offset: 8.125rem;
}

html { scroll-padding-top: var(--header-offset); }
.wrap { width: min(1320px, calc(100% - 2 * var(--gutter))); }
picture { display: block; }
picture > img { height: auto; }
h1, h2, h3 { overflow-wrap: anywhere; }
.button {
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}
.status-note { border-left-color: #859cb3; }
:is(.site-header, .site-footer, .hero) :focus-visible {
  outline-color: #fff;
}
.site-header .brand { min-height: 44px; }
.nav-link, .language-select, .portal-button { min-height: 44px; }
.site-header .menu-toggle span { width: 22px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav-link[aria-current="page"], .service-nav[data-current] > .nav-link { font-weight: 600; }
.service-nav[data-current] > .nav-link::after { transform: scaleX(1); }
.service-dropdown a[aria-current="page"] span { text-decoration: underline; text-underline-offset: .25em; }

.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  height: auto;
  min-height: clamp(690px, 96svh, 900px);
  max-height: none;
}
.painting-slide > img { width: 100%; height: 100%; object-position: center 49%; }
.hero-shade {
  background:
    linear-gradient(90deg, #102a47a8 0%, #18375264 33%, #17334d16 68%, transparent),
    linear-gradient(0deg, #132b4670, transparent 31%);
}
.hero .hero-content {
  align-self: center;
  padding-block: clamp(8.25rem, 15vh, 10.5rem) 2.25rem;
}
.hero-content h1 { max-width: 100%; }
.hero-content .button.light { background-color: #132d4d55; }
.hero-content .button.light:hover { background-color: #fff; }
.hero-artwork-caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4.5rem;
}
.hero-artwork-caption .painting-credit {
  position: static;
  max-width: min(100%, 34rem);
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-size: .8125rem;
  text-align: end;
  opacity: 1;
  text-shadow: 0 1px 5px #071c36, 0 1px 12px #071c36;
}
.welcome { width: min(1400px, calc(100% - 60px)); }

.service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-card {
  display: grid;
  align-items: end;
  min-height: 365px;
  aspect-ratio: auto;
  padding: clamp(1.125rem, 2vw, 1.65rem);
  isolation: isolate;
}
.service-card > picture, .service-card > picture > img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}
.service-card::after {
  background: linear-gradient(0deg, #112c4bf5, #152e4eb3 47%, #17354b22 88%);
}
.service-card > div { position: relative; inset: auto; }
.about-image > picture, .approach-image > picture, .detail-art > picture,
.service-directory picture, .art-gallery picture {
  overflow: hidden;
  background: #eef2f6;
}
.about-image img { object-position: 50% 55%; }
.detail-art img { object-position: 50% 55%; }
.service-directory > article > picture img { aspect-ratio: 1.25; }
.service-directory > article:nth-child(even) > picture { grid-column: 2; grid-row: 1; }
.art-gallery article picture { margin-bottom: 1.875rem; }
.art-gallery article img { object-fit: contain; margin: 0; }

.market-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr); }
.market-frame { min-height: 0; overflow: clip; }
.market-loading, .market-fallback, .market-noscript {
  margin: 0;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.market-attribution {
  margin: 0;
  padding: .25rem 1rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
  text-align: center;
  color: #3b526c;
}
.market-attribution a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.market-frame .tradingview-widget-container,
.market-frame .tradingview-widget-container__widget { min-height: 0; }
.market-frame iframe { display: block; width: 100% !important; max-width: 100%; }
.market-category {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  font-weight: 500;
}
.market-category select {
  max-width: 100%;
  min-height: 44px;
  appearance: none;
  color: var(--ink);
  background: #f4f6f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23243f68' fill='none'/%3E%3C/svg%3E") right .75rem center no-repeat;
  border: 1px solid #a9b8c8;
  border-radius: .375rem;
  padding: .4rem 1.85rem .4rem .7rem;
  font-size: 1rem;
}
[hidden] { display: none !important; }
.world-clocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.world-clocks span, .footer-grid, .contact-layout, .legal-layout { overflow-wrap: anywhere; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
form select { min-width: 0; }
#form-result:empty { display: none; }
.essentials-section > article, .legal-layout section { scroll-margin-top: 0; }
.footer-languages { flex-wrap: wrap; }
.footer-languages a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-languages a[aria-current] { text-decoration: underline; text-underline-offset: .25em; }
dialog { max-height: calc(100dvh - 2rem); overflow: auto; }
.close-dialog { width: 44px; height: 44px; }
dialog h2 { max-width: 100%; }

@media (min-width: 1101px) {
  .site-header { gap: clamp(1rem, 2vw, 2rem); }
  .primary-nav, html[lang^="zh"] .primary-nav { gap: clamp(.875rem, 1.7vw, 1.7rem); }
}

@media (max-width: 1100px) {
  :root { --header-offset: 7rem; }
  .site-header .menu-toggle {
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }
  .menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: #ffffff17; }
  .primary-nav {
    max-height: calc(100dvh - 7.25rem);
    max-height: calc(100dvh - 7.25rem - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
  .primary-nav .nav-link { white-space: normal; }
  .primary-nav .nav-link[aria-current="page"], .service-nav[data-current] > .nav-link {
    color: #d0e4f6;
  }
  .service-dropdown a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .service-dropdown .dropdown-intro { padding-block: .25rem; }
  .service-dropdown { gap: .35rem 1rem; }
  .welcome { width: calc(100% - 40px); }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-card { min-height: clamp(330px, 40vw, 418px); }
  .market-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .section-heading { gap: clamp(1.5rem, 5vw, 3.125rem); }
  .reading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reading-grid h3, html[lang^="zh"] .reading-grid h3 { min-height: 0; }
}

@media (max-width: 760px) {
  :root { --header-offset: 6.25rem; }
  .site-header {
    top: max(.75rem, env(safe-area-inset-top));
    left: max(.75rem, env(safe-area-inset-left));
    right: max(.75rem, env(safe-area-inset-right));
    padding-inline: clamp(.75rem, 3.2vw, 1.25rem);
  }
  .site-header.scrolled { top: max(.625rem, env(safe-area-inset-top)); }
  .header-tools { gap: clamp(.25rem, 2.25vw, .875rem); }
  .primary-nav { padding: .55rem 1.25rem 1rem; border-radius: 1.25rem; }
  .service-dropdown { padding: .5rem 0 .65rem 1rem; }
  .language-select { padding-left: .375rem; }
  .hero {
    min-height: clamp(580px, 88svh, 735px);
  }
  .hero .hero-content {
    padding-block: clamp(7.5rem, 17svh, 10rem) 1.5rem;
  }
  .hero h1 {
    font-size: clamp(3rem, 11.7vw, 5.35rem);
    line-height: 1.045;
  }
  html[lang^="zh"] .hero h1 {
    font-size: clamp(2.85rem, 10vw, 4.5rem);
    line-height: 1.35;
  }
  .hero-content .eyebrow { font-size: .875rem; margin-bottom: 1.25rem; max-width: 100%; }
  .hero-content p { margin-top: 1.125rem; }
  .hero-shade {
    background:
      linear-gradient(90deg, #102a478a, #18375240 84%),
      linear-gradient(0deg, #132b4689, #132b460f 68%);
  }
  .painting-slide > img { object-position: 57% center; }
  .painting-slide:nth-child(2) > img { object-position: 63% center; }
  .painting-slide:nth-child(3) > img { object-position: 51% center; }
  .hero-artwork-caption { justify-content: flex-start; padding-bottom: 3.4rem; }
  .hero-artwork-caption .painting-credit { text-align: start; }
  .welcome { width: calc(100% - 2 * var(--gutter)); padding: 2.5rem 1.125rem 3.5rem; }
  .page-intro {
    padding-top: clamp(7.6rem, 19vw, 9rem);
    padding-bottom: clamp(2.25rem, 8vw, 3rem);
  }
  .page-intro h1 {
    font-size: clamp(2.35rem, 7.8vw, 3.1rem);
    line-height: 1.13;
  }
  html[lang^="zh"] .page-intro h1 { font-size: clamp(2.25rem, 7.7vw, 2.8rem); }
  .section-heading h2, .approach-copy h2 { font-size: clamp(2rem, 7vw, 2.4rem); }
  .connect h2, html[lang^="zh"] .connect h2 { font-size: clamp(2.1rem, 7.5vw, 2.8rem); }
  .section-heading > .text-link, .related-services a, .legal-jump { min-height: 44px; }
  .legal-jump { display: inline-flex; align-items: center; padding-block: .375rem; }
  .service-directory > article > picture img { aspect-ratio: 1.4; }
  .art-gallery article picture { margin-bottom: 1.5rem; }
  .art-gallery article img { margin: 0; }
  .footer-bottom { gap: .25rem; }
  .footer-top { grid-template-columns: minmax(0, 1fr) auto; }
  .footer-top .text-link { text-align: end; }
  .footer-link { display: flex; align-items: center; min-height: 40px; margin-bottom: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .service-grid { grid-template-columns: minmax(0, 1fr); }
  .service-card { min-height: clamp(288px, 74vw, 372px); padding: 1.375rem; }
  .service-card h3, html[lang^="zh"] .service-card h3 { font-size: clamp(1.6rem, 5.5vw, 2rem); }
  .service-card p { line-height: 1.55; }
  .service-dropdown { grid-template-columns: minmax(0, 1fr); }
  .market-copy .world-clocks, .markets-clock-row .world-clocks { gap: .55rem; }
  .markets-clock-row .world-clocks > div { padding-top: 1rem; }
  .markets-clock-row .world-clocks time, .world-clocks time {
    font-size: clamp(1.35rem, 5.6vw, 1.7rem);
  }
  .contact-form .button, .resource-grid .button { width: 100%; }
  .resource-grid article, .data-note, .form-notice { padding: clamp(1rem, 5vw, 1.75rem); }
  .footer-languages { gap: .4rem 1.25rem; }
}

@media (max-width: 360px) {
  .site-header .brand { gap: .4rem; }
  .site-header .brand-mark { width: 28px; height: 28px; }
  .site-header .wordmark-zh { width: 5.1rem; }
  .site-header .header-tools { gap: .15rem; }
  .hero-content .eyebrow { letter-spacing: .075em; }
  .footer-grid { gap: 1.65rem .8rem; }
}

@media (max-height: 500px) and (max-width: 1100px) {
  .hero { min-height: 32rem; }
  .hero .hero-content { padding-top: 7rem; }
  .site-header, .site-header.scrolled { height: 60px; }
  .primary-nav { max-height: calc(100dvh - 5.5rem); }
}
