@font-face {
  font-family: 'Qingyoujian Calligraphy';
  src: url('assets/fonts/qingyoujian-calligraphy.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* The approved 887px-wide reference is the mobile coordinate system.
   The full header, image, copy, action and footer share one native scroller.
   Keep the page/viewport classes: product-dialog.js uses them for horizontal
   neighbouring-page previews, not as independently scrolling panels. */
#product-dialog {
  --folio-bg: #000;
  --folio-text: #e6e7df;
  --folio-soft: #aeb4ad;
  --folio-muted: #858d83;
  --folio-line: #b6decd;
  --reference-unit: calc(100vw / 887);
  --detail-gutter: calc(var(--reference-unit) * 54);
  --reference-header-height: calc(var(--reference-unit) * 150);
  --reference-photo-height: calc(var(--reference-unit) * 970);
  --reference-title-space: calc(var(--reference-unit) * 155);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  color: var(--folio-text);
  overflow: hidden;
  touch-action: pan-y;
}

#product-dialog::backdrop { background: #000; backdrop-filter: none; }
#product-dialog *,
#product-dialog *::before,
#product-dialog *::after { box-sizing: border-box; }
#product-dialog [hidden] { display: none !important; }

#product-dialog .dialog-shell {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: #000;
}
#product-dialog .dialog-shell::-webkit-scrollbar { display: none; }

#product-dialog .dialog-topbar {
  position: relative;
  inset: auto;
  z-index: 4;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  width: 100%;
  max-width: none;
  height: max(62px, var(--reference-header-height));
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: max(env(safe-area-inset-top), calc(var(--reference-unit) * 27)) var(--detail-gutter) 0;
  border: 0;
  background: #000;
}

#product-dialog .dialog-topbar .dialog-close {
  position: static;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #dedfd9;
}
#product-dialog .dialog-topbar .dialog-close > span { display: none; }
#product-dialog .dialog-topbar .dialog-close > svg {
  display: block;
  width: max(23px, calc(var(--reference-unit) * 49));
  height: max(22px, calc(var(--reference-unit) * 41));
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

/* The supplied logo asset retains its original colour. */
#product-dialog .dialog-topbar .dialog-brand,
#product-dialog .dialog-brand,
#product-dialog .dialog-brand .brand-logo-frame,
#product-dialog .dialog-brand .brand-logo-frame img {
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
}
#product-dialog .dialog-topbar .dialog-brand {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: fit-content;
  margin: 0;
  padding: 0;
}
#product-dialog .dialog-brand .brand-logo-frame {
  width: max(66px, calc(var(--reference-unit) * 148));
  aspect-ratio: 2.05;
}
#product-dialog .dialog-topbar .dialog-catalog-label,
#product-dialog .dialog-topbar > .dialog-catalog-location,
#product-dialog .dialog-category { display: none; }

#product-dialog .dialog-product-viewport {
  position: relative;
  display: block;
  grid-area: auto;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  contain: none;
  background: #000;
}
#product-dialog .dialog-product-page {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: #000;
}
#product-dialog .dialog-product-preview { overflow: hidden; background: #000; }

#product-dialog .dialog-main {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}
#product-dialog .dialog-gallery {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: #000;
}
#product-dialog #photo-window {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-area: auto;
  width: 100%;
  height: var(--reference-photo-height);
  min-width: 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: 887 / 970;
  margin: 0;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
  background: #000;
  touch-action: pan-y;
}
#product-dialog[data-view] #photo-window::before,
#product-dialog[data-view] #photo-window::after {
  display: none;
  content: none;
  background: none;
}
#product-dialog .dialog-swipe-window {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  background: #000;
}
#product-dialog #dialog-object,
#product-dialog .dialog-swipe-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  overflow: hidden;
}
#product-dialog[data-view='glaze'] #photo-window { touch-action: none; }
#product-dialog .dialog-image-nav,
#product-dialog #photo-window :is(#dialog-previous, #dialog-next),
#product-dialog .dialog-image-caption { display: none; }

#product-dialog .dialog-gallery > #dialog-title {
  position: absolute;
  z-index: 3;
  inset: calc(var(--reference-unit) * 48) auto auto var(--detail-gutter);
  grid-area: auto;
  width: auto;
  max-width: calc(var(--reference-unit) * 110);
  max-height: calc(var(--reference-photo-height) - var(--reference-unit) * 100);
  margin: 0;
  padding: 0;
  color: #b6bfa9;
  font: 400 calc(var(--reference-unit) * 96)/1 'Qingyoujian Calligraphy', 'Kaiti SC', STKaiti, KaiTi, var(--serif, serif);
  letter-spacing: .08em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  overflow-wrap: normal;
  white-space: nowrap;
  opacity: 1;
  pointer-events: none;
}
#product-dialog .dialog-gallery > .dialog-catalog-location,
#product-dialog #photo-window > .dialog-catalog-location {
  position: absolute;
  z-index: 3;
  inset: calc(var(--reference-unit) * 24) var(--detail-gutter) auto auto;
  grid-area: auto;
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  opacity: 1;
}
#product-dialog .dialog-catalog-count {
  color: #d3d8d0;
  font: 400 max(12px, calc(var(--reference-unit) * 28))/1.5 var(--serif, serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
  white-space: nowrap;
}

/* Only the approved first-piece scene already contains the exact title and
   01/08 from the reference. Its live HTML remains available to accessibility. */
#product-dialog .dialog-product-page[data-product-id='object-01'][data-view='shape'][data-photo-art='true'] .dialog-gallery > #dialog-title,
#product-dialog .dialog-product-page[data-product-id='object-01'][data-view='shape'][data-photo-art='true'] .dialog-gallery > .dialog-catalog-location,
#product-dialog .dialog-product-page[data-product-id='object-01'][data-view='shape'][data-photo-art='true'] #photo-window > .dialog-catalog-location { opacity: 0; }

/* The remaining original photographs still fit completely alongside their
   live title. The SVG <image> dimensions and viewBox stay under JS control. */
#product-dialog .dialog-product-page[data-photo-art='false'] #dialog-object,
#product-dialog .dialog-swipe-layer[data-photo-art='false'] .dialog-swipe-image {
  width: calc(100% - var(--reference-title-space));
  margin-left: var(--reference-title-space);
}

#product-dialog .dialog-gallery > .dialog-modes--top {
  display: flex;
  grid-area: auto;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: calc(var(--reference-unit) * 68);
  width: 100%;
  height: max(44px, calc(var(--reference-unit) * 100));
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 var(--detail-gutter);
  border: 0;
  background: #000;
}
#product-dialog .dialog-copy .dialog-modes--copy { display: none; }
#product-dialog .dialog-modes > .dialog-mode-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: max(44px, calc(var(--reference-unit) * 100));
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 0 calc(var(--reference-unit) * 10);
  border: 0;
  border-radius: 0;
  background: none;
  color: #a7aea6;
  font: 400 max(14px, calc(var(--reference-unit) * 31))/1.55 var(--serif, serif);
  letter-spacing: .035em;
}
#product-dialog .dialog-modes > .dialog-mode-button[aria-pressed='true'] { color: #e1e5dc; }
#product-dialog .dialog-modes > .dialog-mode-button::after {
  right: auto;
  bottom: calc(var(--reference-unit) * 3);
  left: 0;
  width: calc(var(--reference-unit) * 85);
  height: max(1px, calc(var(--reference-unit) * 4));
  background: #b9e2d3;
}

#product-dialog .dialog-copy {
  display: block;
  align-self: auto;
  justify-self: auto;
  width: 100%;
  max-width: none;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: calc(var(--reference-unit) * 28) var(--detail-gutter) 0;
  overflow: visible;
  scrollbar-gutter: auto;
}
#product-dialog #dialog-subtitle,
#product-dialog #dialog-description { display: none; }
#product-dialog .dialog-copy > .eyebrow {
  display: block;
  grid-area: auto;
  margin: 0 0 calc(var(--reference-unit) * 24);
  padding: 0;
  border: 0;
  color: #b4bcb1;
  font: 400 max(12px, calc(var(--reference-unit) * 28))/1.6 var(--serif, serif);
  letter-spacing: .035em;
}
#product-dialog .dialog-facts {
  display: block;
  grid-area: auto;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}
#product-dialog .dialog-facts > div {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}
#product-dialog .dialog-facts > div + div { margin-top: 0; }
#product-dialog .dialog-facts dt { display: none; }
#product-dialog .dialog-facts dd {
  margin: 0;
  color: #d9dfd1;
  font: 400 max(16px, calc(var(--reference-unit) * 38))/1.65 var(--serif, serif);
  letter-spacing: .015em;
  overflow-wrap: anywhere;
}
#product-dialog .dialog-consult {
  display: block;
  grid-area: auto;
  width: 100%;
  min-width: 0;
  margin: calc(var(--reference-unit) * 68) 0 0;
  padding: 0;
}
#product-dialog .dialog-consult a#dialog-album-link.ui49-primary,
#product-dialog .dialog-consult a#dialog-album-link.ui49-primary:is(:link, :visited, :hover, :active, :focus, :focus-visible) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-self: stretch;
  gap: 20px;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 52px;
  margin: 0;
  padding: calc(var(--reference-unit) * 8) 0;
  border: 0;
  border-bottom: max(1px, calc(var(--reference-unit) * 3)) solid #b6decd;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #e7ebe0;
  font: 400 max(24px, calc(var(--reference-unit) * 56))/1.4 var(--serif, serif);
  letter-spacing: .005em;
  text-decoration: none;
  -webkit-text-fill-color: currentColor;
}
#product-dialog #dialog-album-link > span { min-width: 0; color: inherit; }
#product-dialog #dialog-album-link > svg {
  display: block;
  flex: 0 0 auto;
  width: max(30px, calc(var(--reference-unit) * 56));
  height: max(23px, calc(var(--reference-unit) * 40));
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

#product-dialog .dialog-browsebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: calc(100% - var(--detail-gutter) * 2);
  max-width: none;
  min-width: 0;
  margin: calc(var(--reference-unit) * 42) auto 0;
  padding: 0;
  border: 0;
  background: #000;
}
#product-dialog .dialog-browsebar > .dialog-catalog-count { display: none; }
#product-dialog .dialog-browse-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: calc(var(--reference-unit) * 23);
  width: auto;
  max-width: 48%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #b4bcb1;
}
#product-dialog .dialog-browse-button--next { justify-content: flex-end; }
#product-dialog .dialog-browse-button > span { display: block; }
#product-dialog .dialog-browse-button small {
  color: inherit;
  font: 400 max(12px, calc(var(--reference-unit) * 28))/1.6 var(--serif, serif);
  letter-spacing: .025em;
  white-space: nowrap;
}
#product-dialog [data-dialog-neighbor] { display: none; }
#product-dialog .dialog-browse-button > svg {
  display: block;
  flex: 0 0 auto;
  width: max(24px, calc(var(--reference-unit) * 34));
  height: max(20px, calc(var(--reference-unit) * 25));
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
#product-dialog .dialog-product-page > .dialog-note {
  display: block;
  grid-area: auto;
  align-self: auto;
  width: calc(100% - var(--detail-gutter) * 2);
  max-width: none;
  margin: 0 auto;
  padding: calc(var(--reference-unit) * 16) 0 max(env(safe-area-inset-bottom), calc(var(--reference-unit) * 54));
  color: #8e998d;
  font: 400 max(10px, calc(var(--reference-unit) * 24))/1.7 var(--serif, serif);
  letter-spacing: .01em;
  text-align: left;
}

/* Desktop fits the complete photographic scene beneath the header. The grid
   column follows the 887/970 ratio and the available viewport height; neither
   the photograph nor its floor is cropped. The remaining page scrolls. */
@media (min-width: 1024px) {
  #product-dialog {
    --detail-gutter: clamp(40px, 4.2vw, 80px);
    --reference-title-space: 125px;
    --reference-desktop-copy-width: clamp(300px, 26vw, 420px);
    --reference-desktop-gap: clamp(40px, 4.2vw, 80px);
    --reference-desktop-photo-width: min(1020px, calc((100dvh - 180px) * 887 / 970), calc(100vw - var(--detail-gutter) * 2 - var(--reference-desktop-copy-width) - var(--reference-desktop-gap)));
  }
  #product-dialog .dialog-topbar {
    max-width: 1840px;
    height: 112px;
    margin: 0 auto;
    padding-top: 25px;
  }
  #product-dialog .dialog-topbar .dialog-close > svg { width: 33px; height: 29px; }
  #product-dialog .dialog-brand .brand-logo-frame { width: 128px; }
  #product-dialog .dialog-main {
    display: grid;
    grid-template-columns: minmax(0, var(--reference-desktop-photo-width)) var(--reference-desktop-copy-width);
    align-items: start;
    justify-content: center;
    gap: var(--reference-desktop-gap);
    max-width: 1840px;
    margin: 0 auto;
    padding: 0 var(--detail-gutter);
  }
  #product-dialog .dialog-gallery { min-width: 0; }
  #product-dialog #photo-window { height: auto; min-height: 0; aspect-ratio: 887 / 970; }
  #product-dialog .dialog-gallery > #dialog-title {
    top: 48px;
    left: 25px;
    max-width: 100px;
    max-height: none;
    font-size: clamp(58px, 4.8vw, 86px);
  }
  #product-dialog .dialog-gallery > .dialog-catalog-location,
  #product-dialog #photo-window > .dialog-catalog-location { top: 24px; right: 28px; }
  #product-dialog .dialog-catalog-count { font-size: 20px; }
  #product-dialog .dialog-gallery > .dialog-modes--top {
    gap: 54px;
    height: 76px;
    padding: 0 24px;
  }
  #product-dialog .dialog-modes > .dialog-mode-button {
    width: 68px;
    min-height: 52px;
    padding-bottom: 12px;
    font-size: 22px;
  }
  #product-dialog .dialog-modes > .dialog-mode-button::after { bottom: 1px; width: 56px; height: 2px; }
  #product-dialog .dialog-copy {
    width: 100%;
    padding: clamp(80px, calc(var(--reference-desktop-photo-width) * .38), 320px) 0 0;
  }
  #product-dialog .dialog-copy > .eyebrow { margin-bottom: 26px; font-size: 16px; line-height: 1.7; }
  #product-dialog .dialog-facts dd { font-size: clamp(21px, 1.6vw, 29px); line-height: 1.8; }
  #product-dialog .dialog-consult { margin-top: 58px; }
  #product-dialog .dialog-consult a#dialog-album-link.ui49-primary,
  #product-dialog .dialog-consult a#dialog-album-link.ui49-primary:is(:link, :visited, :hover, :active, :focus, :focus-visible) {
    min-height: 76px;
    padding: 12px 0;
    border-bottom-width: 1px;
    font-size: clamp(29px, 2.2vw, 39px);
  }
  #product-dialog #dialog-album-link > svg { width: 43px; height: 31px; }
  #product-dialog .dialog-browsebar {
    max-width: calc(1840px - var(--detail-gutter) * 2);
    margin-top: 40px;
  }
  #product-dialog .dialog-browse-button { gap: 18px; min-height: 52px; }
  #product-dialog .dialog-browse-button small { font-size: 16px; }
  #product-dialog .dialog-browse-button > svg { width: 30px; height: 24px; }
  #product-dialog .dialog-product-page > .dialog-note {
    max-width: calc(1840px - var(--detail-gutter) * 2);
    padding: 12px 0 40px;
    font-size: 13px;
  }
}

@media (hover: hover) and (pointer: fine) {
  #product-dialog .dialog-consult a#dialog-album-link.ui49-primary:hover { color: #f5f8ed; border-bottom-color: #d3eee1; }
  #product-dialog .dialog-topbar .dialog-close:hover,
  #product-dialog .dialog-browse-button:hover { color: #edf2e5; }
}
#product-dialog :focus-visible { outline: 1px solid #c5e3d2; outline-offset: 5px; }
